Skip to content

asapial/PlayPulse-Server-Side

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PlayPulseServer

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.

Purpose

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.

Key Features

  • 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

NPM Packages Used

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

Installation

  1. Clone the repository:

    git clone https://github.com/asapial/PlayPulse-Server-Side.git
    cd PlayPulse-Server-Side
  2. Install dependencies:

    npm install
  3. Set up environment variables:

    • Create a .env file in the root directory.
    • Add your MongoDB and Firebase credentials as shown in .env.example.
  4. Start the server:

    npm start

    Or for development with auto-reload:

    npm run dev

API Endpoints

Event APIs

  • 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).

Booking APIs

  • 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).

User Event APIs

  • 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.

About

PlayPulseServer is a backend server for managing events and user data, built with Node.js and Express.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors