Skip to content

Commit cb93744

Browse files
author
Adi Chirilov
committed
Initial Release - v1.0.0.
1 parent 1827e2b commit cb93744

File tree

272 files changed

+60015
-1
lines changed

Some content is hidden

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

272 files changed

+60015
-1
lines changed

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.git
2+
__pycache__
3+
*.pyc
4+
*.pyo
5+
*.pyd

.env

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
DEBUG=True
2+
SECRET_KEY=S3cr3t_K#Key
3+
DB_ENGINE=postgresql
4+
DB_NAME=appseed-flask
5+
DB_HOST=localhost
6+
DB_PORT=5432
7+
DB_USERNAME=appseed
8+
DB_PASS=pass

.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
5+
# tests and coverage
6+
*.pytest_cache
7+
.coverage
8+
9+
# database & logs
10+
*.db
11+
*.sqlite3
12+
*.log
13+
14+
# venv
15+
env
16+
venv
17+
18+
# other
19+
.DS_Store
20+
21+
# sphinx docs
22+
_build
23+
_static
24+
_templates
25+
26+
# javascript
27+
package-lock.json
28+
.vscode/symbols.json

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Change Log
2+
3+
## [1.0.0] 2020-08-26
4+
### 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 config.py .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: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 - present Creative-Tim / AppSeed.us
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

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: 197 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,197 @@
1-
# material-dashboard-flask
1+
# [Material Dashboard Flask](https://www.creative-tim.com/product/material-dashboard-flask) [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social&logo=twitter)](https://twitter.com/home?status=Material%20Dashboard,%20a%20free%20Material%20Bootstrap%204%20Admin%20Template%20%E2%9D%A4%EF%B8%8F%20https%3A//bit.ly/2Lyat1Y%20%23bootstrap%20%23material%20%23design%20%23developers%20%23freebie%20%20via%20%40CreativeTim)
2+
3+
![version](https://img.shields.io/badge/version-1.0.0-blue.svg) [![GitHub issues open](https://img.shields.io/github/issues/creativetimofficial/material-dashboard-flask.svg?maxAge=2592000)](https://github.com/creativetimofficial/material-dashboard-flask/issues?q=is%3Aopen+is%3Aissue) [![GitHub issues closed](https://img.shields.io/github/issues-closed-raw/creativetimofficial/material-dashboard-flask.svg?maxAge=2592000)](https://github.com/creativetimofficial/material-dashboard-flask/issues?q=is%3Aissue+is%3Aclosed) [![Join the chat at https://gitter.im/NIT-dgp/General](https://badges.gitter.im/NIT-dgp/General.svg)](https://gitter.im/creative-tim-general/Lobby) [![Chat](https://img.shields.io/badge/chat-on%20discord-7289da.svg)](https://discord.gg/E4aHAQy)
4+
5+
![Material Dashboard Flask - Admin Dashboard coded in Django.](https://github.com/creativetimofficial/material-dashboard-flask/blob/master/media/material-dashboard-flask-intro.gif)
6+
7+
<br />
8+
9+
> Free product - **Flask Dashboard** starter project - Features:
10+
11+
- UI Kit: **Material Dashboard** (Free Version)
12+
- [Codebase](https://github.com/app-generator/boilerplate-code-flask-dashboard) - provided by **[AppSeed](https://appseed.us/)**
13+
- SQLite, PostgreSQL, SQLAlchemy ORM
14+
- Alembic (DB schema migrations)
15+
- Modular design with **Blueprints**
16+
- Session-Based authentication (via **flask_login**)
17+
- Forms validation
18+
- Deployment scripts: Docker, Gunicorn / Nginx, Heroku
19+
20+
<br />
21+
22+
## Table of Contents
23+
24+
* [Demo](#demo)
25+
* [Quick Start](#quick-start)
26+
* [Documentation](#documentation)
27+
* [File Structure](#file-structure)
28+
* [Browser Support](#browser-support)
29+
* [Resources](#resources)
30+
* [Reporting Issues](#reporting-issues)
31+
* [Technical Support or Questions](#technical-support-or-questions)
32+
* [Licensing](#licensing)
33+
* [Useful Links](#useful-links)
34+
35+
<br />
36+
37+
## Demo
38+
39+
> To authenticate use the default credentials ***test / pass*** or create a new user on the [registration page](https://www.creative-tim.com/live/material-dashboard-flask).
40+
41+
- **Material Dashboard Flask** [Login Page](https://www.creative-tim.com/live/material-dashboard-flask)
42+
43+
<br />
44+
45+
## Quick start
46+
47+
> UNZIP the sources or clone the private repository. After getting the code, open a terminal and navigate to the working directory, with product source code.
48+
49+
```bash
50+
$ # Get the code
51+
$ git clone https://github.com/creativetimofficial/material-dashboard-flask.git
52+
$ cd material-dashboard-flask
53+
$
54+
$ # Virtualenv modules installation (Unix based systems)
55+
$ virtualenv env
56+
$ source env/bin/activate
57+
$
58+
$ # Virtualenv modules installation (Windows based systems)
59+
$ # virtualenv env
60+
$ # .\env\Scripts\activate
61+
$
62+
$ # Install modules - SQLite Database
63+
$ pip3 install -r requirements.txt
64+
$
65+
$ # OR with PostgreSQL connector
66+
$ # pip install -r requirements-pgsql.txt
67+
$
68+
$ # Set the FLASK_APP environment variable
69+
$ (Unix/Mac) export FLASK_APP=run.py
70+
$ (Windows) set FLASK_APP=run.py
71+
$ (Powershell) $env:FLASK_APP = ".\run.py"
72+
$
73+
$ # Set up the DEBUG environment
74+
$ # (Unix/Mac) export FLASK_ENV=development
75+
$ # (Windows) set FLASK_ENV=development
76+
$ # (Powershell) $env:FLASK_ENV = "development"
77+
$
78+
$ # Start the application (development mode)
79+
$ # --host=0.0.0.0 - expose the app on all network interfaces (default 127.0.0.1)
80+
$ # --port=5000 - specify the app port (default 5000)
81+
$ flask run --host=0.0.0.0 --port=5000
82+
$
83+
$ # Access the dashboard in browser: http://127.0.0.1:5000/
84+
```
85+
86+
> Note: To use the app, please access the registration page and create a new user. After authentication, the app will unlock the private pages.
87+
88+
<br />
89+
90+
## Documentation
91+
The documentation for the **Material Dashboard Flask** is hosted at our [website](https://demos.creative-tim.com/material-dashboard-flask/docs/1.0/getting-started/getting-started-flask.html).
92+
93+
<br />
94+
95+
## File Structure
96+
Within the download you'll find the following directories and files:
97+
98+
```bash
99+
< PROJECT ROOT >
100+
|
101+
|-- app/
102+
| |-- home/ # Home Blueprint - serve app pages (private area)
103+
| |-- base/ # Base Blueprint - handles the authentication
104+
| |-- static/
105+
| | |-- <css, JS, images> # CSS files, Javascripts files
106+
| |
107+
| |-- templates/ # Templates used to render pages
108+
| |
109+
| |-- includes/ #
110+
| | |-- navigation.html # Top menu component
111+
| | |-- sidebar.html # Sidebar component
112+
| | |-- footer.html # App Footer
113+
| | |-- scripts.html # Scripts common to all pages
114+
| |
115+
| |-- layouts/ # Master pages
116+
| | |-- base-fullscreen.html # Used by Authentication pages
117+
| | |-- base.html # Used by common pages
118+
| |
119+
| |-- accounts/ # Authentication pages
120+
| |-- login.html # Login page
121+
| |-- register.html # Registration page
122+
|
123+
|-- requirements.txt # Development modules - SQLite storage
124+
|-- requirements-mysql.txt # Production modules - Mysql DMBS
125+
|-- requirements-pqsql.txt # Production modules - PostgreSql DMBS
126+
|
127+
|-- .env # Inject Configuration via Environment
128+
|-- config.py # Set up the app
129+
|-- run.py # Start the app - WSGI gateway
130+
|
131+
|-- ************************************************************************
132+
```
133+
134+
<br />
135+
136+
## Browser Support
137+
138+
At present, we officially aim to support the last two versions of the following browsers:
139+
140+
<img src="https://s3.amazonaws.com/creativetim_bucket/github/browser/chrome.png" width="64" height="64"> <img src="https://s3.amazonaws.com/creativetim_bucket/github/browser/firefox.png" width="64" height="64"> <img src="https://s3.amazonaws.com/creativetim_bucket/github/browser/edge.png" width="64" height="64"> <img src="https://s3.amazonaws.com/creativetim_bucket/github/browser/safari.png" width="64" height="64"> <img src="https://s3.amazonaws.com/creativetim_bucket/github/browser/opera.png" width="64" height="64">
141+
142+
<br />
143+
144+
## Resources
145+
146+
- Demo: <https://www.creative-tim.com/live/material-dashboard-flask>
147+
- Download Page: <https://www.creative-tim.com/product/material-dashboard-flask>
148+
- Documentation: <https://demos.creative-tim.com/material-dashboard-flask/docs/1.0/getting-started/getting-started-flask.html>
149+
- License Agreement: <https://www.creative-tim.com/license>
150+
- Support: <https://www.creative-tim.com/contact-us>
151+
- Issues: [Github Issues Page](https://github.com/creativetimofficial/material-dashboard-flask/issues)
152+
153+
<br />
154+
155+
## Reporting Issues
156+
157+
We use GitHub Issues as the official bug tracker for the **Material Dashboard Flask**. Here are some advices for our users that want to report an issue:
158+
159+
1. Make sure that you are using the latest version of the **Material Dashboard Flask**. Check the CHANGELOG from your dashboard on our [website](https://www.creative-tim.com/).
160+
2. Providing us reproducible steps for the issue will shorten the time it takes for it to be fixed.
161+
3. Some issues may be browser-specific, so specifying in what browser you encountered the issue might help.
162+
163+
<br />
164+
165+
## Technical Support or Questions
166+
167+
If you have questions or need help integrating the product please [contact us](https://www.creative-tim.com/contact-us) instead of opening an issue.
168+
169+
<br />
170+
171+
## Licensing
172+
173+
- Copyright 2019 - present [Creative Tim](https://www.creative-tim.com/)
174+
- Licensed under [Creative Tim EULA](https://www.creative-tim.com/license)
175+
176+
<br />
177+
178+
## Useful Links
179+
180+
- [More products](https://www.creative-tim.com/bootstrap-themes) from Creative Tim
181+
- [Tutorials](https://www.youtube.com/channel/UCVyTG4sCw-rOvB9oHkzZD1w)
182+
- [Freebies](https://www.creative-tim.com/bootstrap-themes/free) from Creative Tim
183+
- [Affiliate Program](https://www.creative-tim.com/affiliates/new) (earn money)
184+
185+
<br />
186+
187+
## Social Media
188+
189+
- Twitter: <https://twitter.com/CreativeTim>
190+
- Facebook: <https://www.facebook.com/CreativeTim>
191+
- Dribbble: <https://dribbble.com/creativetim>
192+
- Instagram: <https://www.instagram.com/CreativeTimOfficial>
193+
194+
<br />
195+
196+
---
197+
[Material Dashboard Flask](https://www.creative-tim.com/product/material-dashboard-flask) - Provided by [Creative Tim](https://www.creative-tim.com/) and [AppSeed](https://appseed.us)

app/__init__.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# -*- encoding: utf-8 -*-
2+
"""
3+
Copyright (c) 2019 - present AppSeed.us
4+
"""
5+
6+
from flask import Flask, url_for
7+
from flask_login import LoginManager
8+
from flask_sqlalchemy import SQLAlchemy
9+
from importlib import import_module
10+
from logging import basicConfig, DEBUG, getLogger, StreamHandler
11+
from os import path
12+
13+
db = SQLAlchemy()
14+
login_manager = LoginManager()
15+
16+
def register_extensions(app):
17+
db.init_app(app)
18+
login_manager.init_app(app)
19+
20+
def register_blueprints(app):
21+
for module_name in ('base', 'home'):
22+
module = import_module('app.{}.routes'.format(module_name))
23+
app.register_blueprint(module.blueprint)
24+
25+
def configure_database(app):
26+
27+
@app.before_first_request
28+
def initialize_database():
29+
db.create_all()
30+
31+
@app.teardown_request
32+
def shutdown_session(exception=None):
33+
db.session.remove()
34+
35+
def create_app(config):
36+
app = Flask(__name__, static_folder='base/static')
37+
app.config.from_object(config)
38+
register_extensions(app)
39+
register_blueprints(app)
40+
configure_database(app)
41+
return app

app/base/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# -*- encoding: utf-8 -*-
2+
"""
3+
Copyright (c) 2019 - present AppSeed.us
4+
"""
5+
6+
from flask import Blueprint
7+
8+
blueprint = Blueprint(
9+
'base_blueprint',
10+
__name__,
11+
url_prefix='',
12+
template_folder='templates',
13+
static_folder='static'
14+
)

0 commit comments

Comments
 (0)