Production-grade multimodal chat with Next.js 15, TypeScript, and Google Vertex AI
Live: chat.daza.ar • Repo: github.com/roofsonfire/chat
5-minute setup: docs/guides/QUICKSTART.md
git clone https://github.com/roofsonfire/chat.git
cd chat
npm install
cp .env.example .env.local
# Edit .env.local with your credentials
npm run devFull setup guide: docs/DEVELOPMENT.md
- 🤖 Multimodal AI Chat - Text + image inputs with Gemini 2.5
- ⚡ Real-time Streaming - Instant response streaming
- 🎨 Image Generation - AI-powered image creation
- 🔐 Secure Auth - Google OAuth + invite-only access
- 🛡️ Production-Ready - Rate limiting, security headers, error handling
- Frontend: Next.js 15 (App Router), React 19, TypeScript 5, Tailwind CSS 4
- Backend: Next.js API Routes, Google Vertex AI, NextAuth.js
- Infrastructure: Google Cloud Run, Cloud Secret Manager
- Testing: Vitest, React Testing Library, Storybook
chat/
├── src/
│ ├── app/ # Next.js App Router (pages, API routes)
│ ├── components/ # React components (ui/, chat/, auth/)
│ ├── lib/ # Core utilities (services/, hooks/, types/)
│ └── middleware.ts # Auth, rate limiting, security
├── tests/ # Unit, integration, manual tests
├── docs/ # Comprehensive documentation
└── .github/
├── copilot-instructions.md # AI pairing context
├── copilot-quick-reference.md # Fast reference card
└── patterns/ # Code pattern library
Full navigation: docs/PROJECT-NAVIGATION.md
- Quickstart Guide - 5-minute setup ⚡
- Development Guide - Local setup and workflows
- Project Navigation - Find what you need fast
- Cloud Run Deployment - Production setup
- CI/CD Pipeline - GitHub Actions automation
- OAuth Setup - Google OAuth configuration
- API Reference - Endpoints and contracts
- Pattern Library - Reusable code patterns
- Model Selection - Dynamic AI models
- Project Status - Current state and roadmap
- Security Policy - Vulnerability reporting
- Contributing Guide - How to contribute
Complete index: docs/README.md
npm run test # Run all tests
npm run test:coverage # With coverage report
npm run test:ui # Interactive test UI
npm run lint # ESLint check
npm run format # Prettier formatTest structure: Unit tests • Integration tests • Storybook tests • Manual smoke tests
Coverage target: >80% on critical paths
- Authentication: NextAuth.js with Google OAuth (invite-only)
- Rate Limiting: 5 requests per 10 seconds per IP
- Input Validation: Zod schemas on all endpoints
- Security Headers: CSP, HSTS, X-Frame-Options, etc.
- Secrets Management: Google Cloud Secret Manager
- Password Hashing: bcrypt with 10 rounds
Security policy: docs/SECURITY.md
We welcome contributions! Here's how to get started:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Follow our patterns: See .github/patterns/
- Write tests: Maintain >80% coverage
- Submit a PR: Use our PR template
Guidelines: docs/CONTRIBUTING.md
npm run dev # Development server (localhost:3000)
npm run build # Production build
npm run start # Start production server
npm run lint # Lint code
npm run format # Format code
npm run type-check # TypeScript validation
npm run hash-password # Generate password hashRequired variables (see .env.example):
# NextAuth
NEXTAUTH_SECRET= # openssl rand -base64 32
NEXTAUTH_URL= # http://localhost:3000
# Google Cloud
GOOGLE_PROJECT_ID= # Your GCP project ID
GOOGLE_CLIENT_ID= # OAuth client ID
GOOGLE_CLIENT_SECRET= # OAuth client secret
# Auth User
AUTH_USER_EMAIL= # Authorized email
AUTH_USER_PASSWORD_HASH= # bcrypt hashComplete setup: docs/DEVELOPMENT.md
- Server Components by default for reduced JavaScript
- Streaming responses for real-time AI chat
- Automatic code splitting with Next.js
- Image optimization with next/image
- Turbopack for faster development builds
- Edge middleware for rate limiting
Metrics: docs/PERFORMANCE.md
Production: chat.daza.ar (Google Cloud Run, us-central1)
Branch strategy: develop (testing) → main (production)
# One-command deploy
./scripts/deployment/deploy-production.sh
# Or manual deploy
gcloud run deploy chat-production \
--source . \
--region us-central1 \
--platform managedFull guide: docs/deployment/CLOUD-RUN-DEPLOYMENT.md
- Low usage (~1K requests): $2-5
- Medium usage (~10K requests): $10-20
- High usage (~50K requests): $30-50
- Text generation: ~$0.0001 per request
- Image generation: ~$0.001 per request
- 🐛 Report Issues - Bug reports & feature requests
- 💬 Discussions - Questions & ideas
- 📚 Documentation - Comprehensive guides
- 🛡️ Security - Security policy & vulnerability reporting
MIT License - see LICENSE file for details.
Built with Next.js, Google Vertex AI, shadcn/ui, and ❤️ by the community.