Skip to content

jomeerkatz/content-calender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“˜ README.md β€” Content Calendar API (Spring Boot 3)

πŸš€ Project Summary

The Content Calendar API is a full Spring Boot 3 backend application built as part of my advanced learning path. This project demonstrates how to build, structure, deploy, and operate a real-world Spring Boot service β€” from local development with H2 to a fully deployed PostgreSQL-backed service on Railway.

I built this project to:

  • Refresh and deepen my Spring Boot knowledge (especially SB3 changes)
  • Strengthen my Java backend portfolio for job applications
  • Learn modern deployment workflows (Docker β†’ Railway)
  • Understand environment configurations (dev vs prod)
  • Build a real API that is accessible online

🧩 Why This Project Exists

Backend engineering involves much more than writing endpoints. This project shows full-stack backend competency:

  • Building REST APIs the Spring way
  • Managing two databases (H2 for dev, PostgreSQL for prod)
  • Working with Docker containers
  • Using profiles for environment-specific behavior
  • Deploying production-ready apps using Railway
  • Handling sensitive configuration with environment variables
  • Debugging DB schema & connection issues in real deployment environments

It demonstrates the skills companies expect from a Junior β†’ Mid Java Backend Developer.


🧠 What Problem This Project Solves

This project is a teaching and demonstration tool. It solves the questions every beginner backend engineer faces:

  • How do I build a Spring Boot 3 REST API?
  • How do I work with PostgreSQL and H2?
  • How do I configure Docker + containers?
  • How do I switch between dev and prod environments?
  • How do I deploy a Java backend to Railway?
  • How do I manage environment variables safely?
  • How do I structure a real backend application cleanly?

πŸ”₯ Tech Stack

Layer Technology
Language Java 17
Framework Spring Boot 3
Web Spring MVC
Persistence Spring Data JPA
Local DB H2 (in-memory)
Production DB PostgreSQL
Deployment Railway
Container Docker / Docker Compose
Monitoring Spring Boot Actuator
Build Tool Maven
Version Control GitHub

πŸ—οΈ Architecture Overview

                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚         Frontend (optional)   β”‚
                β”‚  React / Next.js / Vue        β”‚
                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚ HTTP/JSON
                                β–Ό
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚    Spring Boot API     β”‚
                    β”‚  Controllers (MVC)     β”‚
                    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
                    β”‚   Service Layer        β”‚
                    β”‚  Business Logic        β”‚
                    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
                    β”‚ Repository Layer (JPA) β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                   β”‚
                        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                        β”‚                       β”‚
                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                 β”‚  H2 (Dev)    β”‚      β”‚ PostgreSQL Prod β”‚
                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ§ͺ Screenshots

πŸ“Œ Railway Deployment Screenshot

Screenshot 2025-11-22 at 6 11 39β€―PM

🐳 Docker Container Screenshot

Screenshot 2025-11-22 at 6 13 45β€―PM Screenshot 2025-11-22 at 6 14 28β€―PM Screenshot 2025-11-22 at 6 14 43β€―PM

πŸ“‘ API Response Screenshot (Postman / Thunder Client)

image image Screenshot 2025-11-22 at 6 17 39β€―PM

βš™οΈ Quick Start (TL;DR)

πŸ–₯️ Local Development (H2)

This uses the development profile and H2 in-memory DB.

git clone <YOUR_GITHUB_REPO_LINK>
cd content-calendar
./mvnw spring-boot:run

Access H2 console (dev only):

http://localhost:8080/h2-console

🐳 Local with Docker + PostgreSQL

docker compose up -d
SPRING_PROFILES_ACTIVE=prod ./mvnw spring-boot:run

☁️ Production Deployment (Railway)

Steps:

  1. Push code to GitHub

  2. Connect Railway β†’ New Service β†’ Deploy from Repo

  3. Add environment variables:

    • SPRING_DATASOURCE_URL
    • SPRING_DATASOURCE_USERNAME
    • SPRING_DATASOURCE_PASSWORD
  4. Deploy Docker image

  5. Railway auto-creates PostgreSQL DB

  6. Run health checks via Actuator

  7. The API becomes public


πŸ“š API Examples

POST β€” Create Content

POST /api/content
Content-Type: application/json
{
  "title": "First Content",
  "description": "Learning Spring Boot",
  "status": "IDEA",
  "contentType": "VIDEO"
}

GET β€” Get All Content

GET /api/content

Example Response

[
  {
    "id": 1,
    "title": "First Content",
    "description": "Learning Spring Boot",
    "status": "PUBLISHED",
    "contentType": "ARTICLE"
  }
]

πŸ› οΈ Technical Decisions

βœ” H2 for Development

  • Instant startup
  • No external dependencies
  • Perfect for fast testing

βœ” PostgreSQL for Production

  • Durable / reliable

  • Cloud compatible

  • Supports real-world scaling needs

βœ” Environment Profiles

  • dev β†’ H2, debug logs
  • prod β†’ PostgreSQL, env variables, no dev tools

βœ” Docker & Compose

  • Standardized environment
  • Same config everywhere
  • Railway supports Docker natively

βœ” Actuator

  • Health checks
  • Metrics
  • Info endpoints

🧩 Challenges & How I Solved Them

🧱 1. Docker Deployment

Railway requires correct env variable mapping + working Dockerfile. Solved via standardized Dockerfile + Railway environment config.

πŸ”‘ 2. Sensitive Data Management

Learned to avoid hardcoded DB credentials. Used environment variables everywhere.

πŸ”„ 3. Switching Between H2 and PostgreSQL

Implemented profile-based config:

  • application-dev.yml
  • application-prod.yml

πŸ—„οΈ 4. Initial Schema & Sample Data

Railway calls schema at startup β€” needed to ensure proper migrations per profile.


🧠 What I Learned

  • Spring Boot 3 fundamentals (MVC, JPA, Actuator)
  • Dependency Injection, IoC, Spring Context
  • REST API structure & layering
  • PostgreSQL & H2 configuration
  • Docker images, containers, Compose
  • Railway deployment pipeline
  • Working with profiles & env variables
  • Diagnosing real production failures

This project made me more confident as a backend developer.


πŸ‘€ Author

Jo β€” Java Backend Developer Building production-ready backend services with Spring Boot.


About

Production-ready Content Calendar API built with Spring Boot 3, featuring a clean REST architecture, full CRUD functionality, JDBC/JPA persistence, Dockerized deployment, environment-based configuration, and both H2 (dev) and PostgreSQL (prod) support. Created as a real-world backend project to strengthen my Java/Spring portfolio and demonstrate pr

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages