Newgram
Full stack social network with layered backend, OpenAPI contract and AWS S3
- Author (Backend + Frontend)
- Java 21 · Spring Boot 3.5
- Angular 19 · OpenAPI client
- Open-source with live demo

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.
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.