Case study 03Full Stack · Java & Angular2025–2026

Newgram

Full stack social network with layered backend, OpenAPI contract and AWS S3

Role
Author (Backend + Frontend)
Backend
Java 21 · Spring Boot 3.5
Frontend
Angular 19 · OpenAPI client
Status
Open-source with live demo
JH / PROOF 03Newgram
Newgram main feed displaying posts, interactions and suggested creators panel
Newgram feed consuming a typed OpenAPI client with presigned S3 media delivery and profile suggestions.

01 Problem & context

Newgram was built to move past basic CRUD examples and model a realistic social domain with production-oriented security, cloud media handling and versioned database migrations.

It connects a layered Spring Boot backend to an Angular frontend whose HTTP client is generated directly from the OpenAPI 3 specification, keeping API contracts synchronized automatically.

02 System architecture

Four-layer Spring Boot backend (presentation, application, core.domain, infrastructure) isolating domain rules from HTTP transport, JWT security, PostgreSQL and S3 storage.

Angular 19 UIng-openapi-gen · RxJSSpring Boot 3.5 (Java 21)presentation → applicationcore.domain → infrastructureJWT 15m + rotating refresh 7dPostgreSQL + FlywayVersioned schema · HikariCPAWS S3 StoragePresigned URLs (60m expiry)

03 Technical decisions & trade-offs

JWT authentication with refresh token rotation

Short-lived access tokens (15 min) paired with 7-day rotating refresh tokens that reject token reuse, backed by dedicated automated tests for the refresh lifecycle.

Media delivery via AWS S3 presigned URLs

Avoids exposing public buckets or proxying binary streams through the API, using configurable 60-minute expiration and S3-compatible local testing via MinIO.

OpenAPI-generated frontend client

Generating Angular services via ng-openapi-gen from springdoc-openapi enforces compile-time type safety between Java DTOs and UI components.

Controlled schema evolution & lean container build

Flyway-managed PostgreSQL migrations, tuned HikariCP and JPA batch inserts, packaged with a multi-stage Docker build (Maven → Temurin JRE Alpine).

04 Domain scope

  • Discovery feeds across followed accounts, popular, trending, recommended and location-based views.
  • Media posts, likes, comments, hashtags, archiving and named saved collections.
  • Expiring stories and profile highlights, follower graph with mutual-follow suggestions and interaction notifications.
  • Paginated post and user search alongside interactive Swagger UI documentation.

Tech stack

  • Java 21
  • Spring Boot 3.5
  • Spring Security
  • Angular 19
  • TypeScript
  • RxJS
  • PostgreSQL
  • Flyway
  • JWT
  • AWS S3
  • OpenAPI
  • Docker