Skip to content

aarab-abderrahmane/ChatForge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

62 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ ChatForge Terminal

ChatForge Banner

A retro-inspired terminal interface for AI conversations

License: CC BY-NC 4.0 Node.js MongoDB React

Demo β€’ Features β€’ Installation β€’ Usage β€’ Tech Stack


πŸ“– About

ChatForge is a sleek, terminal-inspired AI chat interface that brings the nostalgia of classic computing to modern AI conversations. Built with a focus on aesthetics and user experience, it features a beautiful retro green terminal theme with scan lines, neon glow effects, and smooth animations.

✨ Features

🎨 Terminal Aesthetics

  • Retro CRT monitor effects with scan lines
  • Neon green text with customizable glow
  • Smooth typing animations
  • Classic terminal command interface

πŸ€– AI-Powered Conversations

  • Integration with OpenRouter API
  • Context-aware responses with chat history
  • Real-time streaming responses
  • Markdown rendering with syntax highlighting

πŸ” Secure & Private

  • Encrypted API key storage in MongoDB
  • User-specific sessions with UUID
  • Secure key validation system
  • No client-side key exposure

πŸ’» Developer-Friendly

  • Clean, modular codebase
  • React 19 with hooks
  • Express.js backend
  • MongoDB Atlas integration
  • Responsive design for all devices

🎯 User Experience

  • Multi-step loader with progress indicators
  • Copy-to-clipboard functionality
  • Command palette (coming soon)
  • Smooth scrolling and animations
  • Error handling with helpful messages

πŸŽ₯ Demo

root@chatforge-terminal:~# ./start_chatforge.sh
[βœ“] Verifying ChatForge environment
[βœ“] Loading AI modules...
[βœ“] System ready for authentication

πŸ› οΈ Tech Stack

Frontend

  • React 19 - UI framework
  • Vite - Build tool
  • Tailwind CSS 4 - Styling
  • Motion - Animations
  • React Markdown - Markdown rendering
  • Shiki - Syntax highlighting
  • GSAP - Advanced animations

Backend

  • Node.js - Runtime environment
  • Express - Web framework
  • MongoDB Atlas - Database
  • OpenRouter API - AI model access

Key Libraries

  • react-syntax-highlighter - Code blocks
  • rehype-katex - Math rendering
  • remark-gfm - GitHub Flavored Markdown
  • lucide-react - Icons

πŸ“¦ Installation

Prerequisites

  • Node.js 18+ installed
  • MongoDB Atlas account
  • OpenRouter API account

Clone the Repository

git clone https://github.com/yourusername/chatforge.git
cd chatforge

Backend Setup

cd backend
npm install

# Create .env file
touch .env

Add to .env:

USER_NAME_MONGO=your_mongodb_username
DB_PASSWORD=your_mongodb_password
CLUSTER=your_cluster_url
APP_NAME=ChatForge

Frontend Setup

cd ../frontend
npm install

Start Development Servers

Backend:

cd backend
npm run server

Frontend:

cd frontend
npm run chatforge

πŸš€ Usage

1. Initial Setup

  • Visit the application
  • You'll see the guide page requesting an OpenRouter API key
  • Create your free API key at OpenRouter

2. Authenticate

β†’ Please create your key at https://openrouter.ai
β†’ Copy it here to enable full access
[paste your API key and press Enter]

3. Start Chatting

Once authenticated, you can:

  • Ask questions naturally
  • View formatted responses with syntax highlighting
  • Copy code snippets with one click
  • Review conversation history

4. Example Conversations

> Who is the author of this website?
Abderrahmane Aarab

> How can I generate a short summary of my chat history?
Simply type your question and the AI will summarize the previous messages.

πŸ—οΈ Project Structure

chatforge/
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ features/
β”‚   β”‚   β”‚   β”‚   └── Terminal.jsx
β”‚   β”‚   β”‚   └── ui/
β”‚   β”‚   β”‚       β”œβ”€β”€ button.jsx
β”‚   β”‚   β”‚       β”œβ”€β”€ multi-step-loader.jsx
β”‚   β”‚   β”‚       └── shadcn-io/
β”‚   β”‚   β”‚           └── ai/
β”‚   β”‚   β”œβ”€β”€ context/
β”‚   β”‚   β”‚   └── chatsContext.jsx
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”‚   └── guidePage.jsx
β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”‚   └── api.jsx
β”‚   β”‚   β”œβ”€β”€ App.jsx
β”‚   β”‚   └── index.css
β”‚   └── package.json
β”‚
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ server.js
β”‚   β”œβ”€β”€ db.js
β”‚   β”œβ”€β”€ package.json
β”‚   └── vercel.json
β”‚
└── README.md

πŸ”‘ Environment Variables

Backend (.env)

USER_NAME_MONGO=your_mongodb_username
DB_PASSWORD=your_mongodb_password
CLUSTER=your_cluster_name
APP_NAME=ChatForge

🌐 API Endpoints

POST /api/chat

Send a message to the AI

{
  "question": "Your question here",
  "history": "Previous conversation context",
  "userId": "user-uuid"
}

POST /api/test

Validate an API key

{
  "APIkey": "your-openrouter-key",
  "userId": "user-uuid"
}

POST /api/key-exists

Check if user has a stored key

{
  "userId": "user-uuid"
}

🎨 Customization

Changing Colors

Edit frontend/src/index.css:

body {
  background: #0a0a0a;
  color: #39ff14; /* Change this for different neon colors */
}

Modifying AI Model

Edit backend/server.js:

model: "openai/gpt-oss-20b:free", // Change to your preferred model

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘¨β€πŸ’» Author

Abderrahmane Aarab

πŸ™ Acknowledgments

  • OpenRouter for AI API access
  • shadcn/ui for beautiful UI components
  • Vercel for AI components inspiration
  • The open-source community

πŸ“Š Roadmap

  • Add command palette with shortcuts
  • Implement chat history export
  • Add multiple AI model selection
  • Create user preferences panel
  • Add voice input support
  • Implement collaborative chats
  • Add plugin system

πŸ› Known Issues

  • Maximum token limit may be reached with very long conversations
  • Some markdown tables may not render perfectly on mobile

πŸ’¬ Support

If you have any questions or need help, please:


Made with πŸ’š and retro vibes

⭐ Star this repo if you find it helpful!

About

ChatForge is a sleek, terminal-inspired AI chat interface that brings the nostalgia of classic computing to modern AI conversations.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors