How prashant1177/notesbot works
Project type and purpose
• From the file tree and README, this is a full-stack web application with:
• A Node.js/Express backend (backend/)
• Two frontends:
– A Next.js site in frontend-next/ (marketing, blog, docs, user flows)
– A standalone React/Vite app in frontend/ (the in-browser LaTeX editor)
• A MongoDB database (inferred from Mongoose-style models/*.js)
• External services: Google Gemini API (AI note generation), email/SMS, payment gateway (Razorpay), WebSocket for real-time updates
File structure
• backend/
• index.js, routes/, models/, middleware/ → REST API + auth + data models
• socket.js → real-time collaboration (WebSocket server)
• templates/ → code/document templates
• utils/ → OTP/email helpers
• frontend-next/
• Next.js app for landing, blogs, docs, user auth, subscription management
• src/app/ follows the app-router paradigm
• UI components, public assets, API wrappers (lib/api.js)
• frontend/
• React + Vite for the LaTeX editor UI
• Pages for editor, file/folder view, versioning, AI chat, PDF viewer
• Shared UI library under src/ui
• nginx/, docker-compose.yml
• Deployment configs for Docker, nginx reverse proxy
README for additional insights
• Description of AI-powered note generation (Gemini API)
• Deployment targets: Vercel (Next.js), Render (backend)
• Tech stack summary confirms major frameworks and external services
Main components & interactions
a. Components
• Next.js Frontend (Marketing & Documentation)
• React/Vite Frontend (In-browser LaTeX editor & project dashboard)
• Node/Express API Server
• WebSocket Server (real-time)
• MongoDB Atlas (persistence)
• Google Gemini API (AI)
• Email/SMS Service (OTP, notifications)
• Payment Gateway (Razorpay)
• Deployment/Infra (Docker, nginx, Vercel, Render)
b. Relationships
• Browsers ⇄ Next.js (public site, blogs, docs, auth flows)
• Browsers ⇄ React/Vite (editor UI)
• Both frontends → REST API (backend routes)
• Editor UI ↔ WebSocket Server (real-time collaboration)
• API Server → MongoDB (CRUD for users, projects, versions)
• API Server → Gemini API (generate notes or suggestions)
• API Server → Email/SMS service (send OTP)
• Frontend Next → Razorpay Script → Payment Gateway API
c. Architectural patterns
• Modular MVC in backend (models, routes, middleware)
• Client-side routing in React and Next.js (app router)
• Micro-frontend style (two distinct UIs)
• Real-time collaboration via WebSockets
• Containerized deployment (Docker + nginx)
d. Technologies
• Node.js, Express, Mongoose
• React, Vite, Tailwind, Next.js
• WebSockets (socket.io or native)
• MongoDB Atlas
• Google Gemini API
• Razorpay
• Docker, nginx, Vercel, Render
Key advice
• Logical layers: UI, application logic, data persistence, external integrations, and infra
• Keep it modular so that each subteam can understand their scope at a glance