Skip to content

scaleracademy/twitter-backend-java

Moo: Twitter Clone Backend

Master CI PR Checker License: AGPL v3

A robust, high-performance Twitter clone backend built with the latest industry standards.

🚀 Modern Tech Stack

For a detailed breakdown of our architectural choices, visit our Technology Selection wiki page.

  • Java 21 (Microsoft Build of OpenJDK)
  • Spring Boot 4.0 (Spring Framework 7.0)
  • Jakarta EE 11 (Jakarta Persistence & Servlet APIs)
  • Virtual Threads (Project Loom) enabled for massive concurrency.
  • JWT-based Security via Spring Security 7.0.
  • Spring Data JPA with MySQL/H2 support.
  • OpenTelemetry for native observability.
  • Springdoc OpenAPI 3 for Swagger documentation.

🛠️ Getting Started

Prerequisites

  • JDK 21+
  • Maven 3.9+
  • Docker & Docker Compose (optional)

Quick Start

Choose the setup that fits your workflow. For more details, see our Installation Guide.

Option A: Zero-Installation (Full Stack)

Ideal for testing or a quick look. Runs everything in Docker.

  1. cp .env.example .env
  2. docker compose up -d
  3. API: http://localhost:8082 | DB Admin: http://localhost:8083

Option B: Native Development (Dependencies Only)

Ideal for coding. Runs DB in Docker, App in your IDE/CLI.

  1. cp .env.example .env
  2. docker compose -f docker-compose.dev.yml up -d
  3. Configure your IDE using our IDE Instructions.
  4. Run the "Moo API" configuration in IntelliJ IDEA, or use: ./mvnw spring-boot:run -Dspring-boot.run.profiles=dev
  5. API: http://localhost:8080 | DB Admin: http://localhost:8083

For advanced configuration, visit Project Configuration.

📖 API Documentation

Access the Interactive Swagger UI at: 👉 http://localhost:8082/swagger-ui/index.html

Comprehensive endpoint details and data contracts are available at:

🏗️ Architecture & Best Practices

  • Scalable Pagination: All list endpoints use Pageable. See our Entity Design.
  • Distroless Containers: Secure, minimal runtime environment.
  • Multi-Arch Support: Images optimized for amd64 and arm64.
  • Zero-Qualified Names: The codebase strictly uses imports.
  • Null Safety: Integrated JSpecify annotations.

🤖 CI/CD Pipeline

Our pipeline is optimized for robust speed and reliability. Learn more about how we maintain quality in Collaboration and Static Analysis.

  • PR Checker: Cross-platform linting and multi-arch smoke builds.
  • Master CI: Artifact archival, CodeQL scanning, and official distribution.

🤝 Contributing

We welcome contributions! Please see our Contributing Guidelines and the following wiki sections:

For our future vision, check the Roadmap.

📜 License

This project is licensed under the GNU Affero General Public License v3.0. See LICENSE for details.

Packages

 
 
 

Contributors