Skip to content
Back

ForumAPI

Discussion forum REST API, built test-first with Clean Architecture.

ForumAPI screenshot

My role

Solo developer: architecture, database, tests and CI/CD.

Problem

Practise building a production-shaped API: clear layers, tests first, and deploys without manual steps.

Decisions

  1. 1.Clean Architecture with domain, use case, infrastructure and interface layers, wired by DI.
  2. 2.Soft delete that masks deleted comments and replies in thread detail.
  3. 3.One like per user, enforced by a UNIQUE constraint in PostgreSQL.
  4. 4.CI runs Jest against a Postgres service; CD deploys to EC2 over SSH with PM2.

Outcome

11 use cases and 49 test suites, deployed automatically on push to main.

Write-up

A Reddit/StackOverflow-style REST API for a discussion forum: user registration, JWT login with access and refresh tokens, threads, comments, replies and comment likes. Thread detail returns nested comments, replies and like counts, and deleted comments and replies are masked instead of removed. The code follows Clean Architecture (domain, use cases, infrastructure, interfaces) wired with dependency injection, and every layer is covered by Jest tests. Swagger UI documents the endpoints. Built for the Dicoding Back-End Developer Expert with JavaScript course.