Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

109 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Roller Skate Event API

Project Context

A simple RESTful API that lets you add, update and look up roller skate events happening all over the UK. With the increasing popularity of roller skating and growing community groups, this service was created to help centralise event information so anyone can quickly find out what’s on, grab the details they need and reduce the number of “Does anyone know…?” type questions I often see in group chats.

Phase 1 focuses on bringing together skate event details for three core event types:

  • Family - events specifically designed for adults and children
  • Party - party-style events which have a scheduled DJ playing
  • Workshop - learning sessions with instructors

An abstract SkateEvent superclass holds common fields (such as eventName, startDateTime, endDateTime etc.) inherited by all concrete subclasses; Family, Party and Workshop. Each subclass adds fields that are unique to that event type. A joined inheritance strategy has been adopted as it brings the benefit of data consistency, allows for polymorphic queries and allows for the addition of more skate event types in future releases.

skate event ERD

About The Project

Built With

  • Java
  • Spring Boot
  • Maven
  • MySQL

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

Before you begin, make sure you have the following installed:

  1. JDK 21 (or higher)
  2. MySQL

Installation

Clone the repository

  1. Clone the repository:
git clone https://github.com/codebygrace/skate-event-api.git
  1. Navigate to the project directory:
cd skate-event-api

Database Configuration

A database dump file named events_dump_20250830.sql is located in the database directory. Follow the steps below to import it into the database used by the API.

  1. In the skate-event-api directory execute the following command to import the database:
mysql -u [username] -p < database/events_dump_20250830.sql

Note: If your MySQL user doesn't have a password set, omit the -p flag. Replace [username] with your MySQL username.

  1. Create a new file at skate-event-api/src/main/resources/local.properties and paste in the following:
spring.datasource.url=jdbc:mysql://localhost:3306/skateevents

# Replace "root" with your database user, if applicable
spring.datasource.username=root

# Specify your database user's password, if applicable. If your database user doesn't have a password set, delete the line below
spring.datasource.password=YOUR_MYSQL_PASSWORD
  1. Replace the username and password values with your MySQL credentials. IMPORTANT: Ensure there are no spaces before or after the password.

Run application

  1. To start the API, run the following command from the root project directory:
mvn spring-boot:run

Accessing the API Endpoints

Available Endpoints

Method Endpoint Description
GET /api/v1/skate-events Retrieve a list of (optionally filtered) skate events.
Events can be filtered by event type, start date time and city
GET /api/v1/skate-events/{id} Retrieve a specific skate event by its ID
POST /api/v1/skate-events Create a new skate event
PUT /api/v1/skate-events/{id} Update an existing skate event by ID
DELETE /api/v1/skate-events/{id} Delete a skate event by ID

Use Postman Collection

Click the button below to view request examples and run tests in Postman

Run In Postman

Use .http Test File

Alternatively, use the skateevent.http file along with a VS Code extension such as REST Client by Huachao Mao to quickly and efficiently test API endpoints.

The skateevent.http file can be found locally at src/test/resources/skateventapi.http

Documentation

Project User Stories

🔗 Skate Events API Project Overview

API Documentation

To view full Swagger API documentation:

  1. Start the application
mvn spring-boot:run
  1. Navigate to http://localhost:8080/swagger-ui/index.html

Javadoc

  1. In the skate-event-api directory execute the following command to generate the Javadoc:
mvn javadoc:javadoc
  1. Once build is complete, navigate to target/reports/apidocs which contains the generated HTML documentation
 cd target/reports/apidocs
  1. Open the index.html file in a web browser to view the documentation

Unit Tests

To run unit tests, run the following command from the root project directory:

mvn clean test

Full Project Inventory

The skateeventapi package is organised in a package-by-feature manner which enhances modularity.

└── 📁skate-event-api
    └── 📁database
        ├── events_dump_20250830.sql
    └── 📁docs
        ├── skate-event-erd.png      
    └── 📁src
        └── 📁main
            └── 📁java
                └── 📁com
                    └── 📁codebygrace
                        └── 📁skateeventapi
                            └── 📁common
                                └── 📁exception
                                    ├── GlobalExceptionHandler.java
                                ├── Result.java
                            └── 📁config
                                ├── OpenAPIConfiguration.java
                            └── 📁skateevents
                                ├── Family.java
                                ├── Party.java
                                ├── SkateEvent.java
                                ├── SkateEventController.java
                                ├── SkateEventNotFoundException.java
                                ├── SkateEventRepository.java
                                ├── SkateEventService.java
                                ├── SkateEventType.java
                                ├── Workshop.java
                            ├── App.java
            └── 📁resources
                └── 📁static
                └── 📁templates
                ├── application.properties
        └── 📁test
            └── 📁java
                └── 📁com
                    └── 📁codebygrace
                        └── 📁skateeventapi
                            └── 📁skateevents
                                ├── SkateEventControllerTest.java
                                ├── SkateEventServiceTest.java
            └── 📁resources
                ├── skateventapi.http
    └── 📁target
    ├── HELP.md
    ├── mvnw
    ├── mvnw.cmd
    ├── pom.xml
    └── README.md

Roadmap

  • Add dynamic filtering to allow for more parameters
  • Add a PATCH method to support partial event updates
  • Prevent duplicate events from being created
  • Add Authentication
  • Integrate with Google Calendar API to create and manage events

Acknowledgments

A few resources that I found particularly helpful

About

A RESTful Skate Event API using Spring Boot

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages