How harshit-exe/vjti-appnew works
Project Type & Purpose
• Full-stack web application built on Next.js (app router) with React components, Tailwind CSS, and serverless API routes.
• Purpose: Provide a VR-inspired collaboration environment for remote workers, integrating AI-powered tools (content generation, automated scheduling), real-time chat/video, document editing, and wellness features.
High-Level Architecture Components
A. Client (Web Browser)
– Tech: React + Next.js pages under src/app, UI components, Tailwind CSS.
– Features:
• Authentication flows (login, signup, OTP)
• Role-based sections (Admin, Department-Head, Employee)
• VR Meeting pages, Real-time doc editor, Chat UI, Video calls, Task dashboards, Wellness tools.
B. Next.js Server / API Layer (Serverless Functions)
– Located in pages/api (e.g., socket/io.js).
– Responsibilities:
• REST / RPC endpoints for data fetching (user/profile/task management).
• WebSocket (Socket.IO) server for real-time chat/video signaling.
• Authentication / session management.
C. Database / Persistence
– Not explicit in code, but implied: external database (e.g., MongoDB, PostgreSQL, or Sanity/Groq).
– Stores users, departments, tasks, chat history, meeting metadata.
D. External AI Services
– Hooks: useAI, useGroqAI, groqAI.js suggest connection to an AI backend (possibly OpenAI or a custom Groq endpoint).
– Responsibilities: content generation, prompt optimization.
E. CDN / Static Assets
– Hosted via Vercel or similar.
F. Hosting / Deployment
– Vercel serverless platform (next.config.mjs present).
– Builds & deploys front and back ends together.
Relationships & Data Flows
1. Browser ↔ Next.js Server
• Initial page render (SSR/SSG).
• API calls over HTTPS for CRUD operations (tasks, departments, user data).
2. Browser ↔ WebSocket Server
• Real-time chat messages, video call signaling, collaborative editing presence.
3. Next.js Server ↔ Database
• Reads/writes user profiles, tasks, chat logs.
4. Next.js Server ↔ External AI API
• For generating content, automating scheduling.
5. Browser ↔ CDN
• Loads static assets, images, client JS bundles.
Architectural Patterns & Principles
• Modular UI components (src/components/*) separated by domain (auth, admin, employee, editor, socket, ui primitives).
• App router conventions: grouping by user roles and features under src/app/(auth), (company), (department-head), (employee).
• Serverless functions for thin backend layer—scales with usage.
• Real-time event-driven via Socket.IO.
• Hooks for encapsulating business logic (AI calls, tokenization, toast notifications).
– Component labels (e.g., Next.js App Router, Socket.IO Server, AI Hook Service).
– Group related components in containers (e.g., “src/components/editor” under Editor UI).