项目作者: creativetimofficial

项目描述 :
Argon Dashboard - Flask Template | Creative-Tim
高级语言: CSS
项目地址: git://github.com/creativetimofficial/argon-dashboard-flask.git
创建时间: 2020-07-30T10:32:36Z
项目社区:https://github.com/creativetimofficial/argon-dashboard-flask

开源协议:MIT License

下载


Argon Dashboard Flask Tweet

version GitHub issues open GitHub issues closed Join the chat at https://gitter.im/NIT-dgp/General Chat

Argon Dashboard Flask - Admin Dashboard coded in Django.


Free product - Flask Dashboard starter project - Features:

  • Up-to-date dependencies: Flask 2.0.1
  • SCSS compilation via Gulp
  • UI Kit: Argon Dashboard (Free Version) provided by Creative-Tim
  • Flask Codebase - provided by AppSeed
  • SQLite, PostgreSQL, SQLAlchemy ORM
  • Alembic (DB schema migrations)
  • Modular design with Blueprints
  • Session-Based authentication (via flask_login)
  • Forms validation
  • Deployment scripts: Docker, Gunicorn / Nginx, Heroku


Table of Contents


Demo

To authenticate use the default credentials test / pass or create a new user on the registration page.


Docker Support

Get the code

  1. $ git clone https://github.com/app-generator/argon-dashboard-flask.git
  2. $ cd argon-dashboard-flask

Start the app in Docker

  1. $ docker-compose pull # download dependencies
  2. $ docker-compose build # local set up
  3. $ docker-compose up -d # start the app

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


Quick start

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.

  1. $ # Get the code
  2. $ git clone https://github.com/creativetimofficial/argon-dashboard-flask.git
  3. $ cd argon-dashboard-flask
  4. $
  5. $ # Virtualenv modules installation (Unix based systems)
  6. $ virtualenv env
  7. $ source env/bin/activate
  8. $
  9. $ # Virtualenv modules installation (Windows based systems)
  10. $ # virtualenv env
  11. $ # .\env\Scripts\activate
  12. $
  13. $ # Install modules - SQLite Database
  14. $ pip3 install -r requirements.txt
  15. $
  16. $ # OR with PostgreSQL connector
  17. $ # pip install -r requirements-pgsql.txt
  18. $
  19. $ # Set the FLASK_APP environment variable
  20. $ (Unix/Mac) export FLASK_APP=run.py
  21. $ (Windows) set FLASK_APP=run.py
  22. $ (Powershell) $env:FLASK_APP = ".\run.py"
  23. $
  24. $ # Set up the DEBUG environment
  25. $ # (Unix/Mac) export FLASK_ENV=development
  26. $ # (Windows) set FLASK_ENV=development
  27. $ # (Powershell) $env:FLASK_ENV = "development"
  28. $
  29. $ # Start the application (development mode)
  30. $ # --host=0.0.0.0 - expose the app on all network interfaces (default 127.0.0.1)
  31. $ # --port=5000 - specify the app port (default 5000)
  32. $ flask run --host=0.0.0.0 --port=5000
  33. $
  34. $ # Access the dashboard in browser: http://127.0.0.1:5000/

Note: To use the app, please access the registration page and create a new user. After authentication, the app will unlock the private pages.


Documentation

The documentation for the Argon Dashboard Flask is hosted at our website.


File Structure

Within the download you’ll find the following directories and files:

  1. < PROJECT ROOT >
  2. |
  3. |-- apps/
  4. | |
  5. | |-- home/ # A simple app that serve HTML files
  6. | | |-- routes.py # Define app routes
  7. | |
  8. | |-- authentication/ # Handles auth routes (login and register)
  9. | | |-- routes.py # Define authentication routes
  10. | | |-- models.py # Defines models
  11. | | |-- forms.py # Define auth forms (login and register)
  12. | |
  13. | |-- static/
  14. | | |-- <css, JS, images> # CSS files, Javascripts files
  15. | |
  16. | |-- templates/ # Templates used to render pages
  17. | | |-- includes/ # HTML chunks and components
  18. | | | |-- navigation.html # Top menu component
  19. | | | |-- sidebar.html # Sidebar component
  20. | | | |-- footer.html # App Footer
  21. | | | |-- scripts.html # Scripts common to all pages
  22. | | |
  23. | | |-- layouts/ # Master pages
  24. | | | |-- base-fullscreen.html # Used by Authentication pages
  25. | | | |-- base.html # Used by common pages
  26. | | |
  27. | | |-- accounts/ # Authentication pages
  28. | | | |-- login.html # Login page
  29. | | | |-- register.html # Register page
  30. | | |
  31. | | |-- home/ # UI Kit Pages
  32. | | |-- index.html # Index page
  33. | | |-- 404-page.html # 404 page
  34. | | |-- *.html # All other pages
  35. | |
  36. | config.py # Set up the app
  37. | __init__.py # Initialize the app
  38. |
  39. |-- requirements.txt # Development modules - SQLite storage
  40. |-- requirements-mysql.txt # Production modules - Mysql DMBS
  41. |-- requirements-pqsql.txt # Production modules - PostgreSql DMBS
  42. |
  43. |-- Dockerfile # Deployment
  44. |-- docker-compose.yml # Deployment
  45. |-- gunicorn-cfg.py # Deployment
  46. |-- nginx # Deployment
  47. | |-- appseed-app.conf # Deployment
  48. |
  49. |-- .env # Inject Configuration via Environment
  50. |-- run.py # Start the app - WSGI gateway
  51. |
  52. |-- ************************************************************************


The bootstrap flow

  • run.py loads the .env file
  • Initialize the app using the specified profile: Debug or Production
    • If env.DEBUG is set to True the SQLite storage is used
    • If env.DEBUG is set to False the specified DB driver is used (MySql, PostgreSQL)
  • Call the app factory method create_app defined in app/init.py
  • Redirect the guest users to Login page
  • Unlock the pages served by home blueprint for authenticated users


Recompile CSS

To recompile SCSS files, follow this setup:


Step #1 - Install tools

  • NodeJS 12.x or higher
  • Gulp - globally
    • npm install -g gulp-cli
  • Yarn (optional)


Step #2 - Change the working directory to assets folder

  1. $ cd apps/static/assets


Step #3 - Install modules (this will create a classic node_modules directory)

  1. $ npm install
  2. // OR
  3. $ yarn


Step #4 - Edit & Recompile SCSS files

  1. $ gulp scss

The generated file is saved in static/assets/css directory.


Browser Support

At present, we officially aim to support the last two versions of the following browsers:


Resources


Reporting Issues

We use GitHub Issues as the official bug tracker for the Argon Dashboard Flask. Here are some advices for our users that want to report an issue:

  1. Make sure that you are using the latest version of the Argon Dashboard Flask. Check the CHANGELOG from your dashboard on our website.
  2. Providing us reproducible steps for the issue will shorten the time it takes for it to be fixed.
  3. Some issues may be browser-specific, so specifying in what browser you encountered the issue might help.


Technical Support or Questions

If you have questions or need help integrating the product please contact us instead of opening an issue.


Licensing



Social Media



Argon Dashboard Flask - Provided by Creative Tim and AppSeed