Skip to content

hardikkaurani/devsphere-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DevSphere AI

A production-grade AI platform with specialized agents for coding, career guidance, and general assistance.

License Node.js React Express MongoDB Ollama TailwindCSS Framer Motion Code style GitHub stars GitHub forks GitHub issues GitHub last commit GitHub repo size Contributors


πŸš€ Features

Multi-Agent AI System

  • Coding Agent: Expert programming assistance with best practices and optimization
  • Resume Agent: Professional resume review and career guidance
  • General Agent: Conversational AI for general knowledge and information

Modern SaaS Design

  • ✨ Futuristic animated background with particle effects
  • 🎨 Glass-morphism UI components with Tailwind CSS
  • 🎬 Smooth animations powered by Framer Motion
  • πŸ“± Fully responsive design (mobile, tablet, desktop)
  • ⚑ Lightning-fast performance with optimized rendering

Production-Ready Backend

  • πŸ” JWT authentication with secure password hashing
  • πŸ›‘οΈ Rate limiting and security headers (Helmet)
  • πŸ“Š Structured logging with Winston
  • βœ… Input validation with Joi
  • πŸ”„ Comprehensive error handling
  • πŸ“š RESTful API with v1 versioning

AI Integration

  • πŸ€– Seamless Ollama integration
  • 🧠 Context-aware conversations
  • πŸ”„ Message history tracking
  • πŸ“ˆ Persistent session management

πŸ—οΈ Architecture

devsphere-ai/
β”œβ”€β”€ backend/                     # Node.js Express API
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ controllers/         # Route handlers
β”‚   β”‚   β”œβ”€β”€ services/            # Business logic
β”‚   β”‚   β”œβ”€β”€ models/              # MongoDB schemas
β”‚   β”‚   β”œβ”€β”€ middleware/          # Express middleware
β”‚   β”‚   β”œβ”€β”€ routes/              # API routes
β”‚   β”‚   β”œβ”€β”€ utils/               # Utilities & helpers
β”‚   β”‚   β”œβ”€β”€ config/              # Configuration files
β”‚   β”‚   └── index.js             # Entry point
β”‚   └── package.json
β”‚
β”œβ”€β”€ devsphere-frontend/          # React + Vite
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ ui/              # Base UI components
β”‚   β”‚   β”‚   β”œβ”€β”€ chat/            # Chat-specific components
β”‚   β”‚   β”‚   β”œβ”€β”€ layout/          # Layout components
β”‚   β”‚   β”‚   └── animations/      # Animated components
β”‚   β”‚   β”œβ”€β”€ pages/               # Page components
β”‚   β”‚   β”œβ”€β”€ services/            # API services
β”‚   β”‚   β”œβ”€β”€ hooks/               # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ utils/               # Utility functions
β”‚   β”‚   β”œβ”€β”€ App.jsx              # Root component
β”‚   β”‚   └── main.jsx             # Entry point
β”‚   β”œβ”€β”€ vite.config.js
β”‚   β”œβ”€β”€ tailwind.config.js
β”‚   └── package.json
β”‚
β”œβ”€β”€ docs/                         # Documentation
β”œβ”€β”€ .env.example                  # Environment template
β”œβ”€β”€ README.md                     # This file
└── package.json                  # Root package.json

πŸ› οΈ Tech Stack

Frontend

  • React 19 - UI library
  • Vite - Build tool & dev server
  • Tailwind CSS - Utility-first CSS
  • Framer Motion - Animation library
  • Lucide React - Icon library
  • Axios - HTTP client
  • React Router v7 - Navigation

Backend

  • Node.js - Runtime
  • Express 5 - Web framework
  • MongoDB - NoSQL database
  • Mongoose - ODM
  • JWT - Authentication
  • Ollama - AI Model integration
  • Winston - Logging
  • Joi - Validation
  • Helmet - Security

DevOps & Tools

  • Nodemon - Development auto-reload
  • ESLint - Code linting
  • Git - Version control

πŸ“‹ Prerequisites

Before running the project, ensure you have:

  • Node.js: v18 or higher (Download)
  • npm: v9 or higher
  • MongoDB: Local or Atlas instance (Get Started)
  • Ollama: For AI model execution (Download)

Install Ollama Models

ollama pull gemma:2b
# or other models like: neural-chat, mistral, etc.

πŸš€ Quick Start

1. Clone the Repository

git clone https://github.com/hardikkaurani/devsphere-ai.git
cd devsphere-ai

2. Setup Environment Variables

cp .env.example .env

Edit .env with your configuration:

# Database
MONGO_URI=mongodb://localhost:27017/devsphere-ai

