# Course Content Service
The **Course Content Service** is a microservice responsible for managing courses, modules, and lessons in the EdTech platform.
It provides **REST** and **gRPC APIs** to create, update, retrieve, and manage study materials.
This service uses **MongoDB** as its primary data store due to the flexible and schema-less nature of course content.
---
## 🚀 Features
- Manage Courses, Modules, and Lessons
- Store metadata for study materials (title, description, tags, difficulty, etc.)
- RESTful APIs (Swagger/OpenAPI support)
- gRPC endpoints for inter-service communication
- Structured logging and middleware support
- Unit tests, integration tests, and load tests
- Dockerized & ready for Kubernetes deployment
---
## 🛠️ Tech Stack
- **Language:** Go (Golang)
- **Framework:** Gin / Fiber (REST APIs)
- **Database:** MongoDB
- **gRPC:** Protobuf for inter-service contracts
- **Logging:** Structured logging (Zap/Logrus)
- **Testing:** Go test, mocks, load tests
- **Containerization:** Docker, Helm charts (for deployment)
---
## 📂 Project Structure
```bash
course-content-service/
├── apis/ # Swagger/OpenAPI specs
├── cmd/
│ └── server/ # Entry point (main.go)
├── config/
│ ├── config.yaml # Default configs
│ └── loader.go # Loads env/config
├── env/ # Env files (.env, dev.env, prod.env)
├── handler/ # API layer (controllers)
│ ├── http/ # REST controllers
│ └── grpc/ # gRPC handlers
├── model/ # Domain models (Course, Module, Lesson)
├── repository/ # Database layer
│ ├── mongo/ # MongoDB implementation
│ └── mock/ # Mocks for testing
├── service/ # Business logic layer
│ ├── course/ # Course service
│ ├── lesson/ # Lesson service
│ └── test/ # Unit tests
├── server/ # Server bootstrap
│ ├── api/ # API setup (Gin/Fiber routes)
│ └── props/ # Server props (ports, timeouts)
├── middleware/ # Logging, tracing, auth, rate limiting
├── pkg/ # Shared package (db conn, cache conn)
│ ├── db/
│ │ └── mongo.go # Mongo connection
│ └── logger/ # Structured logging setup
├── scripts/ # Local scripts (migrations, seeding)
├── test/ # Integration & load tests
│ ├── api/
│ └── load/
├── swagger/ # Swagger spec + docs
├── Dockerfile
├── Makefile
└── go.modgit clone https://github.com/your-org/course-content-service.git
cd course-content-serviceCreate a .env file or use existing env/dev.env:
MONGO_URI=mongodb://localhost:27017
DB_NAME=course_service
PORT=8080go mod tidy
go run cmd/server/main.godocker build -t course-content-service:latest .
docker run -p 8080:8080 --env-file=env/dev.env course-content-service:latest- REST APIs documented with Swagger →
http://localhost:8080/swagger/index.html - gRPC APIs defined in
/apis/proto/course.proto
make test- Unit Tests →
service/test/ - Integration Tests →
test/api/ - Load Tests →
test/load/
- Containerized using Docker
- Kubernetes-ready via Helm charts (
/helm/course-content/) - Supports CI/CD with GitHub Actions / Jenkins pipelines
- Add content versioning (track updates to lessons/modules)
- Integrate with Elasticsearch for fast course search
- Add GraphQL API layer
- Caching with Redis for frequently accessed course data
- Arjun Singh
- Team/ArjunDev17
This repository is being enhanced step by step into a production-ready Event-Driven microservice.
- Create Course API
- Store Course in MongoDB
- Publish
course.createdevent to Kafka - Understand Producers, Topics, and Event Contracts
- Notification Service (Kafka Consumer)
- Subscriber Management
- Notification Worker Pool
- Retry Topics
- Dead Letter Topic (DLT)
- Consumer Groups
- Partitions
- Ordering Guarantees
- Production Deployment