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, Material UI
- State Management: Redux (main app state) and optional React Query (server-state caching)
- Database: PostgreSQL (async)
- Caching & Tasks: Redis + Celery
- Deployment: Docker
All environment variables are defined in .env.example
.
Copy it to .env
and update the values with your own credentials:
cp .env.example .env
- Clone the repository
git clone https://github.com/Nachiket-2024/full_stack_template.git
cd full_stack_template
- Set up the backend environment
cd backend
pip install -r requirements.txt
- Set up the frontend environment
cd frontend
npm install
Make sure you have Node.js 18+ installed (or compatible version for Vite).
- Start the FastAPI backend
uvicorn backend.app.main:app --reload
- Run the React frontend
cd frontend
npm run dev
- All credentials and secrets are loaded from
.env
- Use Alembic for database migrations
- Redis + Celery are used for async tasks and caching
- For security ,rate limiting with IP and brute force attack prevention files are 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; React Query can be used for server-side async data caching
- Recommended via Docker Compose (can orchestrate backend, frontend, PostgreSQL, and Redis together)
- Ensure
.env
secrets are set in production