Sunbird ED Developer Bootcamp 2023
Sunbird ED Developer Bootcamp 2023
(Sunbird Lern)
Context:
This document helps in understanding the local setup, for one of the key microservice of the
Sunbird Lern Building Block. This will enable the participants of the bootcamp to choose and
work on the problem statements given below.
It has the details about setting up the batch-service from the scratch on your local machine.
Prerequisite
● Java 11
● Maven – Latest
● Docker – Latest
● Cassandra 3.11.6
● ES 6.8.11
● IntelliJ Editor
● Postman
● GIT
Validate Prerequisites
Maven mvn -v
Setup Cassandra
Start the Cassandra cypher shell docker exec -it sunbird_cassandra cqlsh
Setup Elasticsearch
Create Bootcamp postman collection in the link below has the API collection and
“course-batch” environment json files, import it in Postman and create index and
index and update mapping.
the mapping
https://github.com/Sunbird-Lern/sunbird-course-service/tree/bootcamp/sc
ripts/postman
Setup Redis
🗒️ Note: Please uncheck the “Copy the main branch only”. This will copy all the branches to
the fork.
Branch bootcamp
Checkout branch
cd sunbird-course-service
git remote -v
git remote remove origin
git remote add origin
[email protected]:reshmi-nair/sunbird-course-service.git
git remote add upstream
[email protected]:sunbird-lern/sunbird-course-service.git
Export the Update the lms-service.sh file in the scripts folder with
configuration configuration values to setup environment variables. Copy and run
it to export the values
Copy Keys for token Copy the keys folder from below link to local
verification sunbird-course-services root folder
https://drive.google.com/drive/u/0/folders/1V1CxHKP3IKMHg4s-Q
_CSgvpu9bYdugNj
Additional Details:
Please consider using the below user credentials for you to play with the APIs and experience
the batch-service capabilities.
Use case 1: LR-374 Compute the number of days to start the batch
Each batch has the metadata to explain the start date, end date, enrolment end date. Please
introduce a new property in the batch read API to explain how many days are left for the
users to consume the course.
● Compute the duration in days.
● The new property name should be “daysToGo”
● The value should be a string.
● If the start date is a future date, “x days to go”.
● If the start date is today, “the batch started today”.
● If the start date is old, “started x days ago”.
The course has “audience” attribute to understand the targeted users. Please consider using the
value of the audience (teacher) and map it with the user's metadata (userType) to allow the
enrolment.
● Accept the enrolment if the audience (from the course) and userType from the
enrolling user metadata matches.
● Use the auth token to extract the user identifier.
● Make the user read API call to fetch the metadata of the user.
● If the enrolment is for an invalid user, the API should return an error code with a
message.