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.
- Clone the repository:
git clone https://github.com/br93/timetable.git
- 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
- The Spring Boot app will be accessible at http://localhost:8080
- Swagger documentation: http://localhost:8080/swagger-ui.html
- MongoExpress will be accessible at http://localhost:8081
- RabbitMQ will be accessible at http://localhost:15672
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
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.