Skip to content

concertmate/concermate_be

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ConcertMate Backend (concermate_be)

Welcome to the backend repository of ConcertMate, an app designed to help users find upcoming concerts, and invite friends to go to concerts together. This backend is built with Python and Django, providing the API and logic that powers the ConcertMate app.

Table of Contents

Installation

To get started, follow the instructions below to set up the backend locally:

  1. Clone the repository:

    git clone https://github.com/concertmate/concermate_be.git
    cd concermate_be
  2. Set up a virtual environment:

    python3 -m venv venv
    source venv/bin/activate
  3. Install dependencies:

    pip install -r requirements.txt

Technologies Used

  • Django: The web framework used to build the backend of ConcertMate.
  • SQLite: The lightweight database used for local development.

Database Setup

Apply Migrations:

python manage.py migrate

Running the Application

To run the server locally, execute the following command:

python manage.py runserver

This will start the backend server at http://127.0.0.1:8000/.

Endpoints

1. Create Event

  • Endpoint: api/users/:user_id/events/create
  • Method: POST
  • Description: Create new event for a user.

Example Request:

POST api/users/1/events/create

{
    "event_name": "Bluegrass Week",
    "venue_name": "San Antonio Fair",
    "date_time": "2024-12-31T20:00:00Z",
    "artist": "Marty Robbins",
    "location": "San Antonio, TX",
    "spotify_artist_id": "2341",
    "ticketmaster_event_id": "921"
}

Example Response:

{
    "data": {
        "event_id": 3,
        "event_name": "Bluegrass Week",
        "venue_name": "San Antonio Fair",
        "date_time": "2024-12-31T20:00:00Z",
        "artist": "Marty Robbins",
        "location": "San Antonio, TX",
        "spotify_artist_id": "2341",
        "ticketmaster_event_id": "921",
        "owner": "newuser"
    }
}

2. User Join Event

  • Endpoint: api/users/:user_id/events/:event_id/join
  • Method: POST
  • Description: User to join an event.

Example Request:

POST api/users/1/events/2/join

Example Response:

{
    "data": {
        "event_id": 2,
        "event_name": "Bluegrass Week",
        "venue_name": "San Antonio Fair",
        "date_time": "2024-12-31T20:00:00Z",
        "artist": "Marty Robbins",
        "location": "San Antonio, TX",
        "spotify_artist_id": "2341",
        "ticketmaster_event_id": "921",
        "owner": "newuser"
    }
}

3. All Users Attending Event

  • Endpoint: api/events/:event_id/attendees
  • Method: GET
  • Description: Get all users attending specific event.

Example Request:

GET api/events/2/attendees

Example Response:

{
    "data": [
    {
        "user_id": 3,
        "username": "usernamegood",
        "email": "[email protected]"
    }
  ]
}

4. User Leave Event

  • Endpoint: api/users/:user_id/events/:event_id/leave
  • Method: POST
  • Description: Leave event.

Example Request:

POST api/users/1/events/2/leave

Example Response:

{'message': 'User has left the event'}

5. Get All User's Events

  • Endpoint: /api/users/:user_id/events
  • Method: GET
  • Description: Retrieves a list of the user's events.

Example Request:

GET /api/users/1/events

Example Response:

{
    "events": [
        {
            "event_id": 3,
            "event_name": "Bluegrass Week",
            "venue_name": "San Antonio Fair",
            "date_time": "2024-12-31T20:00:00Z",
            "artist": "Marty Robbins",
            "location": "San Antonio, TX",
            "spotify_artist_id": "2341",
            "ticketmaster_event_id": "921",
            "owner": "newuser"
        }
    ]
}

6. Get One User Event

  • Endpoint: api/users/:user_id/events/:event_id
  • Method: GET
  • Description: Retrieves one user event.

Example Request:

GET api/users/1/events/2

Example Response:

{
    "data": {
        "event_id": 2,
        "event_name": "Bluegrass Week",
        "venue_name": "San Antonio Fair",
        "date_time": "2024-12-31T20:00:00Z",
        "artist": "Marty Robbins",
        "location": "San Antonio, TX",
        "spotify_artist_id": "2341",
        "ticketmaster_event_id": "921",
        "owner": "newuser"
    }
}

7. Create User

  • Endpoint: api/users/create
  • Method: POST
  • Description: Create new user.

Example Request:

POST api/users/create

{
    "username": "usernamegood",
    "password": "strongpassword",
    "email": "[email protected]"
}

Example Response:

{
    "data": {
        "user_id": 4,
        "username": "usernamegood",
        "email": "[email protected]"
    }
}

Testing

To run the test suite, simply use:

python manage.py test

Contributors

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •