Open-source AI coworkers that each get a computer of their own: a browser, files and tools, with every action decided before it happens and recorded after. Bring any AG-UI agent.
Next.js fullstack starter for AI agent workflows
This is a boilerplate for starting a web app with authentication, a PostgreSQL database, dark mode, and shadcn/ui components. It is organized so coding agents can work from clear files, docs, and config instead of a blank project.
Builders who want a ready-made Next.js app that Claude Code, Cursor, or other agents can extend.
You can begin building a fullstack app with auth, database, and UI scaffolding already wired up.
What it does
Next.js 15 app router starter
Provides an App Router structure with pages, layouts, and global styles in `app/`.
Better Auth integration
Includes auth helpers and setup for email/password sign-in and sign-up flows.
Drizzle ORM with PostgreSQL
Ships database schema, migrations, and connection code for type-safe data access.
Docker-based local setup
Includes `docker-compose.yaml` and Postgres container files for local development and deployment.
shadcn/ui component library
Bundles prebuilt UI components and `components.json` for adding more.
Agent-oriented project docs
Adds `CLAUDE.md` and the `documentation/` folder with app flow, backend, frontend, security, and stack notes.
How to get it
- 1Clone the repository
git clone <repository-url> cd codeguide-starter-fullstack
- 2Install dependencies
npm install # or yarn install # or pnpm install
- 3Copy the .env.example file to .env
cp .env.example .env
- 4Start the development server
npm run dev # or yarn dev # or pnpm dev
- 5Start PostgreSQL with Docker
npm run db:up
- 6Push database schema
npm run db:push
README
Codeguide Starter Fullstack
A modern web application starter template built with Next.js 15, featuring authentication, database integration, and dark mode support.
Tech Stack
- Framework: Next.js 15 (App Router with Turbopack)
- Language: TypeScript
- Authentication: Better Auth
- Database: Drizzle ORM with PostgreSQL
- Styling: Tailwind CSS v4
- UI Components: shadcn/ui (New York style)
- Theme System: next-themes
- Icons: Lucide React
Prerequisites
Before you begin, ensure you have the following:
- Node.js 18+ installed
- Docker and Docker Compose (for database setup)
- Generated project documents from CodeGuide for best development experience
Getting Started
-
Clone the repository
git clone <repository-url> cd codeguide-starter-fullstack -
Install dependencies
npm install # or yarn install # or pnpm install -
Environment Variables Setup
- Copy the
.env.examplefile to.env:cp .env.example .env - The default values work with Docker setup, modify as needed
- Copy the
-
Start the development server
npm run dev # or yarn dev # or pnpm dev -
Open http://localhost:3000 with your browser to see the result.
Configuration
Option 1: Docker Setup (Recommended)
-
Start PostgreSQL with Docker:
npm run db:upThis starts PostgreSQL in a Docker container with default credentials.
-
Push database schema:
npm run db:push
Option 2: Local Database Setup
- Create a PostgreSQL database locally
- Update your environment variables in
.env:DATABASE_URL=postgresql://username:password@localhost:5432/database_name POSTGRES_DB=your_database_name POSTGRES_USER=your_username POSTGRES_PASSWORD=your_password - Run database migrations:
npm run db:push
Environment Variables
Create a .env file in the root directory with the following variables:
# Database Configuration (defaults work with Docker)
DATABASE_URL=postgresql://postgres:postgres@localhost:5433/postgres
POSTGRES_DB=postgres
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
# Authentication
BETTER_AUTH_SECRET=your_secret_key_here
BETTER_AUTH_URL=http://localhost:3000
NEXT_PUBLIC_BETTER_AUTH_URL=http://localhost:3000
Features
- π Authentication with Better Auth (email/password)
- ποΈ PostgreSQL Database with Drizzle ORM
- π¨ 40+ shadcn/ui components (New York style)
- π Dark mode with system preference detection
- π App Router with Server Components and Turbopack
- π± Responsive design with TailwindCSS v4
- π― Type-safe database operations
- π Modern authentication patterns
- π³ Full Docker support with multi-stage builds
- π Production-ready deployment configuration
Project Structure
codeguide-starter-fullstack/
βββ app/ # Next.js app router pages
β βββ globals.css # Global styles with dark mode
β βββ layout.tsx # Root layout with providers
β βββ page.tsx # Main page
βββ components/ # React components
β βββ ui/ # shadcn/ui components (40+)
βββ db/ # Database configuration
β βββ index.ts # Database connection
β βββ schema/ # Database schemas
βββ docker/ # Docker configuration
β βββ postgres/ # PostgreSQL initialization
βββ hooks/ # Custom React hooks
βββ lib/ # Utility functions
β βββ auth.ts # Better Auth configuration
β βββ utils.ts # General utilities
βββ auth-schema.ts # Authentication schema
βββ docker-compose.yml # Docker services configuration
βββ Dockerfile # Application container definition
βββ drizzle.config.ts # Drizzle configuration
βββ components.json # shadcn/ui configuration
Database Integration
This starter includes modern database integration:
- Drizzle ORM for type-safe database operations
- PostgreSQL as the database provider
- Better Auth integration with Drizzle adapter
- Database migrations with Drizzle Kit
Development Commands
Application
npm run dev- Start development server with Turbopacknpm run build- Build for production with Turbopacknpm start- Start production servernpm run lint- Run ESLint
Database
npm run db:up- Start PostgreSQL in Dockernpm run db:down- Stop PostgreSQL containernpm run db:dev- Start development PostgreSQL (port 5433)npm run db:dev-down- Stop development PostgreSQLnpm run db:push- Push schema changes to databasenpm run db:generate- Generate Drizzle migration filesnpm run db:studio- Open Drizzle Studio (database GUI)npm run db:reset- Reset database (drop all tables and recreate)
Styling with shadcn/ui
- Pre-configured with 40+ shadcn/ui components in New York style
- Components are fully customizable and use CSS variables for theming
- Automatic dark mode support with next-themes integration
- Add new components:
npx shadcn@latest add [component-name]
Docker
npm run docker:build- Build application Docker imagenpm run docker:up- Start full application stack (app + database)npm run docker:down- Stop all containersnpm run docker:logs- View container logsnpm run docker:clean- Stop containers and clean up volumes
Docker Development
Quick Start with Docker
# Start the entire stack (recommended for new users)
npm run docker:up
# View logs
npm run docker:logs
# Stop everything
npm run docker:down
Development Workflow
# Option 1: Database only (develop app locally)
npm run db:up # Start PostgreSQL
npm run dev # Start Next.js development server
# Option 2: Full Docker stack
npm run docker:up # Start both app and database
Docker Services
The docker-compose.yml includes:
- postgres: Main PostgreSQL database (port 5432)
- postgres-dev: Development database (port 5433) - use
--profile dev - app: Next.js application container (port 3000)
Docker Profiles
# Start development database on port 5433
docker-compose --profile dev up postgres-dev -d
# Or use the npm script
npm run db:dev
Deployment
Production Deployment
Option 1: Docker Compose (VPS/Server)
-
Clone and setup on your server:
git clone <your-repo> cd codeguide-starter-fullstack cp .env.example .env -
Configure environment variables:
# Edit .env with production values DATABASE_URL=postgresql://postgres:your_secure_password@postgres:5432/postgres POSTGRES_DB=postgres POSTGRES_USER=postgres POSTGRES_PASSWORD=your_secure_password BETTER_AUTH_SECRET=your-very-secure-secret-key BETTER_AUTH_URL=https://yourdomain.com NEXT_PUBLIC_BETTER_AUTH_URL=https://yourdomain.com -
Deploy:
npm run docker:up
Option 2: Container Registry (AWS/GCP/Azure)
-
Build and push image:
# Build the image docker build -t your-registry/codeguide-starter-fullstack:latest . # Push to registry docker push your-registry/codeguide-starter-fullstack:latest -
Deploy using your cloud provider's container service
Option 3: Vercel + External Database
-
Deploy to Vercel:
npm i -g vercel vercel -
Add environment variables in Vercel dashboard:
DATABASE_URL: Your managed PostgreSQL connection stringBETTER_AUTH_SECRET: Generate a secure secretBETTER_AUTH_URL: Your Vercel deployment URL
-
Setup database:
# Push schema to your managed database npm run db:push
Environment Variables for Production
# Required for production
DATABASE_URL=postgresql://user:password@host:port/database
BETTER_AUTH_SECRET=generate-a-very-secure-32-character-key
BETTER_AUTH_URL=https://yourdomain.com
# Optional optimizations
NODE_ENV=production
Production Considerations
- Database: Use managed PostgreSQL (AWS RDS, Google Cloud SQL, etc.)
- Security: Generate strong secrets, use HTTPS
- Performance: Enable Next.js output: 'standalone' for smaller containers
- Monitoring: Add logging and health checks
- Backup: Regular database backups
- SSL: Terminate SSL at load balancer or reverse proxy
Health Checks
The application includes basic health checks. You can extend them:
# In Dockerfile, add health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD curl -f http://localhost:3000/api/health || exit 1
AI Coding Agent Integration
This starter is optimized for AI coding agents:
- Clear file structure and naming conventions
- TypeScript integration with proper type definitions
- Modern authentication patterns
- Database schema examples
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
codeguide-starter-fullstack
Files in the repo
- app
- components
- db
- docker
- documentation
- drizzle
- hooks
- lib
- public
- .dockerignore
- .env.example
- .gitignore
- .prettierrc
- CLAUDE.md
- codeguide-backdrop.svg
- components.json
- docker-compose.yaml
- Dockerfile
- drizzle.config.ts
- eslint.config.mjs
- next.config.ts
- package-lock.json
- package.json
- postcss.config.mjs
- README.md
- tsconfig.json
Discussion (0)
Ask about usage, or say what you built with itSign in to join the discussion.
No comments yet. Be the first to say what this is good for.
More templates
Turn Claude Code into a full game dev studio β 49 AI agents, 72 workflow skills, and a complete coordination system mirroring real studio hierarchy.
A self-organizing Obsidian vault that gives AI coding agents persistent memory. Claude Code, Codex CLI, Gemini CLI.
Production-grade Playwright + TypeScript Scaffold for Agentic Testing. Harness for all major AI coding agents baked in.
Omnia Vault - the all-in-one project brain: an Obsidian LLM wiki, Graphify code graphs, a living plan that triages new videos against itself, and a Claude Code β Codex relay. Everything your project knows, in one clonable vault.

π¬ TαΊ‘o video "so sΓ‘nh kiαΊΏn thα»©c" ngαΊ―n tα»± Δα»ng β HyperFrames + AI voice, 1 template nhiα»u chα»§ Δα».