A complete agentic coding boilerplate with authentication, PostgreSQL database, AI chat functionality, and modern UI components - perfect for building AI-powered applications and autonomous agents.
- π Authentication: Better Auth with Google OAuth integration
- ποΈ Database: Drizzle ORM with PostgreSQL
- π€ AI Integration: Vercel AI SDK with OpenRouter (access to 100+ AI models)
- π¨ UI Components: shadcn/ui with Tailwind CSS
- β‘ Modern Stack: Next.js 15, React 19, TypeScript
- π± Responsive: Mobile-first design approach
Watch the complete walkthrough of this agentic coding template:
If this boilerplate helped you build something awesome, consider buying me a coffee!
Before you begin, ensure you have the following installed on your machine:
- Node.js: Version 18.0 or higher (Download here)
- Git: For cloning the repository (Download here)
- PostgreSQL: Either locally installed or access to a hosted service like Vercel Postgres
Get started with a single command:
npx create-agentic-app@latest my-app
cd my-appOr create in the current directory:
npx create-agentic-app@latest .The CLI will:
- Copy all boilerplate files
- Install dependencies with your preferred package manager (pnpm/npm/yarn)
- Set up your environment file
Next steps after running the command:
- Update
.envwith your API keys and database credentials - Start the database:
docker compose up -d - Run migrations:
npm run db:migrate - Start dev server:
npm run dev
If you prefer to set up manually:
1. Clone or Download the Repository
Option A: Clone with Git
git clone https://github.com/leonvanzyl/agentic-coding-starter-kit.git
cd agentic-coding-starter-kitOption B: Download ZIP Download the repository as a ZIP file and extract it to your desired location.
2. Install Dependencies
npm install3. Environment Setup
Copy the example environment file:
cp env.example .envFill in your environment variables in the .env file:
# Database
POSTGRES_URL="postgresql://username:password@localhost:5432/your_database_name"
# Authentication - Better Auth
BETTER_AUTH_SECRET="your-random-32-character-secret-key-here"
# Google OAuth (Get from Google Cloud Console)
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"
# AI Integration via OpenRouter (Optional - for chat functionality)
# Get your API key from: https://openrouter.ai/settings/keys
# View available models at: https://openrouter.ai/models
OPENROUTER_API_KEY="sk-or-v1-your-openrouter-api-key-here"
OPENROUTER_MODEL="openai/gpt-5-mini"
# App URL (for production deployments)
NEXT_PUBLIC_APP_URL="http://localhost:3000"4. Database Setup
Generate and run database migrations:
npm run db:generate
npm run db:migrate5. Start the Development Server
npm run devYour application will be available at http://localhost:3000
- Go to Vercel Dashboard
- Navigate to the Storage tab
- Click Create β Postgres
- Choose your database name and region
- Copy the
POSTGRES_URLfrom the.env.localtab - Add it to your
.envfile
- Go to Google Cloud Console
- Create a new project or select an existing one
- Navigate to Credentials β Create Credentials β OAuth 2.0 Client ID
- Set application type to Web application
- Add authorized redirect URIs:
http://localhost:3000/api/auth/callback/google(development)https://yourdomain.com/api/auth/callback/google(production)
- Copy the Client ID and Client Secret to your
.envfile
- Go to OpenRouter
- Sign up or log in to your account
- Navigate to Settings β Keys or visit Keys Settings
- Click Create Key and give it a name
- Copy the API key and add it to your
.envfile asOPENROUTER_API_KEY - Browse available models at OpenRouter Models
src/
βββ app/ # Next.js app directory
β βββ api/ # API routes
β β βββ auth/ # Authentication endpoints
β β βββ chat/ # AI chat endpoint
β βββ chat/ # AI chat page
β βββ dashboard/ # User dashboard
β βββ page.tsx # Home page
βββ components/ # React components
β βββ auth/ # Authentication components
β βββ ui/ # shadcn/ui components
βββ lib/ # Utilities and configurations
βββ auth.ts # Better Auth configuration
βββ auth-client.ts # Client-side auth utilities
βββ db.ts # Database connection
βββ schema.ts # Database schema
βββ utils.ts # General utilities
npm run dev # Start development server with Turbopack
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
npm run db:generate # Generate database migrations
npm run db:migrate # Run database migrations
npm run db:push # Push schema changes to database
npm run db:studio # Open Drizzle Studio (database GUI)
npm run db:dev # Push schema for development
npm run db:reset # Reset database (drop all tables)- Home (
/): Landing page with setup instructions and features overview - Dashboard (
/dashboard): Protected user dashboard with profile information - Chat (
/chat): AI-powered chat interface using OpenRouter (requires authentication)
-
Install the Vercel CLI globally:
npm install -g vercel
-
Deploy your application:
vercel --prod
-
Follow the prompts to configure your deployment
-
Add your environment variables when prompted or via the Vercel dashboard
Ensure these are set in your production environment:
POSTGRES_URL- Production PostgreSQL connection stringBETTER_AUTH_SECRET- Secure random 32+ character stringGOOGLE_CLIENT_ID- Google OAuth Client IDGOOGLE_CLIENT_SECRET- Google OAuth Client SecretOPENROUTER_API_KEY- OpenRouter API key (optional, for AI chat functionality)OPENROUTER_MODEL- Model name from OpenRouter (optional, defaults to openai/gpt-5-mini)NEXT_PUBLIC_APP_URL- Your production domain
Watch my comprehensive tutorial on how to use this agentic coding boilerplate to build AI-powered applications:
πΊ YouTube Tutorial - Building with Agentic Coding Boilerplate
- Fork this repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add 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.
If you encounter any issues:
- Check the Issues section
- Review the documentation above
- Create a new issue with detailed information about your problem
Happy coding! π
