A modern Next.js application with TypeScript, Tailwind CSS, dependable CI/CD, and essential libraries for building production-ready web applications.
- β‘ Next.js 15 with App Router and Turbopack
- π¨ Tailwind CSS 4 for styling
- π TypeScript for type safety
- π NextAuth.js with Google OAuth for user authentication
- π€ Google Gemini 2.5 Flash AI integration
- π‘οΈ Dual Authentication System - User & Admin layers
- π§ͺ Vitest with React Testing Library for testing
- π― ESLint and Prettier for code quality
- π React Query for server state management
- π Zustand for client state management
- π React Hook Form with Zod validation
- π next-themes for dark mode support
- π¨ Lucide React for beautiful icons
- Node.js 18.19.1 or later
- npm 9.2.0 or later
- Install dependencies:
npm install- Set up environment variables:
Copy the env.template file to .env.local:
cp env.template .env.localThen edit .env.local and fill in your credentials:
- Google OAuth: Follow the Google Auth Setup Guide
- Admin Password: Set a secure password for admin access
- Google AI API Key: Get from Google AI Studio
For detailed Google OAuth setup instructions, see GOOGLE_AUTH_SETUP.md
Run the development server:
npm run devOpen http://localhost:3000 in your browser.
Build the application for production:
npm run buildnpm startnpm run dev- Start development server with Turbopacknpm run build- Build for productionnpm start- Start production servernpm run lint- Run ESLintnpm run format- Format code with Prettiernpm run format:check- Check code formattingnpm test- Run tests with Vitestnpm run test:ui- Run tests with UInpm run test:coverage- Run tests with coverage
This application uses a dual authentication system:
- Purpose: Save user progress and chat history across sessions
- Provider: Google OAuth via NextAuth.js
- Access Level: Anyone with a Google account can sign in
- Features:
- Persistent user sessions
- Chat history saved per user
- Profile management
- Purpose: Gate access to AI/LLM features
- Method: Password authentication via Zustand store
- Access Level: Only users with admin credentials
- Features:
- Required to use Gemini AI chat features
- Independent of user authentication
- Session-based access control
How it works:
- Users can sign in with Google to save their progress
- To actually use the AI features, they must also authenticate as admin
- Both authentications work independently and serve different purposes
βββ app/ # Next.js app directory
β βββ api/
β β βββ auth/ # NextAuth API routes
β β βββ chat/ # AI chat API endpoint
β βββ auth/
β β βββ signin/ # Custom sign-in page
β βββ admin/
β β βββ login/ # Admin login page
β βββ layout.tsx # Root layout
β βββ page.tsx # Home page
β βββ globals.css # Global styles
βββ components/ # React components
β βββ ui/ # UI components
β βββ Chat.tsx # Main chat component
β βββ DarkVeil.tsx # Animated background
β βββ providers.tsx # App providers
βββ lib/ # Utility functions
β βββ auth-store.ts # Admin auth state
β βββ brave-search.ts # Web search integration
β βββ web-fetcher.ts # Web content fetcher
β βββ utils.ts # Helper utilities
β βββ constants.ts # App constants
βββ types/ # TypeScript types
β βββ index.ts # Common types
β βββ next-auth.d.ts # NextAuth type extensions
βββ hooks/ # Custom React hooks
βββ test/ # Test setup and utilities
βββ public/ # Static files
- Next.js - React framework
- React - UI library
- TypeScript - Type safety
- NextAuth.js - Authentication for Next.js
- Tailwind CSS - Utility-first CSS
- class-variance-authority - Component variants
- clsx - Class names utility
- tailwind-merge - Merge Tailwind classes
- Zustand - State management
- React Query - Server state management
- Axios - HTTP client
- React Hook Form - Form handling
- Zod - Schema validation
- Lucide React - Icons
- next-themes - Theme management
- Vitest - Test runner
- React Testing Library - Component testing
- β Automated dependency updates powered by Dependabot
- β Continuous CodeQL scanning via GitHub Actions to catch security and quality regressions
- β Security policy describing how to report vulnerabilities
- Read the Code of Conduct to understand our expectations
- Learn how to contribute in CONTRIBUTING.md and get help in SUPPORT.md
- Use the curated GitHub issue and PR templates so we can triage faster
MIT