No description
  • Java 53.8%
  • TypeScript 27.7%
  • CSS 12.3%
  • Dockerfile 4.9%
  • HTML 1.3%
Find a file
2026-10-08 11:28:32 +05:30
.build Add api service & database migrations 2026-10-08 11:28:32 +05:30
.deploy Add api service & database migrations 2026-10-08 11:28:32 +05:30
backend Add api service & database migrations 2026-10-08 11:28:32 +05:30
docs Add api service & database migrations 2026-10-08 11:28:32 +05:30
frontend Initial commit with base apps & setup 2026-10-08 09:55:12 +05:30
.dockerignore Add build & local compose manifests 2026-10-08 10:20:01 +05:30
.editorconfig Initial commit with base apps & setup 2026-10-08 09:55:12 +05:30
.env.example Add build & local compose manifests 2026-10-08 10:20:01 +05:30
.gitignore Add k8s manifests for deployment 2026-10-08 10:50:27 +05:30
compose.yaml Add api service & database migrations 2026-10-08 11:28:32 +05:30
LICENSE Initial commit with base apps & setup 2026-10-08 09:55:12 +05:30
README.md Add api service & database migrations 2026-10-08 11:28:32 +05:30

SDev Newsfeed

An open-source engineering blog reader: configured company blogs, scheduled discovery, and concise context for choosing what to read.

Current status

Milestones 1–2 initialize the applications and a locally runnable container stack. Milestone 3 adds validated Kubernetes manifests, pending deployment approval. Milestone 4 adds PostgreSQL persistence, seven starter sources, and read-only APIs. The frontend is an application shell with a live API connectivity check. Article ingestion, AI summaries, and Kubernetes deployment follow the review-gated implementation plan.

Stack

  • Java 25 LTS, Spring Boot 4.1.1, Maven Wrapper
  • Lombok for entity accessors and constructor injection (compile-time only)
  • Spring AI 2.0.1 with the OpenAI starter; all models disabled in reader mode
  • React, TypeScript, Vite, Tailwind CSS v4, shadcn/ui
  • shadcn preset b7Vp7tBc8 (Radix Mira, taupe, blue accent, Merriweather)
  • PostgreSQL 18, Spring Data JPA, and Flyway
  • Planned CI: Forgejo Actions

Local Docker Compose

Prerequisite: a running Docker daemon with Docker Compose v2+ and BuildKit. Run from the repository root:

docker compose up --build --detach --wait

This builds the applications from source and starts PostgreSQL, the API, and the Nginx-served frontend, waiting for health checks before starting dependent services. Host Java, Node, and Maven installations are not required for container builds.

Service Local address
Frontend http://localhost:5173
API health http://localhost:8080/api/health
API readiness http://localhost:8080/actuator/health/readiness
PostgreSQL localhost:5432, database/user newsfeed

Open the frontend and select Check API connection. Nginx proxies /api to the backend without a cross-origin request. The frontend also supports SPA fallback, hashed asset caching, and its own /healthz endpoint.

PostgreSQL is provisioned with a named volume. The default password is newsfeed-local, intended for this loopback-only development stack. On startup, Flyway creates the schema and seeds seven engineering blogs; Hibernate validates the schema. Compose supplies the backend's datasource configuration.

Try http://localhost:5173/api/sources to see the configured blogs. The article feed at /api/articles starts empty until ingestion is implemented. See the API and database contract.

All published ports bind to 127.0.0.1. The API/UI run as non-root users with read-only root filesystems and writable temporary mounts. No OpenAI key is passed to either reader service.

Override ports or database settings

Use .env.example as a reference to create an ignored .env at the repository root. Compose reads it automatically. Alternatively, use shell variables:

WEB_PORT=15173 API_PORT=18080 POSTGRES_PORT=15432 docker compose up --build --detach --wait

This is useful when another application occupies a default port. Database initialization variables apply on the first initialization of the volume; changing .env later does not change an existing database user's password.

Logs and shutdown

docker compose ps
docker compose logs --follow backend frontend
docker compose down

