Skip to content

sdshone/event-management

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Virtual Event Management Platform Backend

Overview

This project is a backend system for a virtual event management platform. It allows users to register, log in, create and manage events, and register for events. The backend is built with Node.js, Express.js, and uses in-memory data structures to store information about users and events.

Features

  • User Authentication: Secure user registration and login using bcrypt for password hashing and JWT for session management.
  • Event Management: Create, update, and delete events with details such as date, time, description, and participant list.
  • Participant Management: Allow users to register for events and manage their registrations.
  • Asynchronous Operations: Sending email notifications on successful event registration.

Installation

  1. Clone the repository:
git clone https://github.com/sdshone//event-management
cd event-management
  1. Install dependencies:
npm install
  1. Create a .env file in the root directory with the following environment variables:
PORT=xxx
JWT_SECRET=xxx
EMAIL_USER=xxx
EMAIL_CLIENT_ID=xxx
EMAIL_CLIENT_SECRET=xxx
EMAIL_REFRESH_TOKEN=xxx
EMAIL_ACCESS_TOKEN=xxx
  1. Start the server:
node run start

The server will run on http://localhost:3000.

  1. Run tests:
npm run test

API Endpoints

  1. Register User
curl -X POST http://localhost:3000/api/auth/register \
-H "Content-Type: application/json" \
-d '{"username": "john_doe", "password": "password123", "role": "organizer", "email": "[email protected]"}'
  1. Login User
curl -X POST http://localhost:3000/api/auth/login \
-H "Content-Type: application/json" \
-d '{"username": "john_doe", "password": "password123"}'
  1. Create an Event
curl -X POST http://localhost:3000/api/events \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your_jwt_token>" \
-d '{"title": "Virtual Conference", "date": "2024-08-20", "time": "10:00 AM", "description": "Tech conference"}'
  1. Update an Event
curl -X PUT http://localhost:3000/api/events/1 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your_jwt_token>" \
-d '{"title": "Updated Conference"}'
  1. Delete an Event
curl -X DELETE http://localhost:3000/api/events/1 \
-H "Authorization: Bearer <your_jwt_token>"
  1. Get All Events
curl -X GET http://localhost:3000/api/events
  1. Get a Specific Event
curl -X GET http://localhost:3000/api/events/1
  1. Register for an Event
curl -X POST http://localhost:3000/api/events/1/register \
-H "Authorization: Bearer <your_jwt_token>"
  1. View Event Participants
curl -X GET http://localhost:3000/api/events/1/participants \
-H "Authorization: Bearer <your_jwt_token>"

About

Backend for Event Management app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published