How subhamdey1234/ai_assistant works
This is a virtual-assistant web app with account flows and a broader social layer in the backend. Users sign in, configure an assistant, then speak commands; the browser sends recognized text through shared client state to the API, which classifies the intent and returns a response for browser-side actions or speech. The backend also contains profile, post, comment, and admin domains. The tree and sampled controllers show their models and operations, but excerpts do not establish all route-to-controller wiring, so those links are omitted.
Main entry points: App.jsx App routing · Context.jsx Client context · UserController.js User operations · server.js Express server
Components 27
Web client
- App routing
frontend/src/App.jsx - Client context
frontend/src/context/Context.jsx - Assistant home
frontend/src/pages/Home.jsx - Login and signup
frontend/src/pages/Login.jsx - Assistant setup
frontend/src/pages/Customize.jsx - Assistant setup 2
frontend/src/pages/Customize2.jsx
API and assistant
- Express server
backend/server.js - Auth routes
backend/Routes/Userroute.js - User routes
backend/Routes/Userprofileroute.js - User operations
backend/controllers/UserController.js - JWT verification
backend/config/jwt.js - Auth middleware
backend/Middleware/isAuth.js - Intent classification
backend/gemini.js
Social features
- Post operations
backend/controllers/PostController.js - Comment operations
backend/controllers/CommentController.js - Profile operations
backend/controllers/ProfileController.js - Admin operations
backend/controllers/AdminController.js
Persistence and integrations
- User records
backend/models/User.js - Post records
backend/models/Post.js - Comment records
backend/models/Comment.js - Profile records
backend/models/Profile.js - Admin records
backend/models/Admin.js - Database connection
backend/config/dbconnect.js
Other components
- User
- Browser speech and actions
- Gemini service
- Cloudinary upload
Connections 33
- User → App routing: uses
- App routing → Client context: provides state
- App routing → Login and signup: routes
- App routing → Assistant home: routes
- App routing → Assistant setup: routes
- App routing → Assistant setup 2: routes
- Login and signup → Client context: authenticates via
- Assistant setup → Client context: uses
- Assistant setup 2 → Client context: uses
- Assistant home → Client context: requests assistant
- Assistant home → Browser speech and actions: uses speech and actions
- Client context → Express server: HTTP requests
- Express server → Auth routes: mounts
- Express server → User routes: mounts
- Express server → Database connection: connects
- Express server → Intent classification: invokes
- Auth routes → Auth middleware: uses
- User routes → Auth middleware: uses
- Auth middleware → JWT verification: verifies token
- User operations → JWT verification: verifies token
- User operations → User records: reads and writes
- User operations → Profile records: uses
- User operations → Intent classification: classifies command
- User operations → Cloudinary upload: uploads image
- Intent classification → Gemini service: requests intent
- Post operations → Post records: reads and writes
- Post operations → Comment records: deletes related
- Comment operations → Comment records: reads and writes
- Comment operations → Post records: checks post
- Profile operations → Profile records: reads and writes
- Admin operations → User records: manages users
- Admin operations → Profile records: deletes profile
- Admin operations → Post records: manages posts