down retains database data. To deliberately reset the local database, use docker compose down --volumes (deletes the project's database volume).

Individual image builds

Both Dockerfiles use the repository root as build context:

docker build -f .build/backend.Dockerfile -t sdev-newsfeed-api:local .
docker build -f .build/frontend.Dockerfile -t sdev-newsfeed-web:local .

The backend image build packages with tests skipped because the isolated builder cannot start Testcontainers. Run ./mvnw verify with a Docker daemon before publishing an image; it tests against a disposable PostgreSQL 18 instance. The frontend build runs lint and TypeScript/production build checks. BuildKit caches Maven/npm downloads. The final images contain the JRE/application JAR and Nginx/static assets respectively.

The frontend image accepts runtime API_UPSTREAM (host:port, default backend:8080) and NGINX_RESOLVER (default Docker DNS 127.0.0.11). Nginx renders .build/nginx.conf at startup and refreshes upstream DNS resolution. Kubernetes manifests will set the resolver to cluster DNS. With a read-only root filesystem, /tmp and /etc/nginx/conf.d must be writable; Compose mounts the latter for the image's Nginx UID/GID 101.

Worker execution will be added alongside ingestion in milestone 5, using the backend image; scheduling and worker-only AI credentials follow in later milestones.

Local development with host Java/Node

Prerequisites: Java 25, Node.js 24+ with npm, and PostgreSQL 18. Maven is downloaded by the wrapper on first use. No OpenAI key is needed.

To run only the database through Docker, from the repository root:

docker compose up --detach --wait postgres

In a terminal, from backend/:

./mvnw spring-boot:run

In another terminal, from frontend/:

npm ci
npm run dev

Open http://localhost:5173 and select Check API connection. Vite proxies /api to http://localhost:8080. The check never invokes AI.

Configuration

Variable Default Purpose
PORT 8080 Backend HTTP port
API_PROXY_TARGET http://localhost:8080 Vite development API destination
DATABASE_URL jdbc:postgresql://localhost:5432/newsfeed Native backend database URL
DATABASE_USER newsfeed Native backend database username
DATABASE_PASSWORD newsfeed-local Native backend database password

For example, launch the backend with PORT=8081 ./mvnw spring-boot:run and the frontend with API_PROXY_TARGET=http://localhost:8081 npm run dev. For an alternate database port, set DATABASE_URL accordingly. Spring Boot does not automatically read the root Compose .env; provide native-run variables in your shell. Compose supplies equivalent SPRING_DATASOURCE_* values itself.

OpenAI configuration will be introduced for worker mode in milestone 6. Never place credentials in frontend variables or commit them to the repository.

Health endpoints

  • GET /api/health: application connectivity, { "status": "UP", "service": "newsfeed-api" }
  • GET /actuator/health: operational health
  • GET /actuator/health/liveness and /actuator/health/readiness: probe endpoints

Readiness includes database connectivity; liveness does not. A database outage removes the API from ready endpoints without causing restart loops. /api/health is a lightweight connectivity check, not a database readiness check.

Only Actuator health is exposed. The development proxy forwards /api, not Actuator.

Checks

From backend/:

./mvnw verify

Tests require Docker and use disposable databases, not your Compose database.

From frontend/:

npm run lint
npm run typecheck
npm run build

Run the packaged backend with:

java -jar backend/target/newsfeed-api-0.0.1-SNAPSHOT.jar

The Vite development proxy applies to npm run dev; container API routing uses Nginx, and Kubernetes routing will use Traefik.

Repository conventions

  • backend/: API and future ingestion worker
  • frontend/: reader application
  • .build/: Dockerfiles and container configuration
  • compose.yaml: local frontend/API/PostgreSQL container stack
  • .deploy/: Kubernetes/Kustomize base and production overlay
  • .forgejo/workflows/: CI workflows (milestone 8)

Kubernetes

The production Kustomize overlay is under .deploy/overlays/production, targeting namespace newsfeed and Traefik host newsfeed.srrdevcloud.in. Deployment image repositories and optional private-registry credentials are configured in a git-ignored .deploy/overlays/local/ overlay; the committed manifests use logical image keys, not private repository paths.

kubectl kustomize .deploy/overlays/production

See deployment instructions and cluster findings and the separate Metrics Server prerequisite plan. Manifests have passed server dry-run validation; deployment is awaiting review.

License

MIT — Copyright © 2026 Sai Rohith Reddy Vangala.