Skip to content

Latest commit

Β 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

EventApp - Spring Boot Event Management System

A comprehensive event and venue management REST API built with Spring Boot, following hexagonal architecture principles and modern development practices.

πŸ“‹ Project Overview

EventApp is a microservices-ready application that manages events and venues with full CRUD operations, advanced JPA relationships, database migrations, and JWT-based security.

Key Features

  • βœ… RESTful API for Events and Venues management
  • βœ… Hexagonal Architecture (Ports & Adapters pattern)
  • βœ… JPA/Hibernate with PostgreSQL persistence
  • βœ… Flyway database migrations
  • βœ… Advanced Relations (OneToMany/ManyToOne between Venues and Events)
  • βœ… JWT Authentication with Spring Security 6+
  • βœ… RFC 7807 Error Handling (ProblemDetail)
  • βœ… Soft Delete support for all entities
  • βœ… Bean Validation for request DTOs
  • βœ… OpenAPI/Swagger documentation
  • βœ… Docker support with Docker Compose

πŸ—οΈ Architecture

This project follows Hexagonal Architecture (Clean Architecture):

src/main/java/com/codeup/eventapp/
β”œβ”€β”€ domain/                    # Business logic (core)
β”‚   β”œβ”€β”€ model/                # Domain entities
β”‚   β”œβ”€β”€ ports/in/             # Input ports (use cases)
β”‚   └── ports/out/            # Output ports (repository interfaces)
β”œβ”€β”€ application/              # Use case implementations
β”‚   └── usecases/
β”œβ”€β”€ infrastructure/           # External adapters
β”‚   β”œβ”€β”€ adapters/            # Repository implementations
β”‚   β”œβ”€β”€ controllers/         # REST controllers
β”‚   β”œβ”€β”€ entities/            # JPA entities
β”‚   β”œβ”€β”€ security/            # JWT & Security config
β”‚   └── web/                 # DTOs, mappers, exception handlers

πŸš€ Getting Started

Prerequisites

  • Java 17+
  • Maven 3.8+
  • Docker & Docker Compose
  • PostgreSQL 15+ (or use Docker)

Installation

  1. Clone the repository

    git clone https://github.com/TonyS-dev/eventapp-spb.git
    cd eventapp-spb
  2. Start PostgreSQL with Docker

    docker-compose up -d
  3. Run the application

    ./mvnw spring-boot:run

The API will be available at http://localhost:8080

Environment Variables

Configure the following in application.properties or via environment:

# Database
spring.datasource.url=jdbc:postgresql://localhost:5432/eventapp
spring.datasource.username=postgres
spring.datasource.password=postgres

# Flyway
spring.flyway.enabled=true

# Server
server.port=8080

πŸ“š API Documentation

Swagger UI

Access interactive API documentation at:

http://localhost:8080/swagger-ui.html

Authentication

Login (Mock credentials for demo):

POST /auth/login
Content-Type: application/json

{
  "username": "admin",
  "password": "admin"
}

Response:

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}

Use the token in subsequent requests:

Authorization: Bearer <token>

Venues API

Method Endpoint Description
GET /api/venues List all venues
GET /api/venues/{id} Get venue by ID
POST /api/venues Create new venue
PUT /api/venues/{id} Update venue
DELETE /api/venues/{id} Soft delete venue
GET /api/venues/deleted List deleted venues
PUT /api/venues/{id}/restore Restore deleted venue

Events API

Method Endpoint Description
GET /api/events List all events
GET /api/events/{id} Get event by ID
POST /api/events Create new event
PUT /api/events/{id} Update event
DELETE /api/events/{id} Soft delete event
GET /api/events/deleted List deleted events
PUT /api/events/{id}/restore Restore deleted event

Example: Create Venue

POST /api/venues
Authorization: Bearer <token>
Content-Type: application/json

{
  "name": "Madison Square Garden",
  "address": "4 Pennsylvania Plaza, New York, NY 10001",
  "capacity": 20000
}

Example: Create Event

POST /api/events
Authorization: Bearer <token>
Content-Type: application/json

{
  "name": "Spring Boot Conference 2025",
  "location": "New York",
  "date": "2025-06-15T09:00:00",
  "description": "Annual Spring Boot developer conference",
  "venueId": 1
}

πŸ—„οΈ Database Schema

Venues Table

CREATE TABLE venues (
    id BIGSERIAL PRIMARY KEY,
    name VARCHAR(255) NOT NULL,
    address VARCHAR(255) NOT NULL,
    capacity INTEGER NOT NULL,
    deleted BOOLEAN DEFAULT FALSE
);

Events Table

CREATE TABLE events (
    id BIGSERIAL PRIMARY KEY,
    name VARCHAR(255) NOT NULL UNIQUE,
    location VARCHAR(255),
    date TIMESTAMP,
    description VARCHAR(1000),
    venue_id BIGINT REFERENCES venues(id),
    deleted BOOLEAN DEFAULT FALSE
);

πŸ”§ Development

Running Tests

./mvnw test

Building for Production

./mvnw clean package
java -jar target/eventapp-0.0.1-SNAPSHOT.jar

Docker Build

docker build -t eventapp:latest .
docker run -p 8080:8080 eventapp:latest

πŸ“¦ Tech Stack

  • Framework: Spring Boot 3.4.0
  • Language: Java 17
  • Database: PostgreSQL 15
  • ORM: Hibernate/JPA
  • Migration: Flyway
  • Security: Spring Security 6 + JWT
  • Validation: Jakarta Bean Validation
  • Documentation: SpringDoc OpenAPI 3
  • Build Tool: Maven
  • Containerization: Docker

🌿 Git Workflow

This project follows Gitflow with 5 User Stories:

  • main - Production-ready code
  • develop - Integration branch
  • feat/User-Story-1 - In-Memory Catalog (Oct 30, 2025)
  • feat/User-Story-2 - JPA Persistence (Nov 7, 2025)
  • feat/User-Story-3 - Hexagonal Architecture (Nov 14, 2025)
  • feat/User-Story-4 - Relations & Flyway (Nov 21, 2025)
  • feat/User-Story-5 - Security & JWT (Dec 5, 2025)

πŸ“„ License

This project is licensed under the MIT License.

πŸ‘€ Author

Tony S

🀝 Contributing

Contributions, issues, and feature requests are welcome!


Built with ❀️ using Spring Boot

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages