This PR completely replaces Django with FastAPI in our API, while keeping functionality largely the same as before.
Changes:
Replaced Django with FastAPI
Added SQLModel and Alembic for connecting and managing our database
Updated our database models. The biggest change here is for IGDB, we are using a single JSON column instead of multiple fields
Updated Dockerfile to work with FastAPI
Updated parse_datasets.py to create mock data
Migration Guide:
I found it to be much easier to simply recreate the game-recommender database. Django created a lot of tables and other metadata that doesn't do well with running migrations using Alembic.
I was able to drop the database this way:
# Log into postgres
psql -U USER game-recommender
DROP DATABASE game-recommender
Once you recreate the database, I updated the readme to include running migrations and the server itself. The flow should be very similar to what we had before.
Testing
Here is a screenshot after populating the database using parse_dataset.py and hitting our GET /api/games endpoint.
This PR completely replaces Django with FastAPI in our API, while keeping functionality largely the same as before.
Changes:
Migration Guide: I found it to be much easier to simply recreate the game-recommender database. Django created a lot of tables and other metadata that doesn't do well with running migrations using Alembic.
I was able to drop the database this way:
Once you recreate the database, I updated the readme to include running migrations and the server itself. The flow should be very similar to what we had before.
Testing
Here is a screenshot after populating the database using parse_dataset.py and hitting our GET /api/games endpoint.