Skip to content
/ Kaelocs Public

Fullstack web application using a LLM integrated with various MCP servers.

License

Notifications You must be signed in to change notification settings

Ker102/Kaelocs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

59 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Kaelocs Next.js Application

CodeQL status Dependabot License: MIT Open issues Contributors

A modern Next.js application with TypeScript, Tailwind CSS, dependable CI/CD, and essential libraries for building production-ready web applications.

Features

  • ⚑ 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

Getting Started

Prerequisites

  • Node.js 18.19.1 or later
  • npm 9.2.0 or later

Installation

  1. Install dependencies:
npm install
  1. Set up environment variables:

Copy the env.template file to .env.local:

cp env.template .env.local

Then edit .env.local and fill in your credentials:

For detailed Google OAuth setup instructions, see GOOGLE_AUTH_SETUP.md

Development

Run the development server:

npm run dev

Open http://localhost:3000 in your browser.

Build

Build the application for production:

npm run build

Start Production Server

npm start

Available Scripts

  • npm run dev - Start development server with Turbopack
  • npm run build - Build for production
  • npm start - Start production server
  • npm run lint - Run ESLint
  • npm run format - Format code with Prettier
  • npm run format:check - Check code formatting
  • npm test - Run tests with Vitest
  • npm run test:ui - Run tests with UI
  • npm run test:coverage - Run tests with coverage

Authentication System

This application uses a dual authentication system:

1. User Authentication (Google OAuth)

  • 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

2. Admin Authentication (Password-based)

  • 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

Project Structure

β”œβ”€β”€ 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

Technologies

Core

Styling

State Management & Data Fetching

Forms & Validation

UI & Icons

Testing

Code Quality

Security & Maintenance

  • βœ… 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

Community & Support

License

MIT

About

Fullstack web application using a LLM integrated with various MCP servers.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages