Skip to content

Commit e1e8f40

Browse files
committed
Initial commit
0 parents  commit e1e8f40

File tree

2,460 files changed

+69910
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,460 files changed

+69910
-0
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SECRET_KEY=S3cr3t_K#Key

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
flask/
2+
*.pyc
3+
dev
4+
node_modules
5+
app/database.db
6+
app/build
7+
yarn.lock
8+
yarn-error.log
9+
*.psd
10+
env/
11+
env__/
12+
.vscode/symbols.json
13+
app/db.sqlite3

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Change Log
2+
3+
## [1.0.3] 2021-01-01
4+
### Improvements
5+
6+
- 2021-01-01 - Registration
7+
- Hide the form on success
8+
9+
- 2020-06-28 - Update the UI Kit
10+
- Quick UI KIt by Webpixels
11+
12+
- 2020-06-22 - Added HEROKU support. Impacted files:
13+
- runtime.txt - Bump the Python version to 3.6.10
14+
- README added new section for HEROKU deployment
15+
16+
## [1.0.2] 2020-06-18
17+
### Improvements
18+
19+
- The password storage is now Bcrypt.hashed
20+
- Added deploy scripts: Docker, Gunicorn
21+
- Added `.env`
22+
- Added `python-decouple` in `requirements.txt`
23+
- Update Sample UI Kit - [Neumorphism UI](https://themesberg.com/product/ui-kits/neumorphism-ui) by Themesberg
24+
25+
## [1.0.1] 2020-05-30
26+
### Improvements
27+
28+
- Update Licensing information
29+
- Add CHANGELOG.md to track all changes
30+
- Minor update in README
31+
32+
## [1.0.0] 2020-02-07
33+
### Initial Release

Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM python:3.6
2+
3+
ENV FLASK_APP run.py
4+
5+
COPY run.py gunicorn-cfg.py requirements.txt .env ./
6+
COPY app app
7+
8+
RUN pip install -r requirements.txt
9+
10+
EXPOSE 5005
11+
CMD ["gunicorn", "--config", "gunicorn-cfg.py", "run:app"]

LICENSE.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# MIT License
2+
3+
Copyright (c) 2019 - present [AppSeed](http://appseed.us/)
4+
5+
<br />
6+
7+
## Licensing Information
8+
9+
<br />
10+
11+
| Item | - |
12+
| ---------------------------------- | --- |
13+
| License Type | MIT |
14+
| Use for print | **YES** |
15+
| Create single personal website/app | **YES** |
16+
| Create single website/app for client | **YES** |
17+
| Create multiple website/apps for clients | **YES** |
18+
| Create multiple SaaS applications | **YES** |
19+
| End-product paying users | **YES** |
20+
| Product sale | **YES** |
21+
| Remove footer credits | **YES** |
22+
| --- | --- |
23+
| Remove copyright mentions from source code | NO |
24+
| Create HTML/CSS template for sale | NO |
25+
| Create Theme/Template for CMS for sale | NO |
26+
| Separate sale of our UI Elements | NO |
27+
28+
<br />
29+
30+
---
31+
For more information regarding licensing, please contact the AppSeed Service < *support@appseed.us* >

LICENSE_commercial.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Commercial License
2+
3+
Copyright (c) 2019 - present [AppSeed](http://appseed.us/)
4+
5+
<br />
6+
7+
## Licensing Information
8+
9+
All commercial web apps (including this one) provided by AppSeed are released under two configurations:
10+
11+
<br />
12+
13+
### [Personal License](https://github.com/app-generator/license-personal)
14+
15+
> For full information please access [Personal License](https://github.com/app-generator/license-personal)
16+
17+
- Solo-developers, Small teams (max 3 members)
18+
- Updates: 6mo.
19+
- LIVE Support: 6mo.
20+
- Create single personal website/app
21+
- Create single website/app for client
22+
- Paying end-users - YES
23+
- Create SaaS application - NO
24+
- Production deployment assistance - NO
25+
26+
<br />
27+
28+
### [StartUP License](https://github.com/app-generator/license-startup)
29+
30+
> For full information please access [StartUP License](https://github.com/app-generator/license-startup)
31+
32+
- Medium teams (max 9 members)
33+
- Updates: 12mo.
34+
- LIVE Support: 12mo.
35+
- Create single personal website/app
36+
- Create single website/app for client
37+
- Paying end-users - YES
38+
- Create SaaS application - NO
39+
- Production deployment assistance - NO
40+
41+
<br />
42+
43+
### [Company License](https://github.com/app-generator/license-company)
44+
45+
> For full information please access [Company License](https://github.com/app-generator/license-company)
46+
47+
- Large teams (unlimited members)
48+
- Updates: 12mo.
49+
- LIVE Support: 12mo.
50+
- Create multiple personal websites/apps
51+
- Create multiple websites/apps for clients
52+
- Paying end-users - YES
53+
- Create SINGLE SaaS application - YES
54+
- Production deployment assistance - NO
55+
56+
<br />
57+
58+
---
59+
For more information regarding licensing, please contact the AppSeed Service < *support@appseed.us* >

Procfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: gunicorn run:app --log-file=-

README.md

Lines changed: 235 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
# [Flask Boilerplate](https://appseed.us/boilerplate-code/flask-boilerplate)
2+
3+
> Template [boilerplate code](https://appseed.us/boilerplate-code) used by [AppSeed](https://appseed.us) to generate simple admin dashboards coded in [Flask](https://palletsprojects.com/p/flask/) - Features:
4+
5+
- UI Kit: **Quick** (Free Version) by **Webpixels**
6+
- SQLite database, Flask-SQLAlchemy ORM
7+
- Session-Based auth flow (login, register)
8+
- Deployment scripts: Docker, Gunicorn / Nginx, Heroku
9+
- Support via **Github** (issues tracker) and [Discord](https://discord.gg/fZC6hup).
10+
11+
<br />
12+
13+
> Links
14+
15+
- [Boierplate Code Flask](https://appseed.us/boilerplate-code/flask-boilerplate) - Product page
16+
- [Boierplate Code Flask - Demo](https://boilerplate-code-flask.appseed.us/) - LIVE Demo
17+
- [Boierplate Code Flask - Docs](https://docs.appseed.us/boilerplate-code/flask/) - Documentation
18+
19+
<br />
20+
21+
## Want more? Go PRO!
22+
23+
PRO versions include **Premium UI Kits**, Lifetime updates and **24/7 LIVE Support** (via [Discord](https://discord.gg/fZC6hup))
24+
25+
| [Flask Datta PRO](https://appseed.us/admin-dashboards/flask-dashboard-dattaable-pro) | [Flask Material PRO](https://appseed.us/admin-dashboards/flask-dashboard-material-pro) | [Flask Volt PRO](https://appseed.us/admin-dashboards/flask-dashboard-volt-pro) |
26+
| --- | --- | --- |
27+
| [![Flask Datta PRO](https://raw.githubusercontent.com/app-generator/flask-dashboard-dattaable-pro/master/media/flask-dashboard-dattaable-pro-screen.png)](https://appseed.us/admin-dashboards/flask-dashboard-dattaable-pro) | [![Flask Material PRO](https://raw.githubusercontent.com/app-generator/flask-dashboard-material-pro/master/media/flask-dashboard-material-pro-screen.png)](https://appseed.us/admin-dashboards/flask-dashboard-material-pro) | [![Flask Volt PRO](https://raw.githubusercontent.com/app-generator/flask-dashboard-volt-pro/master/media/flask-dashboard-volt-pro-screen.png)](https://appseed.us/admin-dashboards/flask-dashboard-volt-pro)
28+
29+
<br />
30+
<br />
31+
32+
![Boierplate Code Flask - Template project provided by AppSeed.](https://raw.githubusercontent.com/app-generator/boilerplate-code-flask/master/media/boilerplate-code-flask-screen.png)
33+
34+
<br />
35+
36+
## Build from sources
37+
38+
```bash
39+
$ # Clone the sources
40+
$ git clone https://github.com/app-generator/boilerplate-code-flask.git
41+
$ cd boilerplate-code-flask
42+
$
43+
$ # Virtualenv modules installation (Unix based systems)
44+
$ virtualenv env
45+
$ source env/bin/activate
46+
$
47+
$ # Virtualenv modules installation (Windows based systems)
48+
$ # virtualenv env
49+
$ # .\env\Scripts\activate
50+
$
51+
$ # Install requirements
52+
$ pip3 install -r requirements.txt
53+
$
54+
$ # Set the FLASK_APP environment variable
55+
$ (Unix/Mac) export FLASK_APP=run.py
56+
$ (Windows) set FLASK_APP=run.py
57+
$ (Powershell) $env:FLASK_APP = ".\run.py"
58+
$
59+
$ # Set up the DEBUG environment
60+
$ # (Unix/Mac) export FLASK_ENV=development
61+
$ # (Windows) set FLASK_ENV=development
62+
$ # (Powershell) $env:FLASK_ENV = "development"
63+
$
64+
$ # Run the application
65+
$ # --host=0.0.0.0 - expose the app on all network interfaces (default 127.0.0.1)
66+
$ # --port=5000 - specify the app port (default 5000)
67+
$ flask run --host=0.0.0.0 --port=5000
68+
$
69+
$ # Access the app in browser: http://127.0.0.1:5000/
70+
```
71+
72+
> Note: To use the app, please access the registration page and create a new user. After authentication, the app will unlock the private pages.
73+
74+
<br />
75+
76+
## Code-base structure
77+
78+
The project has a super simple structure, represented as bellow:
79+
80+
```bash
81+
< PROJECT ROOT >
82+
|
83+
|-- app/__init__.py
84+
|-- app/
85+
| |-- static/
86+
| | |-- <css, JS, images> # CSS files, Javascripts files
87+
| |
88+
| |-- templates/
89+
| | |
90+
| | |-- includes/ # Page chunks, components
91+
| | | |
92+
| | | |-- navigation.html # Top bar
93+
| | | |-- sidebar.html # Left sidebar
94+
| | | |-- scripts.html # JS scripts common to all pages
95+
| | | |-- footer.html # The common footer
96+
| | |
97+
| | |-- layouts/ # App Layouts (the master pages)
98+
| | | |
99+
| | | |-- base.html # Used by common pages like index, UI
100+
| | | |-- base-fullscreen.html # Used by auth pages (login, register)
101+
| | |
102+
| | |-- accounts/ # Auth Pages (login, register)
103+
| | | |
104+
| | | |-- login.html # Use layout `base-fullscreen.html`
105+
| | | |-- register.html # Use layout `base-fullscreen.html`
106+
| | |
107+
| | index.html # The default page
108+
| | page-404.html # Error 404 page (page not found)
109+
| | page-500.html # Error 500 page (server error)
110+
| | *.html # All other pages provided by the UI Kit
111+
|
112+
|-- requirements.txt
113+
|
114+
|-- run.py
115+
|
116+
|-- ************************************************************************
117+
```
118+
119+
<br />
120+
121+
## Deployment
122+
123+
The app is provided with a basic configuration to be executed in [Docker](https://www.docker.com/), [Heroku](https://www.heroku.com/), [Gunicorn](https://gunicorn.org/), and [Waitress](https://docs.pylonsproject.org/projects/waitress/en/stable/).
124+
125+
<br />
126+
127+
### [Docker](https://www.docker.com/) execution
128+
---
129+
130+
The application can be easily executed in a docker container. The steps:
131+
132+
> Get the code
133+
134+
```bash
135+
$ git clone https://github.com/app-generator/boilerplate-code-flask.git
136+
$ cd boilerplate-code-flask
137+
```
138+
139+
> Start the app in Docker
140+
141+
```bash
142+
$ sudo docker-compose pull && sudo docker-compose build && sudo docker-compose up -d
143+
```
144+
145+
Visit `http://localhost:5005` in your browser. The app should be up & running.
146+
147+
<br />
148+
149+
### [Heroku](https://www.heroku.com/)
150+
---
151+
152+
Steps to deploy on **Heroku**
153+
154+
- [Create a FREE account](https://signup.heroku.com/) on Heroku platform
155+
- [Install the Heroku CLI](https://devcenter.heroku.com/articles/getting-started-with-python#set-up) that match your OS: Mac, Unix or Windows
156+
- Open a terminal window and authenticate via `heroku login` command
157+
- Clone the sources and push the project for LIVE deployment
158+
159+
```bash
160+
$ # Clone the source code:
161+
$ git clone https://github.com/app-generator/boilerplate-code-flask.git
162+
$ cd boilerplate-code-flask
163+
$
164+
$ # Check Heroku CLI is installed
165+
$ heroku -v
166+
heroku/7.25.0 win32-x64 node-v12.13.0 # <-- All good
167+
$
168+
$ # Check Heroku CLI is installed
169+
$ heroku login
170+
$ # this commaond will open a browser window - click the login button (in browser)
171+
$
172+
$ # Create the Heroku project
173+
$ heroku create
174+
$
175+
$ # Trigger the LIVE deploy
176+
$ git push heroku master
177+
$
178+
$ # Open the LIVE app in browser
179+
$ heroku open
180+
```
181+
182+
<br />
183+
184+
### [Gunicorn](https://gunicorn.org/)
185+
---
186+
187+
Gunicorn 'Green Unicorn' is a Python WSGI HTTP Server for UNIX.
188+
189+
> Install using pip
190+
191+
```bash
192+
$ pip install gunicorn
193+
```
194+
> Start the app using gunicorn binary
195+
196+
```bash
197+
$ gunicorn --bind 0.0.0.0:8001 run:app
198+
Serving on http://localhost:8001
199+
```
200+
201+
Visit `http://localhost:8001` in your browser. The app should be up & running.
202+
203+
<br />
204+
205+
### [Waitress](https://docs.pylonsproject.org/projects/waitress/en/stable/)
206+
---
207+
208+
Waitress (Gunicorn equivalent for Windows) is meant to be a production-quality pure-Python WSGI server with very acceptable performance. It has no dependencies except ones that live in the Python standard library.
209+
210+
> Install using pip
211+
212+
```bash
213+
$ pip install waitress
214+
```
215+
> Start the app using [waitress-serve](https://docs.pylonsproject.org/projects/waitress/en/stable/runner.html)
216+
217+
```bash
218+
$ waitress-serve --port=8001 run:app
219+
Serving on http://localhost:8001
220+
```
221+
222+
Visit `http://localhost:8001` in your browser. The app should be up & running.
223+
224+
<br />
225+
226+
## Credits & Links
227+
228+
- [Flask Framework](https://www.palletsprojects.com/p/flask/) - The official website
229+
- [Boilerplate Code](https://appseed.us/boilerplate-code) - Index provided by **AppSeed**
230+
- [Boilerplate Code](https://github.com/app-generator/boilerplate-code) - Index published on Github
231+
232+
<br />
233+
234+
---
235+
[Flask Boilerplate](https://appseed.us/boilerplate-code/flask-boilerplate) - Provided by **AppSeed** [App Generator](https://appseed.us/app-generator).

0 commit comments

Comments
 (0)