How shivankkumar09/alpha_bot works
Alpha Bot is a full-stack Gemini chatbot. Users sign up or log in, open the protected chat workspace, create and manage persistent chat sessions, and send messages for AI responses. The frontend owns navigation, authentication state, chat interaction, and API calls; Express routes dispatch those calls to authentication and chat controllers, which use MongoDB-backed user records and the AI service. The README documents Gemini integration and persistent history; unsampled service details are not inferred beyond that documented integration.
Main entry points: user-routes.ts User routes · chat-routes.ts Chat routes · api.jsx HTTP API client · App.jsx App routing
Components 20
Web application
- App routing
client/src/App.jsx - Auth state
client/src/context/AuthContext.jsx - Login and signup
client/src/pages - Chat workspace
client/src/pages/Chat.jsx - Session sidebar
client/src/components/ChatSidebar.jsx - Message rendering
client/src/components/ChatItem.jsx - Chat state
client/src/context/ChatContext.jsx - HTTP API client
client/src/helper/api.jsx
API and identity
- Express app
server/src/app.ts - User routes
server/src/routes/user-routes.ts - User operations
server/src/controllers/user-controllers.ts - JWT verification
server/src/utils/token-manager.ts - Request validation
server/src/utils/validators.ts
Chat domain
- Chat routes
server/src/routes/chat-routes.ts - Session and messages
server/src/controllers/chat-controllers.ts - User and chat records
server/src/models/User.ts - Gemini service
server/src/services/ai.service.ts
External services
- MongoDB
- Google Gemini API
Other components
- Chat user
Connections 26
- Chat user → App routing: uses
README.md - App routing → Auth state: checks auth
client/src/App.jsx - App routing → Login and signup: routes to
client/src/App.jsx - App routing → Chat workspace: routes to
client/src/App.jsx - Login and signup → Auth state: authenticates via
client/src/pages/Login.jsx - Chat workspace → Session sidebar: renders
client/src/pages/Chat.jsx - Chat workspace → Message rendering: renders
client/src/pages/Chat.jsx - Chat workspace → HTTP API client: requests
client/src/pages/Chat.jsx - Chat state → HTTP API client: requests
client/src/context/ChatContext.jsx - Auth state → HTTP API client: requests
client/src/context/AuthContext.jsx - HTTP API client → User routes: HTTP requests
client/src/helper/api.jsx - HTTP API client → Chat routes: HTTP requests
client/src/helper/api.jsx - Express app → User routes: mounts routes
server/src/app.ts - Express app → Chat routes: mounts routes
server/src/app.ts - User routes → User operations: dispatches
server/src/routes/user-routes.ts - User routes → JWT verification: verifies token
server/src/routes/user-routes.ts - User routes → Request validation: validates input
server/src/routes/user-routes.ts - Chat routes → Session and messages: dispatches
server/src/routes/chat-routes.ts - Chat routes → JWT verification: verifies token
server/src/routes/chat-routes.ts - Chat routes → Request validation: validates input
server/src/routes/chat-routes.ts - User operations → User and chat records: reads and writes
server/src/controllers/user-controllers.ts - User operations → JWT verification: creates tokens
server/src/controllers/user-controllers.ts - Session and messages → User and chat records: reads and saves
server/src/controllers/chat-controllers.ts - Session and messages → Gemini service: generates response
server/src/controllers/chat-controllers.ts - User and chat records → MongoDB: persists records
README.md - Gemini service → Google Gemini API: generates content
README.md