Skip to content

ABCGop/AIDE

Repository files navigation

AIDE - Chat Application

A Next.js chat application with Firebase authentication, user-specific chat storage, and theme support.

Features

  • User authentication (signup, login, logout)
  • User-specific chat threads
  • Theme support (light, dark, system)
  • Real-time chat with AI using Google's Gemini model

Setup

1. Install dependencies

npm install

2. Firebase Setup

  1. Create a Firebase project at https://console.firebase.google.com/
  2. Enable Authentication with Email/Password
  3. Create a Firestore database
  4. Register a web app in your Firebase project
  5. Create a .env.local file in the root directory with the following variables:
# Firebase configuration
NEXT_PUBLIC_FIREBASE_API_KEY=your-api-key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your-project-id.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your-project-id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your-project-id.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your-messaging-sender-id
NEXT_PUBLIC_FIREBASE_APP_ID=your-app-id
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=your-measurement-id

# Google AI API Key (for chat)
GOOGLE_API_KEY=your-google-api-key

3. Run the development server

npm run dev

Open http://localhost:3000 with your browser to see the result.

Project Structure

  • /app - Next.js app router pages
  • /components - React components
    • /auth - Authentication components
    • /assistant-ui - Chat UI components
    • /theme - Theme components
    • /ui - UI components
  • /lib - Utility functions
    • /context - React context providers
    • /services - Firebase services

Firebase Security Rules

Add these security rules to your Firestore database:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /threads/{threadId} {
      allow read, write: if request.auth != null && request.auth.uid == resource.data.userId;
      allow create: if request.auth != null && request.resource.data.userId == request.auth.uid;
    }
  }
}

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published