Vibesta is a social media application inspired by Instagram, built with the MERN stack. It provides a platform for users to share photos, connect with others, and interact through real-time chat messaging.
- User Authentication: JWT-based sign up, login, and logout with password hashing.
- Photo Sharing: Upload images (processed with
multer+sharp) stored via Cloudinary. - User Profiles: Create and manage your profile, including profile picture, bio, and personal details.
- Chat Messaging: Real-time one-to-one messaging powered by Socket.IO.
- Social Engagement: Like and comment on posts from users you follow.
- Feed: View a dynamic feed of posts from the people you follow.
- Profile Customization: Update profile details, including profile picture and bio.
Vibesta is a monorepo managed with Turborepo and npm workspaces:
.
├── apps
│ ├── backend # Express.js API + Socket.IO server
│ │ ├── app.js # Entry point; wires up middleware and routes
│ │ ├── controllers/ # Request handlers for users, posts, messages
│ │ ├── models/ # Mongoose schemas
│ │ ├── routes/ # /api/v1/user, /api/v1/post, /api/v1/message
│ │ ├── middlewares/ # Auth, upload, and validation middleware
│ │ ├── socket/ # Socket.IO server + connection handling
│ │ ├── utils/ # DB connection and helpers
│ │ └── scripts/ # seed.js, verify.js (sample/bulk data)
│ └── frontend # React + Vite client
│ ├── src/components/ # UI components (Radix/shadcn-style)
│ ├── src/redux/ # Redux Toolkit slices + persisted store
│ ├── src/hooks/ # Custom hooks (e.g. Socket.IO)
│ ├── src/lib/ # Utilities and client setup
│ ├── app.jsx # App shell + routes
│ ├── main.jsx # React entry point
│ └── index.css # Tailwind entry styles
├── package.json # Workspace root + turbo scripts
└── turbo.json # Turborepo task pipeline
The backend exposes three REST namespaces under the /api/v1 prefix:
| Namespace | Description |
|---|---|
/api/v1/user |
Authentication and profile operations |
/api/v1/post |
Post upload, like, comment, and feed operations |
/api/v1/message |
Chat/conversation endpoints |
- Monorepo: Turborepo with npm workspaces
- Frontend: React 18, Vite, React Router, Redux Toolkit + Redux Persist, Tailwind CSS, Radix UI (shadcn-style), Axios, Socket.IO client, sonner (toasts)
- Backend: Node.js, Express.js, JWT, bcryptjs, Mongoose, Multer + Sharp, Cloudinary, Socket.IO, cookie-parser
- Database: MongoDB
- Real-time Communication: Socket.IO
- Node.js (v18 or later — this repo uses npm@10 via
packageManager) - npm
- A MongoDB instance (local or Atlas)
- A Cloudinary account (for image uploads)
-
Clone the repository:
git clone https://github.com/yourusername/vibesta.git
-
Navigate to the project directory:
cd vibesta -
Install all workspace dependencies:
npm install
-
Configure the environment variables. Create
apps/backend/.env(the app reads it from there) with the following keys:PORT=3000 MONGO_URI=mongodb://127.0.0.1:27017/vibesta SECRET_KEY=your_jwt_secret CLOUDINARY_CLOUD_NAME=your_cloud_name CLOUDINARY_API_KEY=your_api_key CLOUDINARY_API_SECRET=your_api_secret
Run both the backend and frontend dev servers concurrently:
npm run dev- Backend API runs at
http://localhost:3000by default (falls back to3000whenPORTis unset; override it in.env). - Frontend dev server runs at
http://localhost:5173(the only permitted CORS origin).
To populate the database with bulk/faker data (useful for development):
npm run seed # Seed the database
npm run seed:verify # Verify the inserted dataThese are scoped to the backend workspace. Alternatively run them from
apps/backend.
Build all packages with Turborepo:
npm run buildNote: the frontend produces a Vite production build (
dist/), while the backendbuildstep performs a Node syntax check — it does not bundle code.
Production is split across two hosts:
- Frontend –
https://vibesta-frontend.vercel.app(Vercel, serves the Vitedist/build) - Backend / API –
https://vibesta.onrender.com(Render, Express + Socket.IO)
Key production configuration:
- CORS –
app.jsandsocket/socket.jswhitelisthttps://vibesta.onrender.comandhttps://vibesta-frontend.vercel.appby default. Additional origins can be added at deploy time via theCORS_ORIGINSenvironment variable (comma-separated). - Frontend API –
src/lib/api.jsfalls back tohttps://vibesta.onrender.comwhenVITE_API_BASE_URLis unset. A committed.env.productionpins bothVITE_API_BASE_URLandVITE_SOCKET_URLto the Render backend so thatvite buildembeds the correct endpoints. - Cookies – The JWT auth cookie is set via
utils/cookieOptions.js, which readsCOOKIE_SAMESITEandCOOKIE_SECUREfrom the environment. In production (cross-origin) these must benoneandtruerespectively so the browser sends the cookie across origins. Local dev usesstrict/false. An.env.exampledocuments all variables. - Keep-alive –
utils/keepAlive.jspingshttps://vibesta.onrender.com/login(andstreamtalk.onrender.com) to keep the free-tier Render service warm. URLs are configurable viaKEEP_ALIVE_URLS. - Secrets – keep
MONGO_URI,SECRET_KEY, and Cloudinary credentials in the Render dashboard environment, not in the committed.env.
Build the frontend and start the backend API:
npm run build
npm startnpm run lint # Run linters across all workspaces
npm run format # Format all sources with Prettier
npm run format:check # Verify formatting without writing
npm run clean # Clean build artifacts/caches- Create an account or log in to access the app.
- Upload photos, send messages, and interact with other users.
Feel free to submit issues or pull requests to improve the project.
This project is licensed under the MIT License — see the LICENSE file for details.
- Thanks to all the contributors and the open-source community.