|
| 1 | +# CloudMedia Backend |
| 2 | + |
| 3 | +CloudMedia is a backend-first, service-oriented platform for user-generated media (YouTube-style MVP). |
| 4 | + |
| 5 | +Current implementation is centered on Java Spring Boot domain services, with infrastructure and API contracts already in place for broader multi-language expansion. |
| 6 | + |
| 7 | +## What is in this repo |
| 8 | + |
| 9 | +- Java microservices for identity, content, social, policy, and discovery |
| 10 | +- Local development infrastructure via Docker Compose (Postgres, Kafka, Redis) |
| 11 | +- REST API contract and backend implementation planning docs |
| 12 | +- CI with Markdown linting, Java quality gates, and identity-service test coverage checks |
| 13 | + |
| 14 | +## Services (current) |
| 15 | + |
| 16 | +Java services under `services/java`: |
| 17 | + |
| 18 | +- `identity-service` (`:8081`) - auth/session/token flows |
| 19 | +- `content-service` (`:8082`) - content metadata and playback gating |
| 20 | +- `social-service` (`:8083`) - follows/comments/playlists |
| 21 | +- `policy-service` (`:8084`) - moderation + age/geo policy evaluation |
| 22 | +- `discovery-service` (`:8085`) - search and home feed filtering/ranking |
| 23 | + |
| 24 | +## Prerequisites |
| 25 | + |
| 26 | +- Java 21+ |
| 27 | +- Maven 3.9+ |
| 28 | +- Docker + Docker Compose |
| 29 | + |
| 30 | +## Quick start |
| 31 | + |
| 32 | +1. Start local infrastructure: |
| 33 | + |
| 34 | +```bash |
| 35 | +make dev-up |
| 36 | +``` |
| 37 | + |
| 38 | +This starts: |
| 39 | + |
| 40 | +- Postgres on `localhost:5432` |
| 41 | +- Kafka on `localhost:9092` |
| 42 | +- Redis on `localhost:6379` |
| 43 | + |
| 44 | +1. Run a service (example: identity-service): |
| 45 | + |
| 46 | +```bash |
| 47 | +cd services/java |
| 48 | +SPRING_PROFILES_ACTIVE=local mvn -pl identity-service -am spring-boot:run |
| 49 | +``` |
| 50 | + |
| 51 | +1. Stop or reset infrastructure when needed: |
| 52 | + |
| 53 | +```bash |
| 54 | +make dev-down # keep data |
| 55 | +make dev-reset # destroy data |
| 56 | +``` |
| 57 | + |
| 58 | +## Local development commands |
| 59 | + |
| 60 | +From `services/java`: |
| 61 | + |
| 62 | +```bash |
| 63 | +# Run formatter + style checks for one module |
| 64 | +mvn -pl discovery-service spotless:apply checkstyle:check |
| 65 | + |
| 66 | +# Run tests for one module |
| 67 | +mvn -pl discovery-service test |
| 68 | + |
| 69 | +# Validate all Java modules quickly |
| 70 | +mvn -f pom.xml -DskipTests validate |
| 71 | +``` |
| 72 | + |
| 73 | +## API and planning docs |
| 74 | + |
| 75 | +- REST API contract: `docs/contracts/rest-api-v1.md` |
| 76 | +- MVP backend plan: `docs/mvp-backend-implementation-plan.md` |
| 77 | +- Modular rollout roadmap: `docs/modular-implementation-roadmap.md` |
| 78 | + |
| 79 | +## Repository layout |
| 80 | + |
| 81 | +- `services/java` - Java services monorepo parent + modules |
| 82 | +- `scripts/dev` - local infra lifecycle scripts |
| 83 | +- `docker` + `docker-compose.yml` - local infra definitions |
| 84 | +- `docs` - contracts, architecture notes, and implementation plans |
| 85 | +- `.github/workflows/ci.yml` - CI pipeline |
| 86 | + |
| 87 | +## Notes |
| 88 | + |
| 89 | +- `.env` is auto-created from `.env.example` if missing when you run `make dev-up`. |
| 90 | +- Discovery's OpenSearch integration is present but disabled by default in local config. |
| 91 | +- Go-based services are part of the target architecture but are not scaffolded in this repo yet. |
0 commit comments