MERN stack: React (Vite) + Material UI + Redux frontend, Node.js + Express + MongoDB (Mongoose) backend.
Features: register / login (bcrypt + JWT), profile pictures, profiles with stats (profile views, impressions), posts with caption + image / clip / audio / attachment, home feed, like / unlike, comments, delete own posts, add / remove friends (mutual), people search, notifications, editable social profiles, sponsored widget, light / dark mode, responsive desktop + mobile layout.
- Node.js LTS (v18 or newer): https://nodejs.org
- MongoDB - choose one:
- MongoDB Community Server (local): https://www.mongodb.com/try/download/community
(tick "Install MongoDB as a Service"). Default URL already in
.env.example. - MongoDB Atlas (free cloud): create a cluster and paste your connection string into
MONGO_URL.
- MongoDB Community Server (local): https://www.mongodb.com/try/download/community
(tick "Install MongoDB as a Service"). Default URL already in
Open PowerShell in the extracted project folder.
Backend (window 1):
cd server
copy .env.example .env
node -e "console.log(require('crypto').randomBytes(48).toString('hex'))" # copy the output
notepad .env # paste it as JWT_SECRET, save
npm install
npm run devYou should see WISE API running on http://localhost:3001.
Frontend (window 2):
cd client
npm install
npm run devOpen http://localhost:5173, click "Sign Up here", create an account (a profile picture is required), then log in.
Shortcut (after the first .env setup): powershell -ExecutionPolicy Bypass -File .\run.ps1
- "running scripts is disabled" when using npm:
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned - MongoDB connection failed: check the service is running (
Get-Service MongoDB) or fixMONGO_URL. - Backend on another URL/port: copy
client\.env.exampletoclient\.envand setVITE_API_URL; setCLIENT_URLinserver\.envto the frontend address.
server/ index.js, models/, controllers/, routes/, middleware/, utils/, public/assets (uploads)
client/ src/{App.jsx, main.jsx, theme.js, api.js, state/, components/, scenes/{navbar,loginPage,homePage,profilePage,widgets}}
| Method | Route | Purpose |
|---|---|---|
| POST | /auth/register | create account (multipart, picture) |
| POST | /auth/login | login, returns token + user |
| GET | /auth/me | current user |
| GET | /users/search?q= | search people |
| GET | /users/:id | profile (?view=1 counts a profile view) |
| GET | /users/:id/friends | friend list |
| PATCH | /users/:id | edit own location, occupation, socials |
| PATCH | /users/:id/:friendId | add / remove friend |
| GET | /posts | feed |
| GET | /posts/user/:userId | a user's posts |
| GET | /posts/notifications | likes / comments on my posts |
| POST | /posts | create post (multipart, description, media) |
| PATCH | /posts/:id/like | like / unlike |
| POST | /posts/:id/comments | add comment |
| DELETE | /posts/:id | delete own post |
Passwords hashed with bcrypt (cost 12); JWT with expiry; secrets only in .env (never commit it);
uploads limited by type and size with server-generated file names; login/register rate-limited;
helmet + CORS restricted to CLIENT_URL.
The backend also serves the built website, so only one Render service is needed. Accounts: GitHub, MongoDB Atlas (database), Cloudinary (photos/files), Render (hosting).
- Atlas: free cluster -> Database Access: add user + password (letters/numbers only) ->
Network Access: allow
0.0.0.0/0-> Connect -> Drivers -> copy the string and add/wisebefore the?:mongodb+srv://USER:PASSWORD@cluster0.xxxxx.mongodb.net/wise?retryWrites=true&w=majority - Cloudinary: sign up, copy Cloud name, API key, API secret. (If PDF/ZIP links do not open: Settings -> Security -> allow delivery of PDF and ZIP files.)
- GitHub: upload this whole project to a new repository (
.envfiles are git-ignored). - Render -> New -> Web Service -> pick the repo, then:
- Root Directory: leave empty
- Build Command:
npm run build - Start Command:
npm start - Instance Type: Free
- Environment variables:
MONGO_URL,JWT_SECRET(long random text),JWT_EXPIRES_IN=7d,CLOUDINARY_CLOUD_NAME,CLOUDINARY_API_KEY,CLOUDINARY_API_SECRET
- Wait for the deploy to finish, then open your
https://....onrender.comlink. That is your live website.
Free-tier note: the free service sleeps after 15 minutes idle; the first visit afterwards takes about a minute.