A scalable full-stack template with FastAPI backend and React frontend, designed for multiple user roles, supporting both email+password and Google (OAuth2) login, async operations, and JWT authentication.
- Backend: FastAPI, SQLAlchemy (async), Alembic migrations
- Authentication: Email + Password (with JWT access & refresh tokens), Google OAuth2
- Frontend: React + Vite, Tailwind CSS
- State Management: Redux (main app state)
- Database: PostgreSQL (async)
- Caching & Tasks: Redis + Taskiq (async task queue)
- Deployment: Docker
git clone https://github.com/Nachiket-2024/full_stack_template.git
cd full_stack_templateInstructions below assume that you are at the root of the repository while running the commands.
- Install Backend dependencies with pip:
cd backend
pip install -r requirements.txt- Install Frontend dependencies:
cd frontend
npm installAll environment variables are defined in .env.example.
Copy it to .env and update the values with your own credentials:
cp .env.example .envInstructions below assume that you are at the root of the repository while running the commands.
Configure your Google Cloud project and enable the Oauth API before use.
docker compose upOnce the services are running:
- Backend: http://localhost:8000/docs – FastAPI API docs and endpoints
- Frontend: http://localhost:5173 – React + Vite frontend
- PostgreSQL:
localhost:5432– Database ready for connections - Redis:
localhost:6379– Cache and Taskiq broker - Taskiq worker: Automatically listens for async tasks and queues
- Alembic migrations: Run automatically on container startup, ensures DB schema is up to date
Make sure PostgreSQL is running locally and the database exists. Redis can be run locally or via Docker.
cd backend
alembic upgrade head- Alembic migrations: Ensures that the local database schema matches the latest migrations.
uvicorn backend.app.main:app --reloadOnce the services are running:
- Backend: http://localhost:8000/docs – FastAPI API docs and endpoints
- PostgreSQL:
localhost:5432– Database ready for connections - Redis:
localhost:6379– Cache and Taskiq broker
taskiq worker backend.app.taskiq_tasks.email_tasks:broker --reload- Taskiq worker: Listens automatically for async tasks and queues
cd frontend
npm run dev- Frontend: http://localhost:5173 – React + Vite frontend
- All credentials and secrets are loaded from
.env - Alembic is used for database migrations
- Redis + Taskiq are used for async tasks and caching
- Security features include IP rate limiting and brute-force attack prevention integrated in Auth and OAuth flow
- OAuth2 setup requires Google credentials
- JWT access and refresh tokens are handled in auth folder with modular files for clarity
- Redux manages global app state
This project is licensed under the MIT License - see the LICENSE file for details.