Team members: Carina, Corina, Cosmin
- Book
- Librarian
- Reader
- Rent
- Reservation
- Login and Register
- Rent and return book
- Reserve and unreserve book
- See all reservations he made
- Get all books
- Add book
- Update book
- Delete book by id
- Get all reders with rented books
- Get all readers with late return dates
- Ban readers with late return dates
- Unban reader
- Get all banned users
- See list of reservers for books
For using Github Codespaces, no prerequisites are mandatory. Follow the ./PREREQUISITES.md instructions to configure a local virtual machine with Ubuntu, Docker, IntelliJ.
- Fork the code GitHub repository under your Organization
- Clone the code repository:
- git@github.com:YOUR_ORG_NAME/service.git
- Make sure that the Github repository is forked under your account / Organization
- Create a new Codespace from your forked repository
- Wait for the Codespace to be up and running
- Check java version
java -version
should return 21- Validate Java version is properly configured in devcontainer.json
- If the correct Java version is set in devcontainer.json, but the command returns a different version:
- Open Command Palette (Ctrl+Shift+P) and run
Rebuild Container
- Wait for the container to be rebuilt, and if the Java version is still incorrect, try a full rebuild or set it manually in the terminal:
sdk default java 21.0.5-ms
- Open Command Palette (Ctrl+Shift+P) and run
- Make sure that Docker service has been started
docker ps
should return no error
- For running all services in docker:
- Build the docker image of the hello world service
make build
- Start all the service containers
./start.sh
- Build the docker image of the hello world service
- For running / debugging directly in Visual Studio Code
- Build and run the Spring Boot service
./gradlew build
./gradlew bootRun
- Start the MongoDB related services
./start_mongo_only.sh
- Build and run the Spring Boot service
- Use requests.http to test API endpoints
- Navigation between methods (e.g. 'Go to Definition') may require:
./gradlew build
NOTE: for a live demo, please check out this youtube video
- Build the code
- IntelliJ will build it automatically
- If you want to build it from command line and also run unit tests, run:
./gradlew build
- Create an IntelliJ run configuration for a Jar application
- Add in the configuration the JAR path to the build folder
./build/libs/hello-0.0.1-SNAPSHOT.jar
- Add in the configuration the JAR path to the build folder
- Start the MongoDB container using docker compose
docker-compose up -d mongo
- Run/debug your IntelliJ run configuration
- Open in your browser:
-
Build the docker image of the hello world service
make build
-
Start all the containers
./start.sh
-
Verify that all containers started, by running
service git:(master) ✗ $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES c1d05dddd3fe mongo:5.0.2 "docker-entrypoint.s…" 6 seconds ago Up 5 seconds 0.0.0.0:27017->27017/tcp service_mongo_1 e90bb406c139 hello-img "java -jar /hello/li…" 6 seconds ago Up 5 seconds 0.0.0.0:8080->8080/tcp service_hello_1 411475a7b596 mongo-express "tini -- /docker-ent…" 6 seconds ago Up 2 seconds 0.0.0.0:8090->8081/tcp service_mongo-admin-ui_1
-
Open in your browser:
-
You can test other API endpoints using requests.http
-
You can access the MongoDB Admin UI at: