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.
- Installation
- Technologies Used
- Environment Variables
- Database Setup
- Running the Application
- Endpoints
- Deployment
- Testing
- Contributing
- License
To get started, follow the instructions below to set up the backend locally:
-
Clone the repository:
git clone https://github.com/concertmate/concermate_be.git cd concermate_be
-
Set up a virtual environment:
python3 -m venv venv source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
- Django: The web framework used to build the backend of ConcertMate.
- SQLite: The lightweight database used for local development.
Apply Migrations:
python manage.py migrate
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/
.
- Endpoint:
api/users/:user_id/events/create
- Method:
POST
- Description: Create new event for a user.
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"
}
{
"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"
}
}
- Endpoint:
api/users/:user_id/events/:event_id/join
- Method:
POST
- Description: User to join an event.
POST api/users/1/events/2/join
{
"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"
}
}
- Endpoint:
api/events/:event_id/attendees
- Method:
GET
- Description: Get all users attending specific event.
GET api/events/2/attendees
{
"data": [
{
"user_id": 3,
"username": "usernamegood",
"email": "[email protected]"
}
]
}
- Endpoint:
api/users/:user_id/events/:event_id/leave
- Method:
POST
- Description: Leave event.
POST api/users/1/events/2/leave
{'message': 'User has left the event'}
- Endpoint:
/api/users/:user_id/events
- Method:
GET
- Description: Retrieves a list of the user's events.
GET /api/users/1/events
{
"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"
}
]
}
- Endpoint:
api/users/:user_id/events/:event_id
- Method:
GET
- Description: Retrieves one user event.
GET api/users/1/events/2
{
"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"
}
}
- Endpoint:
api/users/create
- Method:
POST
- Description: Create new user.
POST api/users/create
{
"username": "usernamegood",
"password": "strongpassword",
"email": "[email protected]"
}
{
"data": {
"user_id": 4,
"username": "usernamegood",
"email": "[email protected]"
}
}
To run the test suite, simply use:
python manage.py test