Full-stack Star Wars blog project with a Flask REST API, SQLAlchemy models, Flask Admin, database migrations, and a React/Vite reading-list frontend.
The app lets users browse people, planets, and vehicles, open detail pages, and add or remove favorites. Authentication is intentionally not implemented yet, so the API uses a fixed current user (CURRENT_USER_ID = 1) and users can be managed from Flask Admin.
- Backend: Python, Flask, Flask-SQLAlchemy, Flask-Migrate, Flask-Admin, PostgreSQL/SQLite
- Frontend: React, Vite, React Router, Bootstrap, CSS
- Tooling: Pipenv, npm, ESLint, pycodestyle, Alembic migrations
src/ Flask API source code
migrations/ Alembic migration files
frontend/ React/Vite frontend
GET /peopleGET /people/<id>POST /peoplePUT /people/<id>DELETE /people/<id>GET /planetsGET /planets/<id>POST /planetsPUT /planets/<id>DELETE /planets/<id>GET /vehiclesGET /vehicles/<id>POST /vehiclesPUT /vehicles/<id>DELETE /vehicles/<id>GET /usersGET /users/favoritesPOST /favorite/people/<id>POST /favorite/planet/<id>POST /favorite/vehicle/<id>DELETE /favorite/people/<id>DELETE /favorite/planet/<id>DELETE /favorite/vehicle/<id>
Favorites are protected with a database check constraint so a favorite row can point to exactly one entity type: person, planet, or vehicle.
- Responsive catalog for people, planets, and vehicles
- Detail pages for every resource type
- Favorite add/remove actions connected to the Flask API
- Favorites dropdown in the navbar
- Search across people, planets, and vehicles
- Image fallback system using local images, mapped official images, and Star Wars Visual Guide
- Deploy-ready API base URL through
VITE_API_URL
Install backend dependencies:
pipenv installInstall frontend dependencies:
cd frontend
npm installNo extra downloads are needed if those dependencies are already installed in the workspace.
Backend uses DATABASE_URL when available. If it is not set, it falls back to SQLite at /tmp/test.db.
Frontend can use the Vite proxy locally or a deployed API URL:
cd frontend
cp .env.example .envExample frontend variable:
VITE_API_URL=http://localhost:3000For local development with the included Vite proxy, VITE_API_URL can also be left empty.
Prepare the database and seed sample Star Wars data:
pipenv run flask --app src/app.py db upgrade
pipenv run flask --app src/app.py seedStart the backend:
pipenv run startBackend URL:
http://localhost:3000
Start the frontend in another terminal:
cd frontend
npm run devFrontend URL:
http://localhost:5173
Backend:
python -m py_compile src/app.py src/models.py src/admin.py src/utils.py src/wsgi.py
pipenv run pycodestyle --config=pycodestyle.cfg src migrations/versionsFrontend:
cd frontend
npm run lint
npm run buildFlask Admin is available at:
http://localhost:3000/admin
Because authentication is not implemented yet, users should be created directly from Flask Admin or seeded through the database.