Dharmendra016/Event_management

★ 0Forks 0TypeScriptGitHub ↗Compare

Project website ↗

README

Event Management

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.


Table of Contents


Project Structure

event_management/
├── backend/      # Node.js/Express API
└── frontend/     # Next.js/React frontend

Local Setup

Prerequisites

  • Node.js (v18+ recommended)
  • npm (v9+ recommended)

1. Clone the Repository

git clone https://github.com/Dharmendra016/yipl-log-processor
cd intership_project

2. Setup Backend

cd backend
cp .env.example .env
npm install
npm run dev

3. Setup Frontend

cd ../frontend
cp .env.example .env
npm install
  • Edit .env as 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).

Backend API Documentation

Base URL: /api/v1


User Routes (/api/v1/users)

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

Event Routes (/api/v1/events)

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

Notes:

  • All protected routes require a valid JWT token in the Authorization header as Bearer <token>.
  • Only users with the organizer role can create, update, or delete events.
  • Image uploads for events use the images field (max 5 files).
  • The /all-events endpoint supports optional query parameters for filtering by title and date range.

Frontend Pages

/

  • Home page: Overview, navigation, and featured content.

/login

  • Login page: User login form.

/signup

  • Signup page: User registration form.

/profile/[id]

  • Profile page: Displays user profile and their events.

/events

  • Events list: Shows all events.

/events/[id]

  • Event details: View details for a specific event.

/events/create

  • Create event: Form to create a new event (requires login).

/events/edit/[id]

  • Edit event: Edit an existing event (requires login, owner only).

Environment Variables

Backend (backend/.env)

  • PORT - Port for backend server (default: 5000)
  • JWT_SECRET - Secret key for JWT authentication
  • (Add other variables as needed)

Frontend (frontend/.env)

  • NEXT_PUBLIC_API_URL - Base URL for backend API (e.g., http://localhost:5000/api)

License

This project is for educational purpose

Contributors

Dharmendra016

Issues