saasforge / open-source-saas-boilerpate Goto Github PK
View Code? Open in Web Editor NEWFree SaaS boilerplate (Python/PostgreSQL/ReactJS/Webpack)
Home Page: https://www.saasforge.dev
License: MIT License
Free SaaS boilerplate (Python/PostgreSQL/ReactJS/Webpack)
Home Page: https://www.saasforge.dev
License: MIT License
import jsonpath from 'jsonPath';
should be
import jsonpath from 'jsonpath';
otherwise receiving error during npm run dev
npm -v 5.8.0
ubuntu 19.10
ERROR in ./src/app/dashboard/DashboardShell.jsx
Module not found: Error: Can't resolve 'jsonPath' in '/saasForge/src/app/dashboard'
resolve 'jsonPath' in '/saasForge/src/app/dashboard'
Parsed request is a module
using description file: /saasForge/package.json (relative path: ./src/app/dashboard)
Field 'browser' doesn't contain a valid alias configuration
resolve as module
/saasForge/src/app/dashboard/node_modules doesn't exist or is not a directory
/saasForge/src/app/node_modules doesn't exist or is not a directory
/saasForge/src/node_modules doesn't exist or is not a directory
/node_modules doesn't exist or is not a directory
/node_modules doesn't exist or is not a directory
looking for modules in /saasForge/node_modules
using description file: /saasForge/package.json (relative path: ./node_modules)
Field 'browser' doesn't contain a valid alias configuration
using description file: /saasForge/package.json (relative path: ./node_modules/jsonPath)
no extension
Field 'browser' doesn't contain a valid alias configuration
/saasForge/node_modules/jsonPath doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
/saasForge/node_modules/jsonPath.js doesn't exist
.jsx
Field 'browser' doesn't contain a valid alias configuration
/saasForge/node_modules/jsonPath.jsx doesn't exist
.css
Field 'browser' doesn't contain a valid alias configuration
/saasForge/node_modules/jsonPath.css doesn't exist
as directory
/saasForge/node_modules/jsonPath doesn't exist
[/saasForge/src/app/dashboard/node_modules]
[/saasForge/src/app/node_modules]
[/saasForge/src/node_modules]
[/node_modules]
[/node_modules]
[/saasForge/node_modules/jsonPath]
[/saasForge/node_modules/jsonPath.js]
[/saasForge/node_modules/jsonPath.jsx]
[/saasForge/node_modules/jsonPath.css]
@ ./src/app/dashboard/DashboardShell.jsx 17:0-32 116:18-26
@ ./src/app/dashboard/DashboardApp.jsx
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] dev: `webpack --config webpack.dev.js`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/s13ecre13t/.npm/_logs/2019-12-19T22_21_54_502Z-debug.log
Hi
thanks for sharing this boilerplate, I gets the job done pretty easily.
I believe, a nice-to-have addition would be the support for OpenAPI, maybe through the usage of the generator.
Another one would be move all the parts into docker containers.
Hi there,
Have you considered moving permissions to the principle of a company and multiple users being a member of that company in the capacity of a given role.
For example Joe is the 'owner' of company 1 and company 2, Jane is a manager in company 1, Josie is an accounts person who needs billing only access to company 2. The owner can assign roles to users within that company. The company can be renamed ect.
Is it possible to generate api docs ?
GET http://localhost:5000/static/dist/auth.bundle.js net::ERR_ABORTED 404 (NOT FOUND)
Either incorporating into this repo or a suggestion for an alternative:
Also interested in:
Lmk if I just missed it in the docs
Hey, it would be really awesome if you added some Dockerfiles so people don't need to install dependencies.
trying to run flask dbcreate fails
cd /saasForge/
flask dbcreate
Usage: flask [OPTIONS] COMMAND [ARGS]...
Try "flask --help" for help.Error: No such command "dbcreate".
flask --version
Flask 1.0.2
Python 3.7.5 (default, Nov 20 2019, 09:21:52)
[GCC 9.2.1 20191008]
ubuntu 19.10
I've noticed there is jQuery installed as a dependency in package.json but I can't find where it's used.
https://www.kennethreitz.org/essays/a-better-pip-workflow
This is important because sometimes requirements break due to cascading dependency requirements failure.
Hello,
First of all, very nice work here ! Thanks for sharing your work to the world.
I just cloned your repo and used docker-compose to run the app locally but i got a blank page on http://localhost:5000/auth/login. In the developer console it shown a 404 on http://localhost:5000/static/dist/auth.bundle.js
The reason is if you do not run the
npm install --global npm && \
npm update && \
npm install && \
npm run dev
on your local and mount the repo in /app with your compose file, the generated js etc.. will not be there.
A quick fix would be to comment or delete the volume mount as below because you do it in the Dockerfile:
app:
build: .
depends_on:
- db
environment:
- FLASK_APP=${FLASK_APP:-application}
- FLASK_ENV=${FLASK_ENV:-dev}
- FLASK_RUN_HOST=${FLASK_RUN_HOST:-0.0.0.0}
- jwt_secret_key=${jwt_secret_key:-FAKE_JWT_SECRET_KEY}
- secret_key=${secret_key:-FAKE_SECRET_KEY}
- db_url=postgres://postgres:password@db:5432/dev
ports:
- 5000:5000
# volumes:
# - .:/app
Another solution would be to add the npm stuff in the entrypoint.sh, so it will generate everything at runtime even if you mount the repo. With this solution it will work every time, but with 1 min overhead at starting the app container.
I don't know, you know that better than me for sure !
Error: Cannot find module '/app/webpack.dev.js'
Happens because webpack.dev.js and webpack.common.js are not copied before the npm command. Need to fix the dockerfile.
Hello,
I am trying to demo the application, but I cannot get the email registration to work. I am trying to have the app send emails using my AWS SES account, which I can get working in python with the flask_mail module.
from flask import Flask
from flask_mail import Message
from flask_mail import Mail
app = Flask(name)
app.config.update(dict(
MAIL_DEBUG = True,
MAIL_SERVER = 'email-smtp.us-west-2.amazonaws.com',
MAIL_PORT = 587,
MAIL_USE_TLS = True,
MAIL_USE_SSL = False,
MAIL_USERNAME = 'MYUSERNAME',
MAIL_PASSWORD = 'MYPASSWORD',
ADMIN_EMAIL='[email protected]',
MAIL_DEFAULT_SENDER='[email protected]'
))
mail = Mail(app)
msg = Message('test subject', sender='[email protected]', recipients=['[email protected]'])
msg.body = 'Yes, it works now."
with app.app_context():
mail.send(msg)
Using the above config and code I can get the email sent to my personal gmail account that I am using to register on the SaaSForge boilerplate Please Register page.
I am using the exact same config for my SasSForge Boilerplate .env file, but when I attempt to create my account on the Please Register page, I get the errors about invalid MAIL FROM posted below.
Note that for SES the username and password are strings that are not a traditional [email protected] email address - maybe this is related? Again, when i use the regular flask_mail module I don't have any issue and it logs in the same way.
Any idea how to fix this error so I can register and test the app?
127.0.0.1 - - [21/Oct/2020 23:49:39] "GET /auth/finishregister/c9e75c30-81cc-41b6-84fc-673f7b334ffe96e HTTP/1.1" 200 -
send: 'ehlo 161.133.158.192.in-addr.arpa\r\n'
reply: b'250-email-smtp.amazonaws.com\r\n'
reply: b'250-8BITMIME\r\n'
reply: b'250-SIZE 1048573360\r\n'
reply: b'250-STARTTLS\r\n'
reply: b'250-AUTH PLAIN LOGIN\r\n'
reply: b'250 Ok\r\n'
reply: retcode (250); Msg: b'email-smtp.amazonaws.com#$\nSIZE #$\nSTARTTLS\nAUTH PLAIN LOGIN\nOk'
send: 'STARTTLS\r\n'
reply: b'220 Ready to start TLS\r\n'
reply: retcode (220); Msg: b'Ready to start TLS'
send: 'ehlo 161.133.458.192.in-addr.arpa\r\n'
reply: b'250-email-smtp.amazonaws.com\r\n'
reply: b'250-8BITMIME\r\n'
reply: b'250-SIZE 10485760\r\n'
reply: b'250-STARTTLS\r\n'
reply: b'250-AUTH PLAIN LOGIN\r\n'
reply: b'250 Ok\r\n'
reply: retcode (250); Msg: b'email-smtp.amazonaws.com\n844BITMIME\nSIZE 10483345760\nSTARTTLS\nAUTH PLAIN LOGIN\nOk'
send: 'AUTH PLAIN MYPASSWORD\r\n'
reply: b'235 Authentication successful.\r\n'
reply: retcode (235); Msg: b'Authentication successful.'
send: 'mail FROM: size=2542\r\n'
reply: b'501 Invalid MAIL FROM address provided\r\n'
reply: retcode (501); Msg: b'Invalid MAIL FROM address provided'
send: 'rset\r\n'
reply: b'250 Ok\r\n'
reply: retcode (250); Msg: b'Ok'
send: 'quit\r\n'
reply: b'221 Bye\r\n'
reply: retcode (221); Msg: b'Bye'
Exception in thread Thread-7:
Traceback (most recent call last):
File "/Users/me/git/open-source-saas-boilerpate/venv/lib/python3.8/site-packages/flask_mail.py", line 188, in send
self.host.sendmail(sanitize_address(envelope_from or message.sender),
File "/usr/local/Cellar/[email protected]/3.8.6/Frameworks/Python.framework/Versions/3.8/lib/python3.8/smtplib.py", line 871, in sendmail
raise SMTPSenderRefused(code, resp, from_addr)
smtplib.SMTPSenderRefused: (501, b'Invalid MAIL FROM address provided', '=?utf-8?q?Your_company_name?= MYUSERNAME')
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.