Internal Content Management System API for creating, updating, and managing media content (podcasts, documentaries, etc.) in the Thmanyah platform.
The CMS API serves as the internal administrative interface for content editors and administrators to:
This service is part of the Thmanyah microservices architecture:
Example :CMS API โ Database (PostgreSQL) โ Outbox Table โ Outbox Publisher โ Queue โ Sync Worker โ Elasticsearch
POST /programs
- Create a new programGET /programs/:id
- Get program by IDPUT /programs/:id
- Update programDELETE /programs/:id
- Delete programPOST /programs/bulk
- Bulk operationsGET /health
- Service health check# Install dependencies (from root)
pnpm install
# Start in development mode
pnpm --filter cms-api dev
# Or from the app directory
cd apps/cms-api
pnpm dev
Required environment variables (see root .env.example
):
# Database
DATABASE_HOST=localhost
DATABASE_PORT=5432
DATABASE_USERNAME=postgres
DATABASE_PASSWORD=password
DATABASE_NAME=thmanyah
# Redis (for queue)
REDIS_HOST=localhost
REDIS_PORT=6379
# API Configuration
CMS_API_PORT=3001
NODE_ENV=development
Once running, access the Swagger documentation at:
# Unit tests
pnpm --filter cms-api test
# E2E tests
pnpm --filter cms-api test:e2e
# Test coverage
pnpm --filter cms-api test:cov
# Watch mode
pnpm --filter cms-api test:watch
# Development
pnpm dev # Start in development mode
pnpm start # Start in production mode
pnpm start:dev # Start with watch mode
pnpm start:debug # Start in debug mode
pnpm start:prod # Start in production mode
# Testing
pnpm test # Run unit tests
pnpm test:watch # Run tests in watch mode
pnpm test:cov # Run tests with coverage
pnpm test:debug # Run tests in debug mode
pnpm test:e2e # Run e2e tests
# Building
pnpm build # Build the application
pnpm build:watch # Build in watch mode
# Linting
pnpm lint # Run ESLint
pnpm lint:fix # Fix ESLint issues
apps/cms-api/
โโโ src/
โ โโโ app.module.ts # Main application module
โ โโโ main.ts # Application entry point
โ โโโ common/ # Shared utilities
โ โ โโโ filters/ # Exception filters
โ โ โโโ interceptors/ # Request/response interceptors
โ โโโ health/ # Health check endpoints
โ โโโ program/ # Program management
โ โโโ program.controller.ts
โ โโโ program.service.ts
โ โโโ program.module.ts
โ โโโ mappers/ # Data transformation
โโโ test/ # E2E tests
โโโ package.json
GET /health
# Build image
docker build --build-arg TARGET_APP=cms-api -t thmanyah/cms-api .
# Run container
docker run -p 3001:3001 --env-file .env thmanyah/cms-api
# Build for production
pnpm --filter cms-api build
# Start production server
pnpm --filter cms-api start:prod
This project is part of the Thmanyah backend system and is licensed under the MIT License.