Skip to content

Clave is my little open-source toolkit for building chatbots, generative art, and whatever else you can dream up. No configs, no headaches—just code and creativity. Your AI, your key, your canvas.

License

Notifications You must be signed in to change notification settings

1dev-hridoy/Clave-App

Repository files navigation

Clave App Banner

Batman Clave App - Your Personal AI Sanctuary

Node.js Express Tailwind CSS License PRs Welcome Maintained

Welcome to Clave App

Welcome to Clave App - a sophisticated, privacy-focused AI interface designed for developers and enthusiasts who want a clean, powerful environment to interact with various AI models without the clutter.

Built with extensibility and customization in mind, Clave App serves as your personal "Clave" where you can think, create, and explore ideas with AI assistance. Whether you're looking to deploy your own private chat interface, build a custom AI tool, or learn how to integrate multiple AI models into a Node.js application, Clave App provides the perfect foundation.

Key Features

  • Multi-Model Support: Seamless integration with GPT-4o, GPT-3.5, and other leading AI models
  • Advanced Image Generation: Create stunning visuals with DeepImg and Flux models
  • Elegant UI/UX: Distraction-free, dark-mode interface built with EJS and Tailwind CSS
  • Comprehensive API: Fully documented RESTful API with robust validation, error handling, and security features
  • Developer-Centric: Designed for easy forking, customization, and deployment
  • Extensible Architecture: Modular codebase that simplifies adding new features and models

Technology Stack

Quick Start Guide

Prerequisites

  • Node.js (v18 or higher recommended)
  • npm or yarn package manager
  • API keys for desired AI services

Installation & Setup

  1. Fork & Clone Repository Begin by forking this repository to your GitHub account, then clone it locally:

    git clone https://github.com/1dev-hridoy/Clave-App.git
    cd Clave-App
  2. Install Dependencies Install all required packages using npm:

    npm install
  3. Launch Application Start the development server:

    npm start

    Access the application at http://localhost:3000 and begin exploring your AI sanctuary.

Customization Options

Clave App is built for flexibility and personalization:

  • Branding & Identity: Modify config/webConfig.json to customize site name, description, icons, and theme colors
  • AI Model Integration: Manage model configurations in config/models.js to add or remove AI services
  • UI/UX Styling: Leverage Tailwind CSS for comprehensive styling adjustments in public/css with view templates in views/
  • API Extensions: Extend functionality by adding new controllers in controllers/ and routes in routes/

API Documentation

Comprehensive API documentation is available within the application. Once your server is running, visit /docs (e.g., http://localhost:3000/docs) for an interactive API reference.

Core Endpoints

  • POST /api/chat - Advanced chat completions with conversation history
  • POST /api/image - High-quality image generation with style options
  • POST /api/reset - Secure conversation history clearing
  • GET /api/status - System health and status monitoring

Code Examples

Here's how to interact with the API using common languages:

JavaScript (Fetch)

const response = await fetch('http://localhost:3000/api/chat', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-session-id': 'my-session-123'
  },
  body: JSON.stringify({
    message: 'Hello, how are you?',
    model: 'gpt-3.5'
  })
});

const data = await response.json();
console.log(data.text);

Python (Requests)

import requests

url = "http://localhost:3000/api/chat"
headers = {
    "Content-Type": "application/json",
    "x-session-id": "my-session-123"
}
data = {
    "message": "Tell me a joke",
    "model": "gpt-4o"
}

response = requests.post(url, json=data, headers=headers)
print(response.json()["text"])

Development Roadmap

Current and planned enhancements for Clave App:

  • Phase 1: Basic Chat Interface Implementation
  • Phase 2: Image Generation Capabilities
  • Phase 3: Comprehensive API Documentation
  • Phase 4: Robust Global Error Handling
  • Phase 5: Input Validation & Security Headers
  • Phase 6: Response Streaming
  • Phase 7: Markdown Rendering Improvements
  • Phase 8: Dark/Light Mode Toggle

Security Features

We take security seriously. Clave App comes with built-in protection:

  • Input Validation: Comprehensive validation middleware for all API endpoints.
  • XSS Protection: Automatic sanitization of user inputs.
  • Secure Logging: Sensitive data (API keys, passwords) is automatically redacted from logs.
  • Error Handling: Production-safe error responses that don't leak stack traces.
  • Headers: Security headers configured for best practices.

Project Structure

Clave-App/
├── config/             # Configuration files (models, web settings)
├── controllers/        # Request handlers (chat, image, utility)
├── lib/                # AI model implementations
├── middleware/         # Express middleware (logger, error, validator)
├── public/             # Static assets (css, js, images)
├── routes/             # API and view routes
├── views/              # EJS templates
└── server.js           # Application entry point

Community & Contributions

We welcome contributions from the developer community. To contribute:

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

Please review our contribution guidelines before submitting pull requests.

See CHANGELOG.md for details on releases and changes.

Support the Project

If Clave App has benefited your workflow or inspired your projects, please consider showing your support:

  • ⭐ Star this repository on GitHub
  • 🐦 Follow the maintainer on Twitter @1dev_hridoy
  • 💬 Share your experience with others in the developer community

License & Legal

This project is distributed under the permissive MIT License, allowing for commercial use, modification, distribution, and patent use. See the LICENSE file for complete terms.


Built with ❤️ by Hridoy and contributors.

About

Clave is my little open-source toolkit for building chatbots, generative art, and whatever else you can dream up. No configs, no headaches—just code and creativity. Your AI, your key, your canvas.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Contributors 2

  •  
  •