How anubhav047/instagram-clone works
Project type and purpose
• This is a full-stack MERN (MongoDB, Express, React, Node.js) “Instagram clone” social media application.
• The frontend is built with Create-React-App; the backend is an Express/Node server exposing RESTful endpoints; MongoDB stores users and posts; JWT handles auth.
File structure
• Top level:
• app.js – entry point for Express server
• db.js – MongoDB connection setup
• routes/ – Express route modules (auth.js, user.js, post.js)
• models/ – Mongoose schemas (user.js, post.js)
• middlewares/requirelogin.js – protects private endpoints
• Frontend folder (frontend/):
• public/ & src/ – standard CRA structure with components, styles, assets
• package.json – React dependencies
• build/ – production bundle
• Config files: .gitignore, package.json, package-lock.json.
README for insights
• Confirms MERN stack, requires MongoDB, environment variables (MONGO_URI, JWT_SECRET).
• Lists React, Express, Node, MongoDB, JWT, bcrypt, react-toaster.
Final guidance
• Be detailed: break the API server into Routers (auth/post/user), Middleware (requirelogin), and Models.
• Critical elements: user signup/login, JWT flow, post creation/fetch, profile retrieval.
• A small annotation for deployment considerations (e.g., Node app runs on port 5000; React served from port 3000 or static build).