- Clone project.
git clone <project url>
- Go to project foolder.
cd <project folder>
- Create virual environment. Command bellow will create environment with your default python version, for other version like
3.10
or3.11
run command with your version.
python3 -m venv .venv
- Activate virtual environment.
source .venv/bin/activate
- Update pip version (OPTIONAL)
pip3 install --upgrade pip
- Install all requirements from
requirements.txt
file.
pip install -r requirements.txt --upgrade
- Create file
.env
in root folder
touch .env
- Open
.env
file in your favorite redactor and add nextenvironments
:
DB_USERNAME=<database_username>
DB_PASSWORD=<secret_password>
DB_HOSTNAME=<database_host>
DB_PORT=<database_port>
DB_NAME=<database_name>
TOKEN_SECRET_KEY=<token_secret_key>
TOKEN_ALGORITHM=<token_algorithm>
TOKEN_EXPIRE_MINUTES=<expire_time_in_minute>
Example .env
file:
DB_USERNAME=postgres
DB_PASSWORD=root
DB_HOSTNAME=localhost
DB_PORT=5432
DB_NAME=kanban_db
TOKEN_SECRET_KEY=dsjghj435ghfghjbmn687gdfhjkhgjkhdfg897456jkhgsdgkh567897dfgh
TOKEN_ALGORITHM=HS256
TOKEN_EXPIRE_MINUTES=60
If you have PostgreSQL
installed in your local machine just add credentials in .env
file
If not use docker to create a container with PostgreSQL
image run docker-compose.yml
file.
docker-compose up -d
Make sure container run successfully
docker ps
- Run
uvicorn
server
uvicorn api.main:app --reload --port=8888
FastApi Application runs on http://localhost:8888
The server will restart automatically when files change