Skip to content

Commit

Permalink
Release v1.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
app-generator committed May 25, 2022
1 parent 291003f commit 2cce17d
Show file tree
Hide file tree
Showing 471 changed files with 52,913 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.git
__pycache__
*.pyc
*.pyo
*.pyd
9 changes: 9 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# True for development, False for production
DEBUG=True

# Flask ENV
FLASK_APP=run.py
FLASK_ENV=development

# Used for CDN (in production)
ASSETS_ROOT=/static/assets # !!! Without Slash at the end !!!
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]

# tests and coverage
*.pytest_cache
.coverage

# database & logs
*.db
*.sqlite3
*.log

# venv
env
venv

# other
.DS_Store

# sphinx docs
_build
_static
_templates

# javascript
package-lock.json
.vscode/symbols.json

apps/static/assets/node_modules
apps/static/assets/yarn.lock
apps/static/assets/.temp

9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Change Log

## [1.0.7] 2022-05-25
### Improvements

- Built with [Volt Dashboard Generator](https://appseed.us/generator/volt-dashboard/)
- Timestamp: `2022-05-25 22:26`
- Codebase refactoring
- Added CDN Support
- via `.env` **ASSETS_ROOT**

## [1.0.6] 2022-01-16
### Improvements

Expand Down
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM python:3.9

COPY . .

# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# install python dependencies
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt

# gunicorn
CMD ["gunicorn", "--config", "gunicorn-cfg.py", "run:app"]
32 changes: 32 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# MIT License

Copyright (c) 2019 - present [AppSeed](http://appseed.us/)

<br />

## Licensing Information

<br />

| Item | - |
| ---------------------------------- | --- |
| License Type | MIT |
| Use for print | **YES** |
| Create single personal website/app | **YES** |
| Create single website/app for client | **YES** |
| Create multiple website/apps for clients | **YES** |
| Create multiple SaaS applications | **YES** |
| End-product paying users | **YES** |
| Product sale | **YES** |
| Remove footer credits | **YES** |
| --- | --- |
| Remove copyright mentions from source code | NO |
| Production deployment assistance | NO |
| Create HTML/CSS template for sale | NO |
| Create Theme/Template for CMS for sale | NO |
| Separate sale of our UI Elements | NO |

<br />

---
For more information regarding licensing, please contact the AppSeed Service < *[email protected]* >
219 changes: 219 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
# Flask Volt Dashboard

Open-Source **Flask Dashboard** generated by the `AppSeed` platform with basic modules, database, authentication and deployment scripts on top of **[Volt Dashboard](https://appseed.us/generator/volt-dashboard/)** (free version). Volt Dashboard is a free and open source **Bootstrap 5** dashboard template featuring over 100 components, 11 example pages and 3 plugins with Vanilla JS. There are more than 100 free Bootstrap 5 components included some of them being buttons, alerts, modals, datepickers and so on.

<br />

> Built with [Volt Dashboard Generator](https://appseed.us/generator/volt-dashboard/)
- Timestamp: `2022-05-25 22:26`
- Build ID: `2752bd45-7b3f-49ac-b4a9-b88abdec58e6`
- **Free [Support](https://appseed.us/support/)** (registered users) via `Email` and `Discord`

<br />

> Features
- `Up-to-date dependencies`
- Database: `sqlite`
- `DB Tools`: SQLAlchemy ORM, Flask-Migrate (schema migrations)
- Session-Based authentication (via **flask_login**), Forms validation

<br />

![Volt Dashboard - Full-Stack Starter generated by AppSeed.](https://user-images.githubusercontent.com/51070104/168843604-b026fd94-5969-4be7-81ac-5887cf0958e5.png)

<br />


## ✨ Start the app in Docker

> **Step 1** - Download the code from the GH repository (using `GIT`)
```bash
$ # Get the code
$ git clone https://github.com/app-generator/flask-volt-dashboard.git
$ cd flask-volt-dashboard
```

<br />

> **Step 2** - Edit `.env` and set `DEBUG=True`. This will activate the `SQLite` persistance.
```txt
DEBUG=True
```

<br />

> **Step 3** - Start the APP in `Docker`
```bash
$ docker-compose up --build
```

Visit `http://localhost:85` in your browser. The app should be up & running.

<br />

## ✨ How to use it

> Download the code
```bash
$ # Get the code
$ git clone https://github.com/app-generator/flask-volt-dashboard.git
$ cd flask-volt-dashboard
```

<br />

### 👉 Set Up for `Unix`, `MacOS`

> Install modules via `VENV`
```bash
$ virtualenv env
$ source env/bin/activate
$ pip3 install -r requirements.txt
```

<br />

> Set Up Flask Environment
```bash
$ export FLASK_APP=run.py
$ export FLASK_ENV=development
```

<br />

> Start the app
```bash
$ flask run
```

At this point, the app runs at `http://127.0.0.1:5000/`.

<br />

### 👉 Set Up for `Windows`

> Install modules via `VENV` (windows)
```
$ virtualenv env
$ .\env\Scripts\activate
$ pip3 install -r requirements.txt
```

<br />

> Set Up Flask Environment
```bash
$ # CMD
$ set FLASK_APP=run.py
$ set FLASK_ENV=development
$
$ # Powershell
$ $env:FLASK_APP = ".\run.py"
$ $env:FLASK_ENV = "development"
```

<br />

> Start the app
```bash
$ flask run
```

At this point, the app runs at `http://127.0.0.1:5000/`.

<br />

### 👉 Create Users

By default, the app redirects guest users to authenticate. In order to access the private pages, follow this set up:

- Start the app via `flask run`
- Access the `registration` page and create a new user:
- `http://127.0.0.1:5000/register`
- Access the `sign in` page and authenticate
- `http://127.0.0.1:5000/login`

<br />

## ✨ Code-base structure

The project is coded using blueprints, app factory pattern, dual configuration profile (development and production) and an intuitive structure presented bellow:

```bash
< PROJECT ROOT >
|
|-- apps/
| |
| |-- home/ # A simple app that serve HTML files
| | |-- routes.py # Define app routes
| |
| |-- authentication/ # Handles auth routes (login and register)
| | |-- routes.py # Define authentication routes
| | |-- models.py # Defines models
| | |-- forms.py # Define auth forms (login and register)
| |
| |-- static/
| | |-- <css, JS, images> # CSS files, Javascripts files
| |
| |-- templates/ # Templates used to render pages
| | |-- includes/ # HTML chunks and components
| | | |-- navigation.html # Top menu component
| | | |-- sidebar.html # Sidebar component
| | | |-- footer.html # App Footer
| | | |-- scripts.html # Scripts common to all pages
| | |
| | |-- layouts/ # Master pages
| | | |-- base-fullscreen.html # Used by Authentication pages
| | | |-- base.html # Used by common pages
| | |
| | |-- accounts/ # Authentication pages
| | | |-- login.html # Login page
| | | |-- register.html # Register page
| | |
| | |-- home/ # UI Kit Pages
| | |-- index.html # Index page
| | |-- 404-page.html # 404 page
| | |-- *.html # All other pages
| |
| config.py # Set up the app
| __init__.py # Initialize the app
|
|-- requirements.txt # App Dependencies
|
|-- .env # Inject Configuration via Environment
|-- run.py # Start the app - WSGI gateway
|
|-- ************************************************************************
```

<br />

## ✨ PRO Version

> For more components, pages and priority on support, feel free to take a look at this amazing starter:
Volt Pro is a premium Bootstrap 5 Admin Dashboard featuring over 800 components, 20 example pages and 10 fully customized plugin written in Vanilla Javascript.

- 👉 [Flask Volt PRO](https://appseed.us/product/volt-dashboard-pro/flask/) - product page
- 👉 [Flask Volt PRO](https://flask-volt-pro.appseed-srv1.com/) - LIVE deployment

<br >

![Flask Volt PRO - Premium Starter.](https://user-images.githubusercontent.com/51070104/167878207-37758fbf-fbea-4140-9232-d5bf0c6a1fe8.jpg)

<br />

---
Flask Volt Dashboard - Open-source starter generated by **[AppSeed Generator](https://appseed.us/generator/)**.
44 changes: 44 additions & 0 deletions apps/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# -*- encoding: utf-8 -*-
"""
Copyright (c) 2019 - present AppSeed.us
"""

from flask import Flask
from flask_login import LoginManager
from flask_sqlalchemy import SQLAlchemy
from importlib import import_module


db = SQLAlchemy()
login_manager = LoginManager()


def register_extensions(app):
db.init_app(app)
login_manager.init_app(app)


def register_blueprints(app):
for module_name in ('authentication', 'home'):
module = import_module('apps.{}.routes'.format(module_name))
app.register_blueprint(module.blueprint)


def configure_database(app):

@app.before_first_request
def initialize_database():
db.create_all()

@app.teardown_request
def shutdown_session(exception=None):
db.session.remove()


def create_app(config):
app = Flask(__name__)
app.config.from_object(config)
register_extensions(app)
register_blueprints(app)
configure_database(app)
return app
12 changes: 12 additions & 0 deletions apps/authentication/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# -*- encoding: utf-8 -*-
"""
Copyright (c) 2019 - present AppSeed.us
"""

from flask import Blueprint

blueprint = Blueprint(
'authentication_blueprint',
__name__,
url_prefix=''
)
Loading

0 comments on commit 2cce17d

Please sign in to comment.