Skip to content

abmodelis/abmodel-backend

Repository files navigation

API of ABMODEL course platform

This is the API of ABMODEL course platform.

Pre-requisites

Installation

Create virtual environment

Only using python 3.11+

  • Windows:
python -m venv .venv
.venv\Scripts\activate
  • Linux/Mac:
python3 -m venv .venv
.venv/bin/activate

Using anaconda

conda create -n abmodel python=3.11
conda activate abmodel

Using Pyenv. The .python-version file should be in the root of the project, this file activates the virtual environment automatically, you can run pyenv activate abmodel to activate manually the virtual environment.

pyenv install 3.11.8
pyenv virtualenv 3.11.8 abmodel

Install dependencies

pip install -r requirements.txt

Database configuration (PostgreSQL)

  • Copy .env.example to .env
  • Set env variables in .env
DB_USER=your_username
DB_PASS=your_password
DB_NAME=your_dbname
DB_HOST=localhost # or your db host for example: domain-db.com
DB_PORT=5432

Run migrations

It will create the tables if they do not exist, It requires the database to be running.

alembic upgrade head

Run server

uvicorn app:api --reload

Now you can visit http://127.0.0.1:8000/

You can also visit http://127.0.0.1:8000/docs/ or http://127.0.0.1:8000/redoc/ for API documentation

For more details, please visit https://fastapi.tiangolo.com

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •