banner
BGIcon

Overview

A production-style content management system built on a Java / Spring Boot backend with an Angular front end. What makes it interesting architecturally is that it deliberately runs two databases at once — a relational SQL store and MongoDB — using each for what it does best. Structured, relational, transaction-heavy data (user accounts, roles and permissions, workflow state, and audit logs) lives in SQL where foreign keys, ACID guarantees, and joins matter. Free-form content (pages, blog posts, rich-text bodies, and media metadata) lives in MongoDB, where a flexible document schema lets editors add fields and content types without a migration. Both are exposed through a single, secured REST API so the front end never has to know which database an entity came from.

Technologies

  • - Java 17
  • - Spring Boot
  • - Spring Data JPA + Spring Data MongoDB
  • - PostgreSQL / MySQL
  • - MongoDB
  • - Spring Security + JWT
  • - Angular
  • - Docker
BGIcon

Why SQL + MongoDB Together

The core insight is polyglot persistence: a CMS has two very different shapes of data living inside it. Identity and authorization data is highly relational and must be consistent — a user belongs to roles, roles grant permissions, every privileged action is audited. That is a textbook fit for a relational database with foreign keys and transactions.

Content, on the other hand, is irregular and constantly evolving — a landing page, a blog post, and a product entry share almost no fields. Forcing that into rigid SQL tables means endless migrations and sparse columns. MongoDB stores each content type as a document, so editors can introduce new content models without touching the schema.

Spring Data made the two stores feel like one: JpaRepository for the relational side, MongoRepository for the document side, both injected into the same service layer. A write that spans both (e.g. publishing a post and writing an audit record) is coordinated in the service tier so the system stays consistent.

Architecture & Key Features

  • - Layered Spring Boot backend: Controller → Service → dual Repository layer
  • - JWT-based auth with role/permission checks via Spring Security
  • - Relational store: users, roles, permissions, audit log, workflow state
  • - Document store: pages, posts, rich-text content, media metadata
  • - Single unified REST API across both data sources
  • - Draft → review → publish content workflow
  • - Full audit trail of every privileged action
  • - Dockerized SQL + MongoDB + app for one-command local setup
BG
Icon
  • Year

    2024

  • Type

    Full-Stack Project

  • Role

    Java Full-Stack Developer

Contribution

Designed the polyglot persistence layer — modeling which entities belong in SQL versus MongoDB — and built the Spring Data repositories and service layer that unify them behind one API.

Implemented authentication and authorization with Spring Security and JWT, including the relational role/permission model and a complete audit log of privileged actions.

Built the content workflow (draft → review → publish) on the MongoDB side and wired the Angular front end to the unified REST API, then containerized the full stack with Docker for reproducible setup.