ClubZOne is a full-stack web application to manage college clubs. It provides:
- User authentication (signup/login/logout) using JWT (stored in an HTTP-only cookie)
- Club browsing and club details view
- Club posts and events (view-only for users)
- Club admin/superadmin features to update club profile, create events/posts, and manage members
- Image uploads via Cloudinary
This README is optimized for college placement submissions: easy setup + clear run instructions.
- Node.js + Express
- MongoDB + Mongoose
- JWT authentication (cookie based)
- Cloudinary image upload (multer-storage-cloudinary)
- React (Vite)
- Axios for API calls
- React Router
backend/— Express API serverFrontend/— React + Vite frontend
- Node.js (v16+ recommended)
- MongoDB (local or Atlas)
- Cloudinary account (for image uploads)
Create a file named .env inside backend/ with:
PORT=8000
MONGODB_URL=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
# Optional - AI assistant. Without it the assistant degrades gracefully.
ANTHROPIC_API_KEY=your_anthropic_key
ANTHROPIC_MODEL=claude-opus-5A ready-to-copy template lives at backend/.env.example. The real .env
is gitignored and never committed - copy it across machines by hand.
Setting up on a new machine? If
MONGODB_URLpoints at MongoDB Atlas, add that machine's IP under Atlas > Network Access, or the connection will time out.
If frontend and backend run on different ports/domains, you can set:
VITE_API_BASE_URL=http://localhost:8000/apiIf you don’t set it, the app uses /api.
cd backend
npm install
npm run devBackend runs on http://localhost:8000 by default.
cd Frontend
npm install
npm run devFrontend runs on the Vite default port (usually http://localhost:5173).
Base paths:
- Auth:
/api/auth - Clubs:
/api/club - Club Admin:
/api/clubadmin - Health:
/api/ping
GET /api/ping
POST /api/auth/signup- Body:
{ fullName, email, password, role }
- Body:
POST /api/auth/login- Body:
{ email, password }
- Body:
POST /api/auth/logout
GET /api/club/clubsGET /api/club/:clubIdGET /api/club/:clubId/postsGET /api/club/:clubId/membersGET /api/club/:clubId/events
All routes require protectRoute and verifyClubEditAccess.
-
PUT /api/clubadmin/:clubId/profile- Updates:
image,description,aboutUs
- Updates:
-
POST /api/clubadmin/:clubId/events- Creates event
- Supports image array upload:
images(max 3)
-
DELETE /api/clubadmin/:clubId/events/:eventId -
POST /api/clubadmin/:clubId/posts- Creates post
- Supports image array upload:
images(max 3)
-
DELETE /api/clubadmin/:clubId/posts/:postId -
DELETE /api/clubadmin/:clubId/members/:userId -
PATCH /api/clubadmin/:clubId/members/:userId/role- Body:
{ role, canEdit }
- Body:
- Backend stores JWT in a cookie named
jwt(HTTP-only). - Frontend sends credentials automatically via Axios (
credentials: truebehavior is handled by browser/CORS config). - Unauthorized users are redirected to
/loginby the Axios interceptor.
- Backend uses multer with Cloudinary storage.
- Events/Posts accept
images(array).
- Start backend
- Start frontend
- Signup/login from frontend
- Browse clubs
- If logged in as club admin, try updating profile and creating events/posts
- Separation of concerns: backend controllers/routes/middlewares and frontend pages/components.
- Secure auth approach: JWT in cookie + protected routes.
- Real-world upload pipeline: multer + Cloudinary.
ClubZOne Team