REST API built with Flask and Python to manage characters and locations
from The Simpsons universe, including a favorites system per user.
- Python / Flask
- SQLAlchemy (ORM)
- PostgreSQL
- Flask-Migrate
- Flask-CORS
- Blueprint Architecture
| Method |
Route |
Description |
| GET |
/api/users |
Get all users |
| GET |
/api/users/ |
Get user by ID |
| POST |
/api/users |
Create a new user |
| Method |
Route |
Description |
| GET |
/api/characters |
Get all characters |
| POST |
/api/characters |
Create a new character |
| Method |
Route |
Description |
| GET |
/api/locations |
Get all locations |
| POST |
/api/locations |
Create a new location |
| Method |
Route |
Description |
| POST |
/api/favorite/character/<char_id>/user/<user_id> |
Add character to favorites |
| DELETE |
/api/favorite/character/<char_id>/user/<user_id> |
Remove character from favorites |
| POST |
/api/favorite/location/<locs_id>/user/<user_id> |
Add location to favorites |
| DELETE |
/api/favorite/location/<locs_id>/user/<user_id> |
Remove location from favorites |
- Clone the repository
- Install dependencies:
pipenv install
- Create the database and run migrations:
pipenv run migrate && pipenv run upgrade
- Start the server:
pipenv run start
Marco Cebrian — @marcocebrian55