# Server
PORT=5000
NODE_ENV=development

# JWT
JWT_SECRET=your-super-secret-key-change-in-production
JWT_EXPIRE=7d

# CORS
CORS_ORIGIN=http://localhost:5173

# Ollama AI
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=gemma:2b

# Logging
LOG_LEVEL=info

3. Install Dependencies

# Install root dependencies
npm install

# Frontend dependencies
cd devsphere-frontend && npm install && cd ..

# Backend dependencies (if needed)
cd backend && npm install && cd ..

4. Start Services

Option A: Start Backend & Frontend Separately

Terminal 1 - Backend:

npm run start:backend
# or
cd backend && npm run dev

Terminal 2 - Frontend:

cd devsphere-frontend && npm run dev

Option B: Start Both (requires concurrently)

npm run dev:all

5. Access the Application


πŸ“‘ API Endpoints

Authentication

  • POST /api/v1/auth/register - User registration
  • POST /api/v1/auth/login - User login
  • POST /api/v1/auth/logout - User logout

Agent Chat

  • POST /api/v1/agent/message - Send message to AI agent
  • GET /api/v1/agent/sessions - Get user's chat sessions
  • GET /api/v1/agent/sessions/:id - Get session details

Health Check

  • GET /health - Server status

🎯 Usage Examples

Send Message to AI Agent

curl -X POST http://localhost:5000/api/v1/agent/message \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -d '{
    "message": "How do I optimize this React component?",
    "agentType": "coding"
  }'

Response

{
  "success": true,
  "message": "Message processed",
  "reply": "Here's how to optimize your React component...",
  "sessionId": "session_123"
}

πŸ”§ Development

Running Tests

npm test

Linting

cd devsphere-frontend && npm run lint

Building for Production

npm run build

This creates:

  • Frontend build: devsphere-frontend/dist/
  • Backend: Ready to run with npm start

πŸ“š Project Structure Explained

Backend Structure

backend/src/
β”œβ”€β”€ controllers/     # Handle HTTP requests & responses
β”œβ”€β”€ services/        # Implement business logic
β”œβ”€β”€ models/          # Define data schemas
β”œβ”€β”€ middleware/      # Authentication, error handling, etc.
β”œβ”€β”€ routes/          # Define API endpoints
β”œβ”€β”€ utils/           # Helper functions & classes
β”œβ”€β”€ config/          # Configuration utilities
└── index.js         # Application startup

Frontend Structure

devsphere-frontend/src/
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ ui/          # Button, Card, Input, etc.
β”‚   β”œβ”€β”€ chat/        # ChatWindow, MessageBubble, etc.
β”‚   β”œβ”€β”€ layout/      # MainLayout, Sidebar, etc.
β”‚   └── animations/  # AnimatedBackground, etc.
β”œβ”€β”€ pages/           # LandingPage, Dashboard
β”œβ”€β”€ services/        # API integration
β”œβ”€β”€ hooks/           # Custom React hooks
β”œβ”€β”€ utils/           # Helper functions
└── constants/       # Constants & config

πŸ” Authentication Flow

  1. User registers with email/password
  2. Backend validates and stores password hash
  3. JWT token issued on successful login
  4. Token included in Authorization header for protected routes
  5. Backend verifies token on each request

🚨 Error Handling

The API includes comprehensive error handling:

{
  "success": false,
  "message": "User already exists",
  "statusCode": 409,
  "errors": {
    "email": "Email is already in use"
  }
}

πŸ“ Logging

Logs are stored in logs/ directory:

  • combined.log - All logs
  • error.log - Error logs only

View logs in real-time during development via console output.


🀝 Contributing

Contributions are welcome! Please follow these steps:

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

Code Style

  • Follow Airbnb JavaScript style guide
  • Use meaningful variable/function names
  • Add comments for complex logic
  • Keep functions small and focused

πŸ“„ License

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


🌟 Acknowledgments

  • Inspired by modern AI platforms like OpenAI, Vercel, and Linear
  • Built with ❀️ for developers and AI enthusiasts
  • Special thanks to the open-source community

πŸ“§ Support & Contact


πŸ—ΊοΈ Roadmap

  • User authentication & profiles
  • Conversation history & export
  • Custom agent creation
  • Team collaboration features
  • API rate limiting dashboard
  • Advanced analytics
  • Mobile app (React Native)
  • WebSocket real-time support

Made with ❀️ by Hardik Kaurani | Visit Website | View Demo

About

A modern full-stack AI assistant built with React, Node.js and Ollama, featuring an animated UI and modular architecture.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors