Skip to content

TechVisionn/tech-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Visiona - Tech-backend Project

This is built with Flask, Flask-RESTful, MongoDB, Redis and MySql

Pre-requirements

Recommended IDEAs

How to install WSL 2 and Docker

  • step 1 (PowerShell Admin):
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
  • step 2 (PowerShell Admin):
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
wsl --set-default-version 2

The IDE must load the Python packages from venv

Environment Settings

Step 1

  • Into the local repository folder, run:
python3 -m venv venv
  • After activate the Python venv
source venv/Scripts/activate
  • Update pip package
python3 -m pip install -U pip

Step 2

  • Installing the Python project's dependency packages
pip install --upgrade pip setuptools wheel
pip install -r requirements.txt

Important Notes

  • If new or updated dependency package was added in the project structure, the requirements.txt must be updated
pip freeze > requirements.txt

Notes

  • You will need to declare the database connection information in the config_app.py and mongo_serve in folder db file before running the application.
  • The Flask app will be online in the port 5000
  • The Redis Caching will be online in the port 6379 (details in docker-compose.yml file)
  • The MSSQL Database will be online in the port 1433

Running Flask back-end

  1. Start Redis with Docker:
# In the project root folder
cd docker
docker-compose up --force-recreate -d ; docker-compose logs -f

To stop docker:

docker stop
  1. Open the "flaskr" folder in console with following command:
cd ../flaskr
  1. If you want to run in development mode, run these commands in folder flaskr:
export FLASK_ENV=development
export FLASK_APP=app.py
export FLASK_DEBUG=1
  1. And finally execute:
flask run

About

Back-end project using Flask and Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages