How prateekkumar2204/social-media works
Project type and purpose
• This is a full-stack social-media application with real-time group chat and video-call features.
• The backend is a Node.js/Express REST API with authentication, user/group/message/post models.
• The frontend is a React/Vite single-page app styled with SCSS, handling routing, chat UI, group management, video calling via Agora.
File structure
• Top-level “backend” folder:
• index.js (Express app entry)
• controllers/logincontroller.js (login logic)
• middlewares/authenticate.js (JWT or token auth)
• model/*.js (Mongoose schemas for User, Post, Group, Message, GroupChat)
• routers/useroutes.js (user-facing endpoints)
• public/images (static assets)
• Top-level “frontend” folder:
• src/pages (route components like Login, Home, Chat, VideoCall)
• src/Components (ChatArea, mainArea subcomponents for chat UI and group popups)
• src/api/AuthApi.jsx (REST calls for auth)
• src/store/auth.jsx (client auth state)
• SCSS folder for global styling per page/feature
• Video-call integration via agora-rtm-sdk
README
• Minimal (“A social media project”), but file names imply features: authentication, posts, group chats, and video calls.
Detail
• Where middleware plugs in (e.g., “authentication” before protected routes).
• Sequence if needed: user logs in → token returned → WebSocket handshake includes token → stream.
• Both synchronous (REST) and asynchronous (WebSocket, Agora events) flows.