PlayPulseServer is a backend server for managing events and user data, built with Node.js and Express. It connects to MongoDB for data storage and uses Firebase Admin for authentication and notifications. The server is designed to be secure, scalable, and easy to integrate with frontend applications.
The purpose of this project is to provide a robust backend API for event management applications, supporting user authentication, event creation, and real-time updates.
- RESTful API for event and user management
- MongoDB integration for persistent data storage
- Firebase Admin integration for authentication and notifications
- Environment variable management with dotenv
- CORS support for secure cross-origin requests
| Package Name | Usage Description |
|---|---|
| cors | Enables Cross-Origin Resource Sharing for API endpoints |
| dotenv | Loads environment variables from a .env file |
| express | Web framework for building RESTful APIs |
| firebase-admin | Integrates Firebase Admin SDK for authentication and messaging |
| mongodb | MongoDB driver for Node.js to interact with the database |
-
Clone the repository:
git clone https://github.com/asapial/PlayPulse-Server-Side.git cd PlayPulse-Server-Side -
Install dependencies:
npm install
-
Set up environment variables:
- Create a
.envfile in the root directory. - Add your MongoDB and Firebase credentials as shown in
.env.example.
- Create a
-
Start the server:
npm start
Or for development with auto-reload:
npm run dev
-
POST /createEvent
Create a new event (requires authentication). -
PATCH /updateEvent?id=EVENT_ID
Update an existing event (requires authentication). -
DELETE /deleteCreatedEvent?eventId=EVENT_ID
Delete an event by ID (requires authentication). -
GET /showEventData/:event?search=QUERY
Get all events or filter by event type and search term. -
GET /showSixData
Get the first 6 events sorted by date. -
GET /events?id=EVENT_ID&email=USER_EMAIL
Get details of a specific event (requires authentication).
-
GET /checkBooking?uid=USER_ID&eventId=EVENT_ID&email=USER_EMAIL
Check if a user has booked a specific event (requires authentication). -
POST /checkBooking?uid=USER_ID&eventId=EVENT_ID&email=USER_EMAIL&userName=USER_NAME
Book an event for a user (requires authentication). -
DELETE /deleteBookingEvent?uid=USER_ID&eventId=EVENT_ID
Delete a booking for a user and event (requires authentication). -
GET /userBookings?uid=USER_ID
Get all bookings for a user (requires authentication).
-
GET /myEvents?email=USER_EMAIL
Get all events created by the logged-in user (requires authentication). -
GET /myEventsWithBookings?email=USER_EMAIL
Get all events created by the user, including booked users (requires authentication).
For more details on request/response formats, see the code or contact the maintainer.