|
6 | 6 |
|
7 | 7 | <br /> |
8 | 8 |
|
9 | | -> Free product - **Flask Dashboard** starter project - Features: |
10 | | -
|
11 | | -- Up-to-date [dependencies](./requirements.txt): **Flask 2.0.1** |
12 | | -- [SCSS compilation](#recompile-css) via **Gulp** |
13 | | -- UI Kit: **Material Dashboard - v3.0.0** (Bootstrap 5 Version) by **Creative-Tim** |
14 | | -- Flask Codebase - provided by **[AppSeed](https://appseed.us/)** |
15 | | -- SQLite, PostgreSQL, SQLAlchemy ORM |
16 | | -- Alembic (DB schema migrations) |
17 | | -- Modular design with **Blueprints** |
18 | | -- Session-Based authentication (via **flask_login**) |
19 | | -- Forms validation |
20 | | -- Deployment scripts: Docker, Gunicorn / Nginx, Heroku |
| 9 | +> Features: |
| 10 | +
|
| 11 | +- ✅ `Up-to-date dependencies` |
| 12 | +- ✅ Database: `SQLite` |
| 13 | +- ✅ `DB Tools`: SQLAlchemy ORM, Flask-Migrate (schema migrations) |
| 14 | +- ✅ Session-Based authentication (via **flask_login**), Forms validation |
| 15 | +- ✅ `Docker` |
| 16 | +- ✅ CI/CD via `Render` |
21 | 17 |
|
22 | 18 | <br /> |
23 | 19 |
|
|
47 | 43 |
|
48 | 44 | ## Docker Support |
49 | 45 |
|
50 | | -> Get the code |
| 46 | +> 👉 **Step 1** - Get the code |
51 | 47 |
|
52 | 48 | ```bash |
53 | 49 | $ git clone https://github.com/app-generator/material-dashboard-flask.git |
54 | 50 | $ cd material-dashboard-flask |
55 | 51 | ``` |
56 | 52 |
|
57 | | -> Start the app in Docker |
| 53 | +> 👉 **Step 2** - Start the APP in `Docker` |
58 | 54 |
|
59 | 55 | ```bash |
60 | | -$ docker-compose pull # download dependencies |
61 | | -$ docker-compose build # local set up |
62 | | -$ docker-compose up -d # start the app |
| 56 | +$ docker-compose up --build |
63 | 57 | ``` |
64 | 58 |
|
65 | | -Visit `http://localhost:85` in your browser. The app should be up & running. |
| 59 | +Visit `http://localhost:5085` in your browser. The app should be up & running. |
66 | 60 |
|
67 | 61 | <br /> |
68 | 62 |
|
69 | | -## Quick start |
| 63 | +## Manual Build |
70 | 64 |
|
71 | | -> 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. |
| 65 | +> 👉 **Step 1** - Get the code |
72 | 66 |
|
73 | 67 | ```bash |
74 | 68 | $ # Get the code |
@@ -112,122 +106,8 @@ $ # Access the dashboard in browser: http://127.0.0.1:5000/ |
112 | 106 | <br /> |
113 | 107 |
|
114 | 108 | ## Documentation |
115 | | -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). |
116 | | - |
117 | | -<br /> |
118 | | - |
119 | | -## File Structure |
120 | | -Within the download you'll find the following directories and files: |
121 | | - |
122 | | -```bash |
123 | | -< PROJECT ROOT > |
124 | | - | |
125 | | - |-- apps/ |
126 | | - | | |
127 | | - | |-- home/ # A simple app that serve HTML files |
128 | | - | | |-- routes.py # Define app routes |
129 | | - | | |
130 | | - | |-- authentication/ # Handles auth routes (login and register) |
131 | | - | | |-- routes.py # Define authentication routes |
132 | | - | | |-- models.py # Defines models |
133 | | - | | |-- forms.py # Define auth forms (login and register) |
134 | | - | | |
135 | | - | |-- static/ |
136 | | - | | |-- <css, JS, images> # CSS files, Javascripts files |
137 | | - | | |
138 | | - | |-- templates/ # Templates used to render pages |
139 | | - | | |-- includes/ # HTML chunks and components |
140 | | - | | | |-- navigation.html # Top menu component |
141 | | - | | | |-- sidebar.html # Sidebar component |
142 | | - | | | |-- footer.html # App Footer |
143 | | - | | | |-- scripts.html # Scripts common to all pages |
144 | | - | | | |
145 | | - | | |-- layouts/ # Master pages |
146 | | - | | | |-- base-fullscreen.html # Used by Authentication pages |
147 | | - | | | |-- base.html # Used by common pages |
148 | | - | | | |
149 | | - | | |-- accounts/ # Authentication pages |
150 | | - | | | |-- login.html # Login page |
151 | | - | | | |-- register.html # Register page |
152 | | - | | | |
153 | | - | | |-- home/ # UI Kit Pages |
154 | | - | | |-- index.html # Index page |
155 | | - | | |-- 404-page.html # 404 page |
156 | | - | | |-- *.html # All other pages |
157 | | - | | |
158 | | - | config.py # Set up the app |
159 | | - | __init__.py # Initialize the app |
160 | | - | |
161 | | - |-- requirements.txt # Development modules - SQLite storage |
162 | | - |-- requirements-mysql.txt # Production modules - Mysql DMBS |
163 | | - |-- requirements-pqsql.txt # Production modules - PostgreSql DMBS |
164 | | - | |
165 | | - |-- Dockerfile # Deployment |
166 | | - |-- docker-compose.yml # Deployment |
167 | | - |-- gunicorn-cfg.py # Deployment |
168 | | - |-- nginx # Deployment |
169 | | - | |-- appseed-app.conf # Deployment |
170 | | - | |
171 | | - |-- .env # Inject Configuration via Environment |
172 | | - |-- run.py # Start the app - WSGI gateway |
173 | | - | |
174 | | - |-- ************************************************************************ |
175 | | -``` |
176 | | - |
177 | | -<br /> |
178 | | - |
179 | | -> The bootstrap flow |
180 | | -
|
181 | | -- `run.py` loads the `.env` file |
182 | | -- Initialize the app using the specified profile: *Debug* or *Production* |
183 | | - - If env.DEBUG is set to *True* the SQLite storage is used |
184 | | - - If env.DEBUG is set to *False* the specified DB driver is used (MySql, PostgreSQL) |
185 | | -- Call the app factory method `create_app` defined in app/__init__.py |
186 | | -- Redirect the guest users to Login page |
187 | | -- Unlock the pages served by *home* blueprint for authenticated users |
188 | | - |
189 | | -<br /> |
190 | | - |
191 | | -## Recompile CSS |
192 | | - |
193 | | -To recompile SCSS files, follow this setup: |
194 | | - |
195 | | -<br /> |
196 | | - |
197 | | -**Step #1** - Install tools |
198 | | - |
199 | | -- [NodeJS](https://nodejs.org/en/) 12.x or higher |
200 | | -- [Gulp](https://gulpjs.com/) - globally |
201 | | - - `npm install -g gulp-cli` |
202 | | -- [Yarn](https://yarnpkg.com/) (optional) |
203 | 109 |
|
204 | | -<br /> |
205 | | - |
206 | | -**Step #2** - Change the working directory to `assets` folder |
207 | | - |
208 | | -```bash |
209 | | -$ cd apps/static/assets |
210 | | -``` |
211 | | - |
212 | | -<br /> |
213 | | - |
214 | | -**Step #3** - Install modules (this will create a classic `node_modules` directory) |
215 | | - |
216 | | -```bash |
217 | | -$ npm install |
218 | | -// OR |
219 | | -$ yarn |
220 | | -``` |
221 | | - |
222 | | -<br /> |
223 | | - |
224 | | -**Step #4** - Edit & Recompile SCSS files |
225 | | - |
226 | | -```bash |
227 | | -$ gulp scss |
228 | | -``` |
229 | | - |
230 | | -The generated file is saved in `static/assets/css` directory. |
| 110 | +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). |
231 | 111 |
|
232 | 112 | <br /> |
233 | 113 |
|
|
0 commit comments