Skip to content

Latest commit

 

History

History
125 lines (97 loc) · 2.86 KB

README.md

File metadata and controls

125 lines (97 loc) · 2.86 KB

Timetable

Java Spring MongoDB RabbitMQ

This project is an API built using Java 21, Spring Boot 3, MongoDB, RabbitMQ and Timefold.

The application was developed to help create a timetable using AI optimization and Google Calendar API integration.

Table of Contents

Installation

  1. Clone the repository:
git clone https://github.com/br93/timetable.git
  1. Create your credentials in Console Google Developer and change these config in docker.env with the proper values

Config Values

GOOGLE_CLIENT_ID=########
GOOGLE_CLIENT_SECRET=########

3. Run makefile (or Docker Compose)

Makefile

make up

Docker Compose

mvn clean package
docker compose up -d

Usage

  1. The Spring Boot app will be accessible at http://localhost:8080
  1. MongoExpress will be accessible at http://localhost:8081
  2. RabbitMQ will be accessible at http://localhost:15672

Endpoints

TIMESLOT

POST /timeslot - Create a new timeslot

BODY

{
  "start": "18:00:00",
  "end": "20:00:00"
}

TIMETABLE

POST /timetable - Create a new timetable

BODY

[
	{
		"subject": "new-lesson1",
		"level": 1
	},
	{
		"subject": "new-lesson2",
		"level": 2
	},
	{
		"subject": "new-lesson3",
		"level": 3
	},
	{
		"subject": "new-lesson4",
		"level": 3
	},
	{
		"subject": "new-lesson5",
		"level": 2
	},
	{
		"subject": "new-lessons6",
		"level": 2
	}
]

Timetable will be generated for up to 10 lessons (5 lesson optional) using Timefold with following constraints:

  • One lesson per day (when optional)
  • Difficult lessons apart from each other during the week
  • Easier lessons on Friday
  • If more than 5 lessons, avoid two difficult lessons in the same day
  • Avoid two lessons on Friday

Timetable

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request to the repository.

When contributing to this project, please follow the existing code style, commit conventions, and submit your changes in a separate branch.