Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DenxVil/NexusAi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

NEXUS AI - Advanced AI Telegram Bot Platform

NEXUS AI Logo

πŸ€– Telegram Bot: [@NexusAiProbot](https://t.me/NexusAiProbot) | 🌐 Web App: [GitHub Pages](https://denxvil.github.io/NexusAi/)

NEXUS AI Interface

Created by β—‰ΖŠΡ”ΠΈΞ½ΞΉβ„“

A cutting-edge AI-powered Telegram bot platform featuring sequential AI provider chain with Perplexity β†’ Gemini β†’ HuggingFace automatic fallback for maximum reliability.

πŸ“± Telegram Bot: @NexusAiProbot

⚑ Key Innovations

  • πŸ”— Sequential AI Provider Chain - Perplexity β†’ Gemini β†’ HuggingFace with automatic fallback
  • βœ… Response Verification - Perfect, powerful, and accurate AI responses
  • 🎯 Smart Fallback System - Ensures reliable responses every time
  • πŸ€– Advanced Telegram Bot - Streamlined chat experience with multi-AI integration
  • πŸ” Secure API Management - Environment-based API key configuration

πŸš€ Features

  • πŸ€– Multi-AI Integration - Sequential provider chain for maximum reliability
  • πŸ’¬ Advanced Telegram Bot - Core chat experience with intelligent AI routing
  • ⚑ Real-time Processing - Fast response times with intelligent routing
  • πŸ” Secure Backend - Express.js API server with comprehensive security
  • πŸ“Š MongoDB Integration - Persistent data storage and user management
  • 🌐 Cross-Platform Support - Works seamlessly across all Telegram clients

πŸ—οΈ Architecture

nexus-ai/
β”œβ”€β”€ 🌐 Frontend (React + TypeScript)
β”‚   β”œβ”€β”€ frontend/           # React web application
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ components/   # React components
β”‚   β”‚   β”‚   β”œβ”€β”€ context/      # React context providers
β”‚   β”‚   β”‚   β”œβ”€β”€ services/     # API services
β”‚   β”‚   β”‚   β”œβ”€β”€ types/        # TypeScript types
β”‚   β”‚   β”‚   └── utils/        # Utility functions
β”‚   β”‚   └── dist/            # Built frontend assets
β”œβ”€β”€ πŸ”§ Backend (Node.js + TypeScript)
β”‚   β”œβ”€β”€ server/             # Express.js API server
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ controllers/  # API controllers
β”‚   β”‚   β”‚   β”œβ”€β”€ models/       # MongoDB models
β”‚   β”‚   β”‚   β”œβ”€β”€ routes/       # API routes
β”‚   β”‚   β”‚   β”œβ”€β”€ services/     # Business logic
β”‚   β”‚   β”‚   └── bot/          # Telegram bot integration
β”‚   β”‚   └── dist/            # Compiled JavaScript
└── πŸ“‹ Deployment
    β”œβ”€β”€ Dockerfile           # Docker configuration
    β”œβ”€β”€ docker-compose.yml   # Multi-container setup
    └── render.yaml          # Render deployment config

πŸ› οΈ Tech Stack

Frontend

  • React 19 - Modern React with latest features
  • TypeScript - Type-safe development
  • Vite - Fast build tool and dev server
  • Tailwind CSS - Utility-first CSS framework
  • React Markdown - Markdown rendering
  • Lucide React - Beautiful icon library
  • Axios - HTTP client for API communication

Backend

  • Node.js - Runtime environment
  • Express.js - Web framework
  • TypeScript - Type safety and modern JavaScript
  • Socket.io - Real-time communication
  • MongoDB - Database for user data and chat history
  • Telegram Bot API - Bot integration

AI Services

  • Google Gemini - Advanced language model
  • Perplexity AI - Research-focused AI
  • HuggingFace - Open-source AI models

πŸš€ Quick Start

Prerequisites

  • Node.js 18.x or higher
  • MongoDB database
  • Telegram Bot Token (from @BotFather)

Installation

  1. Clone the repository:
git clone https://github.com/DenxVil/NexusAi.git
cd NexusAi
  1. Install all dependencies:
npm run install-all
  1. Configure environment variables:

Backend Configuration:

# Copy example environment file
cp server/.env.example server/.env

# Edit with your configuration
nano server/.env

Frontend Configuration:

# Copy example environment file
cp frontend/.env.example frontend/.env.local

# Edit with your configuration
nano frontend/.env.local

Add your API keys and configuration:

Backend (.env):

# Database Configuration
MONGODB_URI=mongodb://localhost:27017/nexus-ai

# AI Service API Keys
GEMINI_API_KEY=your_gemini_key_here
PERPLEXITY_API_KEY=your_perplexity_key_here
HUGGINGFACE_API_KEY=your_huggingface_key_here

# Telegram Bot Configuration
TELEGRAM_BOT_TOKEN=your_telegram_bot_token_here

# Server Configuration
PORT=5000
NODE_ENV=development

Frontend (.env.local):

VITE_API_BASE_URL=http://localhost:5000
VITE_AI_API_KEY=your_api_key_here
VITE_APP_NAME=NEXUS AI
  1. Start the development servers:

Start both frontend and backend:

npm run dev:all

Or start individually:

# Start backend only
npm run dev

# Start frontend only (in another terminal)
npm run dev:frontend

The services will be available at:

πŸ€– Telegram Bot Setup

  1. Create a Telegram bot:

    • Message @BotFather on Telegram
    • Use /newbot command to create your bot
    • Save the bot token
  2. Configure the bot:

    • Add your bot token to the .env file in the server directory
    • Start the server: cd server && npm run dev
    • Your bot will automatically be available for interactions
  3. Bot Commands:

    • /start - Initialize the bot
    • /help - Show available commands
    • /clear - Clear chat history
    • Simply send a message to chat with AI

πŸ“± Usage

Web Interface

  1. Open your browser and navigate to http://localhost:3000/NexusAi/
  2. Start chatting with the AI assistant
  3. Use the suggestion buttons for quick prompts
  4. View real-time AI responses with markdown formatting

Telegram Bot

  1. Find your bot on Telegram using the username you created
  2. Send /start to begin
  3. Chat naturally - the bot will respond using your configured AI services
  4. Use /help for additional commands

πŸ”§ Configuration

AI Services Setup

Google Gemini

  1. Visit Google AI Studio
  2. Create a new API key
  3. Add to your environment variables or settings panel

Perplexity AI

  1. Go to Perplexity Settings
  2. Generate an API key
  3. Add to your configuration

HuggingFace

  1. Visit HuggingFace Tokens
  2. Create a new token with read permissions
  3. Add to your configuration in the server's .env file

πŸš€ Deployment

GitHub Pages (Frontend)

The frontend is automatically deployed to GitHub Pages:

  1. Configure GitHub repository secrets:
    • AI_API_KEY - Your AI service API key
  2. Push changes to main branch:
    • Frontend deployment triggers automatically
  3. Access your deployed app:
    • URL: https://denxvil.github.io/NexusAi/

βœ… Current Status: GitHub Pages deployment is working correctly. The site loads properly with all CSS and JavaScript assets.

Render Deployment (Backend)

Render Deployment (Backend)

  1. Prepare for deployment:
# Backend is configured for Render deployment
# See render.yaml for configuration
  1. Set environment variables in Render:
# Configure in Render dashboard
TELEGRAM_BOT_TOKEN=your_token_here
GEMINI_API_KEY=your_key_here
MONGODB_URI=your_mongodb_connection_string
# Add other environment variables as needed
  1. Deploy:
    • Connect repository to Render
    • Backend deploys automatically from main branch

Verification

Run the deployment verification script to check configuration:

./verify-deployment.sh

Other Platforms

  • Railway - Alternative backend deployment option
  • Render - Backend deployment (see render.yaml configuration)

πŸ“ž Support

Need help? Reach out through our support channels:

🀝 Contributing

We welcome contributions! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

Development Guidelines

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

πŸ“„ License

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

πŸ™ Acknowledgments

  • AI Service Providers - Google, Perplexity, HuggingFace for powerful AI capabilities
  • Open Source Community - For the amazing libraries and tools
  • Telegram - For providing an excellent bot platform
  • Contributors - Everyone who helps make Nexus Ai better

Made with ❀️ by β—‰ΖŠΡ”ΠΈΞ½ΞΉβ„“

Nexus Ai - Where artificial intelligence meets exceptional user experience

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •