π Template Usage: This is a GitHub template repository. Click "Use this template" to create your own project based on this starter.
A production-ready AI engineering project template with modern full-stack architecture, authentication, monitoring, and containerized services.
- π Authentication: Next.js with Auth.js v5 (next-auth)
- β‘ Modern Stack: Next.js 15.5.4, FastAPI, TypeScript, Tailwind CSS v4
- π Monitoring: Prometheus metrics, health checks
- ποΈ Database: PostgreSQL with async support
- π§ Vector Search: Qdrant for AI/ML applications
- β‘ Cache: Redis for high-performance caching
- π³ Containerized: Docker Compose for easy deployment
- π§ͺ Testing: Playwright for E2E, pytest for backend
- π§ Developer Tools: Hot reloading, type safety, linting
If you're using this template, see TEMPLATE_SETUP.md for detailed setup instructions.
- Node.js 18+
- Python 3.11+
- Docker Desktop (for services)
make installThis will:
- Install npm packages and Playwright browsers
- Create Python virtual environment
- Install Python dependencies
- Copy environment templates
make devOr manually in separate terminals:
# Terminal 1: Start Docker services
docker-compose up -d
# Terminal 2: Start backend
cd backend && source venv/bin/activate && uvicorn src.main:app --reload
# Terminal 3: Start frontend
cd app && npm run dev- Frontend: http://localhost:3000
- Backend API: http://localhost:8000/docs
- Qdrant Dashboard: http://localhost:6333/dashboard
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Frontend β β Backend β β Services β
β (Next.js) βββββΊβ (FastAPI) βββββΊβ (Docker) β
β β β β β β
β β’ Next.js 15 β β β’ FastAPI β β β’ PostgreSQL β
β β’ Auth.js v5 β β β’ LangChain β β β’ Qdrant β
β β’ Tailwind v4 β β β’ Prometheus β β β’ Redis β
β β’ TypeScript β β β’ Pydantic β β β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
Frontend (/app)
- Next.js 15.5.4 with App Router
- TypeScript for type safety
- Tailwind CSS v4 for styling
- Auth.js v5 for authentication
- Playwright for E2E testing
Backend (/backend)
- FastAPI for high-performance API
- LangChain & LangGraph for AI workflows
- SQLAlchemy with async PostgreSQL
- Prometheus for metrics collection
- Pydantic for data validation
Services (docker-compose.yml)
- PostgreSQL 16 - Primary database (Port 5432)
- Qdrant - Vector database for AI (Ports 6333/6334)
- Redis 7 - Cache and sessions (Port 6379)
# Install all dependencies
make install
# Start development environment
make dev
# Run all tests
make test
# Prepare demo environment
make demo
# Clean up containers and dependencies
make clean
# Show help
make helpai-engineering-starter/
βββ app/ # Next.js frontend
β βββ src/app/ # App Router pages
β βββ auth.config.ts # Auth.js configuration
β βββ middleware.ts # Auth middleware
β βββ package.json
βββ backend/ # FastAPI backend
β βββ src/
β β βββ main.py # FastAPI application
β βββ requirements.txt # Python dependencies
β βββ venv/ # Virtual environment
βββ docker-compose.yml # Service containers
βββ Makefile # Development commands
βββ README.md # This file
Frontend (.env.local)
# Authentication
AUTH_SECRET=your-secret-key
AUTH_URL=http://localhost:3000
# API Connection
NEXT_PUBLIC_API_URL=http://localhost:8000Backend (.env)
# Database
DATABASE_URL=postgresql+asyncpg://demo_user:demo_pass@localhost:5432/demo_db
# Vector Database
QDRANT_URL=http://localhost:6333
# Cache
REDIS_URL=redis://localhost:6379
# AI Services (add your keys)
OPENAI_API_KEY=your-openai-key
LANGCHAIN_API_KEY=your-langchain-key# Backend tests
cd backend && source venv/bin/activate && pytest tests/ -v
# Frontend unit tests
cd app && npm test
# E2E tests with Playwright
cd app && npm run test:e2e- Backend Health: http://localhost:8000/health
- Metrics: http://localhost:8000/metrics (Prometheus format)
- API Documentation: http://localhost:8000/docs (OpenAPI/Swagger)
- Qdrant Dashboard: http://localhost:6333/dashboard
The project includes three essential services:
# PostgreSQL Database
postgres:5432
- User: demo_user
- Password: demo_pass
- Database: demo_db
# Qdrant Vector Database
qdrant:6333/6334
- Dashboard: :6333/dashboard
- API: :6333
# Redis Cache
redis:6379
- Memory limit: 256MB
- Policy: allkeys-lruDocker not starting:
# Ensure Docker Desktop is running
open -a Docker
# Check Docker status
docker --version
docker-compose psPython environment issues:
# Recreate virtual environment
rm -rf backend/venv
cd backend && python -m venv venv
source venv/bin/activate && pip install -r requirements.txtNode.js dependency issues:
# Clean install
cd app && rm -rf node_modules package-lock.json
npm installPort conflicts:
- Frontend (3000), Backend (8000), PostgreSQL (5432), Qdrant (6333), Redis (6379)
- Check for other services using these ports:
lsof -i :3000
- Authentication: Demo credentials configured in
auth.config.ts - Hot Reloading: Both frontend and backend support hot reloading
- Type Safety: Full TypeScript support with strict mode
- Code Quality: Pre-commit hooks with linting and formatting
- Scalability: Designed for easy deployment to cloud platforms
- 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.
Happy coding! π