Skip to content

Commit 2f94b9c

Browse files
author
App Generator
committed
Bump UI & Codebase
1 parent c3217e4 commit 2f94b9c

File tree

2,051 files changed

+74744
-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,051 files changed

+74744
-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

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 < *[email protected]* >

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

app/__init__.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# -*- encoding: utf-8 -*-
2+
"""
3+
Copyright (c) 2019 - present AppSeed.us
4+
"""
5+
6+
import os
7+
8+
from flask import Flask
9+
from flask_sqlalchemy import SQLAlchemy
10+
from flask_login import LoginManager
11+
from flask_bcrypt import Bcrypt
12+
13+
# Grabs the folder where the script runs.
14+
basedir = os.path.abspath(os.path.dirname(__file__))
15+
16+
app = Flask(__name__)
17+
18+
app.config.from_object('app.config.Config')
19+
20+
db = SQLAlchemy (app) # flask-sqlalchemy
21+
bc = Bcrypt (app) # flask-bcrypt
22+
23+
lm = LoginManager( ) # flask-loginmanager
24+
lm.init_app(app) # init the login manager
25+
26+
# Setup database
27+
@app.before_first_request
28+
def initialize_database():
29+
db.create_all()
30+
31+
# Import routing, models and Start the App
32+
from app import views, models

app/config.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# -*- encoding: utf-8 -*-
2+
"""
3+
Copyright (c) 2019 - present AppSeed.us
4+
"""
5+
6+
import os
7+
from decouple import config
8+
9+
# Grabs the folder where the script runs.
10+
basedir = os.path.abspath(os.path.dirname(__file__))
11+
12+
class Config():
13+
14+
CSRF_ENABLED = True
15+
16+
# Set up the App SECRET_KEY
17+
SECRET_KEY = config('SECRET_KEY', default='S#perS3crEt_007')
18+
19+
# This will create a file in <app> FOLDER
20+
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'db.sqlite3')
21+
SQLALCHEMY_TRACK_MODIFICATIONS = False

app/forms.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# -*- encoding: utf-8 -*-
2+
"""
3+
Copyright (c) 2019 - present AppSeed.us
4+
"""
5+
6+
from flask_wtf import FlaskForm
7+
from flask_wtf.file import FileField, FileRequired
8+
from wtforms import StringField, TextAreaField, SubmitField, PasswordField
9+
from wtforms.validators import InputRequired, Email, DataRequired
10+
11+
class LoginForm(FlaskForm):
12+
username = StringField (u'Username' , validators=[DataRequired()])
13+
password = PasswordField(u'Password' , validators=[DataRequired()])
14+
15+
class RegisterForm(FlaskForm):
16+
name = StringField (u'Name' )
17+
username = StringField (u'Username' , validators=[DataRequired()])
18+
password = PasswordField(u'Password' , validators=[DataRequired()])
19+
email = StringField (u'Email' , validators=[DataRequired(), Email()])

0 commit comments

Comments
 (0)