/benarts-backend

Primary LanguageSCSSOtherNOASSERTION

✨ Start the app in Docker

Step 1 - Download the code from the GH repository (using GIT)

$ # Get the code
$ git clone https://**git url**
$ cd /path/to/directory/backend

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

DEBUG=True

Step 3 - Start the APP in Docker

$ docker-compose up --build 

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


✨ How to use it

Download the code

$ # Get the code
$ git clone https://**git url**
$ cd /path/to/directory/backend

👉 Set Up for Unix, MacOS

Install modules via VENV

$ virtualenv env
$ source env/bin/activate
$ pip3 install -r requirements.txt

Set Up Flask Environment

$ export FLASK_APP=run.py
$ export FLASK_ENV=development

Start the app

$ flask run

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


👉 Set Up for Windows

Install modules via VENV (windows)

$ virtualenv env
$ .\env\Scripts\activate
$ pip3 install -r requirements.txt

Set Up Flask Environment

$ # CMD 
$ set FLASK_APP=run.py
$ set FLASK_ENV=development
$
$ # Powershell
$ $env:FLASK_APP = ".\run.py"
$ $env:FLASK_ENV = "development"

Start the app

$ flask run

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


✨ Code-base structure

The project has a simple, intuitive structure presented bellow:

< PROJECT ROOT >
   |-- instance
        |-- nation.db
   |-- media/
        |-- < media files >
   |-- nginx
        |-- appseed-app.conf
   |-- app/
        |-- api/
            |-- < Api files >  
        |-- models/
            |-- < Model Files files >  
        |-- views/
        |         |-- < Api files >  
        |-- static/
        |    |    |-- <css, JS, images>
        |    |
        |-- templates/
        |         |-- < Jinja template page files >
        |-- __init__.py
        |-- config.py
        |-- extensions.py
        |-- utils.py
   |
   |-- requirements.txt
   |
   |-- CHANGELOG.md
   |
   |-- Dockerfile
   |
   |-- docker-compose.yaml
   |
   |-- gunicorn-cfg.py
   |
   |-- LICENCE.md
   |
   |-- log.json
   |
   |-- Procfile
   |
   |-- README.md
   |
   |-- run.py
   |  
   |-- runtime.txt
   |
   |-- ************************************************************************