Skip to content

Latest commit

 

History

History
106 lines (84 loc) · 5.28 KB

File metadata and controls

106 lines (84 loc) · 5.28 KB

Loopin API - Documentation Hub

Loopin is a high-performance backend API built with Java 21 and Spring Boot, designed for discovering interest-based local events, joining event groups, and coordinating with like-minded people through real-time group chat communication.

This directory contains the developer documentation for the Loopin API.


Table of Contents


Core Technology Stack

  • Runtime: Java 21 (LTS)
  • Framework: Spring Boot 4.1.0 (with Web, Data JPA, Security, and Redis)
  • Database: PostgreSQL
  • Schema Management: Liquibase Migrations
  • Rate Limiting: Bucket4j + Lettuce (Redis)
  • Security: JSON Web Tokens (JWT) + Google OAuth integration
  • Containerization: Docker & Docker Compose
  • Performance & Query Optimization: Batch-fetching (left join fetch) for event-interest associations to prevent N+1 query patterns; Spring Cache with Redis provider.

Quick Start Guide

1. Prerequisite Setup

Ensure you have the following installed on your machine:

  • Java Development Kit (JDK) 21
  • Maven 3.9+
  • Docker & Docker Compose
  • PostgreSQL client

2. Configure Environment

Clone the repository and copy the environment template to create your .env file:

cp .env.example .env

Open .env and fill in the required variables (database credentials, JWT secrets, etc.). Refer to Environment Configuration for more details.

3. Spin up Infrastructure

Launch PostgreSQL, Redis, and the API using Docker Compose:

docker compose up --build -d

4. Run Schema Migrations

Liquibase runs pending migrations automatically on application startup. To run migrations manually:

mvn liquibase:update

5. Start the Application

Run the Spring Boot application using the local profile:

mvn spring-boot:run -Dspring-boot.run.profiles=local

The application will start, by default listening on http://localhost:8080/api/v1. The interactive Swagger UI is available at http://localhost:8080/api/swagger-ui.html.


API Testing

API endpoints can be tested using the Bruno API client. The collection is located in /api-tests/bruno, with local and staging example environments. See API Testing With Bruno for setup, authentication workflow, and safe Git hygiene.

  1. Download and install Bruno.
  2. Import the collection folder into Bruno.
  3. Select the Local environment configuration.
  4. Add local-only values for auth_token, google_id_token, and resource IDs.
  5. Execute requests.