Skip to content

Latest commit

 

History

History
105 lines (72 loc) · 2.22 KB

README.md

File metadata and controls

105 lines (72 loc) · 2.22 KB

Service-Project

its teh service project...

Contributing

Python 3.10+

python -m venv .venv
. .venv/bin/activate
pip install pip -U
pip install -r requirements.txt -r dev-requirements.txt -U

alembic upgrade head

uvicorn api.main:app --reload --port 8080

Create a Migration

alembic revision --autogenerate -m "add/update ..."

# make sure the migration was generated properly
nvim ./alembic/versions/<revision>.py

alembic upgrade head

Reset database

sql# DROP TABLE "user" CASCADE;
DROP TABLE opp CASCADE;
DROP TABLE user_opp_association CASCADE;
DROP TABLE alembic_version;

rm -rf alembic/versions/*

alembic revision --autogenerate -m "init"
alembic upgrade head

SQLAlchemy Docs

https://docs.sqlalchemy.org/en/14/orm/queryguide.html https://docs.sqlalchemy.org/en/14/tutorial/orm_data_manipulation.html

Docker

docker build -t fastapi .
docker run -d --name ai-service-project-api -p 8080:80 fastapi

If the docker file is changed

docker ps -a
docker stop <id>
docker rm <id>

docker build -t fastapi .
docker run -d --name ai-service-project-api -p 8080:80 fastapi

TODO

URGENT

  • sync types with FE
  • switch db provider

Current

Done