This project is a full-stack web application with a Node.js/Express backend and a Next.js/React frontend. It provides user authentication, event management, and profile features. Below you'll find a comprehensive guide to setting up the project locally, as well as detailed documentation for all API routes and frontend pages.
- Project Structure
- Local Setup
- Backend API Documentation
- Frontend Pages
- Environment Variables
- License
event_management/
├── backend/ # Node.js/Express API
└── frontend/ # Next.js/React frontend
- Node.js (v18+ recommended)
- npm (v9+ recommended)
git clone https://github.com/Dharmendra016/yipl-log-processor
cd intership_projectcd backend
cp .env.example .env
npm install- Edit
.envto set your environment variables (see Environment Variables). - Start the backend server:
npm run devcd ../frontend
cp .env.example .env
npm install- Edit
.envas needed. - Start the frontend server:
npm run dev- The frontend will be available at
http://localhost:3000(default). - The backend will be available at
http://localhost:5000(default).
| Method | Endpoint | Description | Auth Required | Body / Params |
|---|---|---|---|---|
| POST | /signup |
Register a new user | No | { name, email, password, role } |
| POST | /login |
Login an existing user | No | { email, password, role } |
| GET | /logout |
Logout the current user (clears cookie) | No | - |
| GET | /profile |
Get the profile of the logged-in user | Yes | - |
| GET | /attend/:id |
Attend an event (add user to event's attendees) | Yes | :id = Event ID |
| Method | Endpoint | Description | Auth Required | Body / Params |
|---|---|---|---|---|
| POST | /create-events |
Create a new event (organizer only, supports images) | Yes | FormData: event fields, images (max 5) |
| GET | /all-events |
Get all events (with optional filters: title, date range) | Yes | Query: title, startDate, endDate |
| GET | /alleventsforall |
Get all events (public, no filters) | No | - |
| GET | /get-events-attended/:userId |
Get events attended by a user | Yes | :userId = User ID |
| GET | /get-events/:userId |
Get events created by a user (organizer only) | Yes | :userId = User ID |
| GET | /get-event/:id |
Get details of a specific event | Yes | :id = Event ID |
| PATCH | /update-event/:id |
Update an event (organizer & owner only, supports images) | Yes | :id = Event ID, FormData: event fields, images (max 5) |
| DELETE | /delete-event/:id |
Delete an event (organizer & owner only) | Yes | :id = Event ID |
- All protected routes require a valid JWT token in the
Authorizationheader asBearer <token>. - Only users with the
organizerrole can create, update, or delete events. - Image uploads for events use the
imagesfield (max 5 files). - The
/all-eventsendpoint supports optional query parameters for filtering by title and date range.
- Home page: Overview, navigation, and featured content.
- Login page: User login form.
- Signup page: User registration form.
- Profile page: Displays user profile and their events.
- Events list: Shows all events.
- Event details: View details for a specific event.
- Create event: Form to create a new event (requires login).
- Edit event: Edit an existing event (requires login, owner only).
PORT- Port for backend server (default: 5000)JWT_SECRET- Secret key for JWT authentication- (Add other variables as needed)
NEXT_PUBLIC_API_URL- Base URL for backend API (e.g.,http://localhost:5000/api)
This project is for educational purpose