Deploy InnerLink: nextjs better-auth postgres

AI powered Therapy with AI-Human Therapist

Deploy InnerLink: nextjs better-auth postgres

Postgres

railwayapp-templates/postgres-ssl:16

Just deployed

/var/lib/postgresql/data

nextjs better-auth

vivekvt/InnerLink

Just deployed

Next.js Better Auth + AI Template 🚀

Complete Authentication Starter with AI-Powered Demo App

A production-ready Next.js template featuring Better Auth, PostgreSQL, and a full InnerLink AI Therapy App as a reference implementation.

Next.js Better Auth PostgreSQL AI

✨ Features

  • 🔐 Complete Auth System - Login, signup, verification, profiles
  • 🤖 AI Therapists - 6 specialized virtual therapists with HeyGen avatars
  • 🧘 Meditation Sessions - AI-powered guided meditation
  • 💬 Real-time Chat - Voice and text with streaming avatars
  • 📱 Responsive Design - Modern UI with Tailwind CSS + Radix UI
  • 🛡️ Security First - Secure sessions and data handling
  • 📊 Database Ready - Pre-configured PostgreSQL schema

Deploy and Host

Deploy on Railway

This template is optimized for Railway deployment with one-click setup including:

  • PostgreSQL database provisioning
  • Environment variable configuration
  • Automatic SSL certificates
  • Custom domain support

About Hosting

Railway Advantages

  • 🚀 Zero Config Deployment - Deploy directly from GitHub
  • 📊 Managed PostgreSQL - Automatic database setup and backups
  • 🔧 Environment Management - Secure variable handling
  • 📈 Auto Scaling - Handle traffic spikes automatically
  • 💰 Cost Effective - Pay only for what you use
  • 🔒 Enterprise Security - SOC 2 compliant infrastructure

Infrastructure Requirements

  • Database: PostgreSQL 14+ for user data and sessions
  • Runtime: Node.js 18+ for Next.js application
  • Memory: 512MB minimum for AI avatar streaming
  • Storage: Minimal (stateless application)

Why Deploy

🎯 For Developers

  • Quick Start: Get authentication working in minutes, not hours
  • Best Practices: See production-ready patterns and security
  • AI Integration: Learn how to integrate HeyGen avatars and OpenRouter
  • Type Safety: Full TypeScript implementation with Drizzle ORM

🚀 For Startups

  • MVP Ready: Ship user authentication and AI features fast
  • Scalable Foundation: Built on modern, performant technologies
  • Customizable: Easy to modify for your specific use case
  • Production Tested: Security and performance optimized

📚 For Learning

  • Modern Stack: Next.js 15, Better Auth, Drizzle ORM
  • AI Implementation: Real-world AI avatar and chat integration
  • Full-Stack Example: Complete app from auth to AI features

Common Use Cases

🤖 AI-Powered Applications

  • Mental Health Apps - Therapy bots, meditation guides
  • Education Platforms - AI tutors, language learning
  • Customer Support - Virtual assistants, help desks
  • Healthcare - Symptom checkers, wellness coaching

🔐 Authentication-Heavy Apps

  • SaaS Platforms - User dashboards, subscription management
  • Social Networks - Profile systems, content sharing
  • E-commerce - User accounts, order history
  • Content Management - Admin panels, user-generated content

💼 Business Applications

  • Employee Portals - HR systems, internal tools
  • Client Dashboards - Project management, reporting
  • Booking Systems - Appointments, reservations
  • CRM Systems - Customer relationship management

Dependencies for

Deployment Dependencies

Core Application

{
  "next": "^15.4.5",
  "react": "19",
  "typescript": "^5",
  "better-auth": "^1.3.4",
  "drizzle-orm": "^0.44.4"
}

Database & ORM

{
  "postgres": "^3.4.7",
  "drizzle-kit": "^0.31.4",
  "drizzle-zod": "^0.8.2"
}

UI & Styling

{
  "tailwindcss": "^4.1.11",
  "@radix-ui/react-*": "^1.1.x",
  "class-variance-authority": "^0.7.1",
  "tailwind-merge": "^3.3.1"
}

AI & Communication

{
  "@heygen/streaming-avatar": "^2.0.16",
  "@openrouter/ai-sdk-provider": "^1.1.0",
  "ai": "^5.0.8",
  "resend": "^4.8.0"
}

Development Tools

{
  "eslint": "^9",
  "prettier-plugin-tailwindcss": "^0.6.14",
  "@types/node": "^24",
  "@types/react": "^19"
}

Runtime Dependencies

  • Node.js 18+ - Required for Next.js 15
  • PostgreSQL 14+ - Database for user data and sessions
  • Memory: 512MB+ - For AI avatar streaming and chat
  • Storage: 50MB+ - Application code and assets

External Service Dependencies

  • HeyGen API - For AI avatar streaming (optional)
  • OpenRouter API - For AI conversations (optional)
  • Resend - For email verification and notifications
  • Railway PostgreSQL - Managed database service

Development Dependencies

  • Git - Version control and Railway deployment
  • npm/yarn - Package management
  • Environment Variables - Configuration management

🔧 Environment Variables

Required for Basic Auth

DATABASE_URL="postgresql://..."
BETTER_AUTH_SECRET="your-secret-key"
NEXT_PUBLIC_BASE_URL="https://yourapp.railway.app"
RESEND_API_KEY="your-resend-key"
SENDER_EMAIL="[email protected]"

Optional for AI Features

HEYGEN_API_KEY="your-heygen-key"
OPEN_ROUTER_KEY="your-openrouter-key"

🚀 Quick Start

  1. Deploy to Railway - Click the deploy button above
  2. Configure APIs - Add your email and AI service keys
  3. Access App - Visit your Railway-provided URL
  4. Customize - Modify avatars, prompts, and UI to fit your needs

🛠️ Tech Stack

  • Framework: Next.js 15 + App Router + Turbopack
  • Auth: Better Auth + Email Verification
  • Database: PostgreSQL + Drizzle ORM
  • UI: Tailwind CSS + Radix UI + Shadcn
  • AI: HeyGen Avatars + OpenRouter Chat
  • Email: Resend
  • Hosting: Railway Platform

📄 License

MIT License - Build amazing things!


🌟 Perfect for the Railway Hackathon - Deploy AI-powered apps in minutes!


Template Content

nextjs better-auth

vivekvt/InnerLink

More templates in this category

View Template
Chat Chat
Chat Chat, your own unified chat and search to AI platform.

View Template
openui
Deploy OpenUI: AI-powered UI generation with GitHub OAuth and OpenAI API.

View Template
firecrawl
firecrawl api server + worker without auth, works with dify