A modern, full-stack web application template featuring a two-part architecture: a marketing landing site and a main application with integrated admin dashboard. Built with React, FastAPI, TypeScript, Prisma, and PostgreSQL.
- Landing Site (
example.com): Marketing-focused single-page site - Web Application (
app.example.com): Main application with integrated admin - Shared Backend: Unified FastAPI backend serving both applications
- Monorepo Structure: Organized code with shared packages
- Modern Tech Stack: React with Vite, FastAPI, TypeScript, and Tailwind CSS
- Authentication: Clerk authentication with JWT verification
- Content Management: Browse items by categories, featured content showcase
- User Collections: Persistent user selections with real-time updates
- Responsive Design: Mobile-first approach with beautiful animations
- Admin Dashboard: Integrated admin panel at
/adminroutes - Database: PostgreSQL with Prisma ORM (Python)
- Docker Support: Easy development setup with Docker Compose
- Auto Documentation: Swagger UI and ReDoc for API exploration
- Node.js 18+ and npm/yarn/pnpm (for frontend)
- Python 3.11+ (for backend)
- Docker and Docker Compose (for database)
- Git
- React 18 - UI library
- Vite - Lightning-fast build tool
- TypeScript - Type safety
- shadcn/ui - Accessible and customizable component library
- Tailwind CSS - Utility-first CSS
- Framer Motion - Smooth animations
- React 18 - UI library
- Vite - Build tool and dev server
- TypeScript - Type safety
- shadcn/ui - Accessible and customizable component library
- Tailwind CSS - Utility-first CSS
- React Router v6 - Client-side routing
- Clerk React - Authentication UI components
- Framer Motion - Animations
- React Hook Form + Zod - Form handling and validation
- TanStack Query - Data fetching and caching
- Zustand - State management
- Axios - HTTP client
- FastAPI - Modern Python web framework
- Pydantic - Data validation and settings
- Prisma - Database ORM (Python client)
- PostgreSQL - Database
- Python-Jose[cryptography] - JWT token verification
- HTTPX - HTTP client for JWKS fetching
- Python-Multipart - File uploads
- Pillow - Image processing and optimization
- Uvicorn - ASGI server
- Python-dotenv - Environment variables
- @[project]/ui - Reusable UI components (built on shadcn/ui)
- @[project]/utils - Common utilities
- @[project]/types - Shared TypeScript types
- Docker - Containerization
- Docker Compose - Multi-container orchestration
- Nginx - Reverse proxy for subdomain routing
- pnpm - Efficient package management
- Turborepo - Monorepo build system (optional)
- ESLint + Prettier - Code quality
- Husky - Git hooks
git clone https://github.com/yourusername/[your-project].git
cd [your-project]# Install all dependencies
pnpm installcd apps/landing
npm installcd apps/web
npm installcd apps/backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt# Copy all environment files
cp .env.example .env
cp apps/landing/.env.example apps/landing/.env.local
cp apps/web/.env.example apps/web/.env.local
cp apps/backend/.env.example apps/backend/.envLanding Site .env.local:
VITE_API_URL=http://localhost:5000/api
VITE_APP_URL=http://localhost:5173Web Application .env.local:
VITE_API_URL=http://localhost:5000/api
VITE_CLERK_PUBLISHABLE_KEY=pk_test_Y2xlcmsuZGV2JA # Clerk dev mode keyBackend .env:
DATABASE_URL="postgresql://[db_user]:[db_pass]@localhost:5432/[db_name]"
PORT=5000
CLERK_JWKS_URL=https://your-app.clerk.accounts.dev/.well-known/jwks.json# Build landing site image
cd apps/landing
docker build -t [project]_landing:latest .
# Build web application image
cd ../web
docker build -t [project]_web:latest .
# Build backend image
cd ../backend
docker build -t [project]_backend:latest .# From project root
docker-compose up -d postgrescd apps/backend
prisma generate --schema=./prisma/schema.prisma
prisma migrate dev --schema=./prisma/schema.prismacd apps/backend
python -m scripts.seed# From project root
pnpm devcd apps/backend
source venv/bin/activate # On Windows: venv\Scripts\activate
uvicorn main:app --reload --port 5000cd apps/landing
npm run dev # Runs on port 3000cd apps/web
npm run dev # Runs on port 5173- Landing Site: http://localhost:3000
- Web Application: http://localhost:5173
- Admin Dashboard: http://localhost:5173/admin
- API Documentation: http://localhost:5000/docs
- Alternative API Docs: http://localhost:5000/redoc
[your-project]/
βββ apps/ # All applications (monorepo)
β βββ landing/ # Marketing/Landing site
β β βββ src/
β β β βββ components/ # Landing page components
β β β βββ App.tsx
β β β βββ main.tsx
β β βββ public/ # Static assets
β β βββ package.json
β βββ web/ # Main application
β β βββ src/
β β β βββ components/ # React components
β β β βββ pages/ # Page components
β β β β βββ admin/ # Admin dashboard
β β β βββ hooks/ # Custom hooks
β β β βββ services/ # API services
β β β βββ store/ # Zustand stores
β β β βββ types/ # TypeScript types
β β βββ package.json
β βββ backend/ # FastAPI application
β βββ app/
β β βββ api/ # API endpoints
β β βββ core/ # Core configuration
β β βββ models/ # Pydantic models
β β βββ services/ # Business logic
β βββ prisma/ # Database schema
β βββ main.py # Entry point
βββ packages/ # Shared packages
β βββ ui/ # Reusable components
β βββ utils/ # Common utilities
β βββ types/ # Shared TypeScript types
βββ docker/ # Docker configurations
β βββ nginx/ # Nginx reverse proxy
β βββ volumes/ # Persistent data
βββ docs/ # Documentation
βββ docker-compose.yml # Docker orchestration
βββ pnpm-workspace.yaml # PNPM workspace config
pnpm dev- Start all development serverspnpm build- Build all applicationspnpm lint- Run ESLint on all projectspnpm format- Format all code with Prettier
npm run dev- Start development server (port 3000)npm run build- Build for productionnpm run preview- Preview production build
npm run dev- Start development server (port 5173)npm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Run ESLintnpm run format- Format code with Prettier
uvicorn main:app --reload- Start development serveruvicorn main:app- Start production serverpytest- Run testsblack .- Format coderuff check .- Lint codeprisma generate- Generate Prisma clientprisma migrate dev- Run database migrationsprisma db push- Push schema changesprisma studio- Open Prisma Studiopython -m scripts.seed- Seed database
- Copy environment file
cp .env.example .env- Build Docker images
# Build all images
cd apps/landing && docker build -t [project]_landing:latest .
cd ../web && docker build -t [project]_web:latest .
cd ../backend && docker build -t [project]_backend:latest .- Start all services
# From project root
docker-compose up -dThis will start:
- PostgreSQL database (port 5432)
- pgAdmin database GUI (port 5050)
- Redis cache (port 6379)
- FastAPI backend (port 5000)
- Landing site (port 3000)
- Web application (port 5173)
- Nginx reverse proxy (port 80)
- Run database migrations
docker-compose exec backend prisma migrate dev- Seed the database (optional)
docker-compose exec backend python -m scripts.seedAll persistent data is stored in docker/volumes/:
- PostgreSQL data:
docker/volumes/postgres/ - Redis data:
docker/volumes/redis/ - pgAdmin config:
docker/volumes/pgadmin/ - File uploads:
docker/volumes/uploads/
# Build images first (required)
cd apps/landing && docker build -t [project]_landing:latest .
cd ../web && docker build -t [project]_web:latest .
cd ../backend && docker build -t [project]_backend:latest .
# Start services
docker-compose up -d
# View logs
docker-compose logs -f [service-name]
# Stop services
docker-compose down
# Clean all volume data (careful!)
rm -rf docker/volumes/*
# Backup volumes
tar -czf backup-$(date +%Y%m%d).tar.gz docker/volumes/
# Restore volumes
tar -xzf backup-20240101.tar.gz
# Run with development overrides
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up
# Run with production settings
docker-compose -f docker-compose.yml -f docker-compose.prod.yml upConfigure your database connection in backend .env:
DATABASE_URL="postgresql://username:password@localhost:5432/database_name"This project uses a two-part architecture pattern:
-
Landing Site (
example.com)- Marketing-focused single-page site
- Optimized for SEO and conversion
- Built with React + Vite for consistency
- Can be deployed to Vercel/Netlify
-
Web Application (
app.example.com)- Main user application
- Integrated admin dashboard at
/admin - Protected routes for authenticated users
- Deployed to cloud provider
Clerk is used in the web application for user authentication. The backend verifies JWT tokens without Clerk SDK.
Web Application:
VITE_CLERK_PUBLISHABLE_KEY=pk_test_Y2xlcmsuZGV2JABackend JWT Verification:
CLERK_JWKS_URL=https://your-app.clerk.accounts.dev/.well-known/jwks.jsonNote: The landing site doesn't require authentication. In production, create a Clerk account and update both the publishable key and JWKS URL.
- Technical Specification - Detailed technical requirements
- Database Schema - Database design and ERD
- API Documentation - API endpoints reference
- Architecture - System design and architecture
- UI Specification - Design system and components
- Admin Dashboard - Admin panel documentation
- Deployment Guide - Production deployment instructions
# Run unit tests
npm run test
# Run e2e tests
npm run test:e2e
# Run with coverage
npm run test:coverageSee DEPLOYMENT.md for detailed deployment instructions.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support, email support@[your-domain].com or open an issue in this repository.
