Please make sure you have the following installed on your machine:
For database, you can use any DBMS you want, but I'd used MySQL for this project.
For IDE, you can use any IDE you want, but I'd used IntelliJ IDEA for this project (Community Edition is enough).
API Testing Tool:
- Postman (recommended)
-
Open your terminal/CMD and go to the directory where you want to clone this project by using
cdcommand. -
Clone this repository to your local machine.
git clone https://github.com/Esh07/Module-Timetable-Management-System-RESTful-API.git- Open the project in your IDE.
-
Open MySQL Workbench and connect to your local MySQL server. (If you don't have any server, you can create one by clicking on the
+icon on the MySQL Connections tab.) -
Create a new schema and name it
module_timetable_api. (You can name it whatever you want, but you have to change the name in theapplication.propertiesfile in the project. - See below) -
Create a new user and name it
co2103with passwordco2103. (You can name it whatever you want, but you have to change the name in theapplication.propertiesfile in the project. - See below) -
Grant all privileges to the user you just created. (You can do this by clicking on the
Users and Privilegestab and double-clicking on the user you just created. Then, go to theAdministrative Rolestab and check all the privileges.) -
Click on the
Applybutton and then click on theFinishbutton. -
Now, you can connect to the database using the user you just created.
-
Open the project in your IDE.
-
Go to the
src/main/resourcesdirectory and open theapplication.propertiesfile. -
Change the
spring.datasource.urlproperty tojdbc:mysql://localhost:3306/module_timetable_api.Note: If you have changed the schema name, you have to change it here as well. For example:

- Keep protocol, hostname and port as it is.
- Change the schema name to the name you have given to the schema (database) you created. (keep the same,
module_timetable_apiif you haven't changed it in the Database section above)
-
Change the
spring.datasource.usernameproperty toco2103.Note: If you have changed the username, you have to change it here as well.
-
Change the
spring.datasource.passwordproperty toco2103.Note: If you have changed the password, you have to change it here as well.
-
Save the file.
-
Go to the
src/main/java/edu/leicester/co2103/directory and open thePart1Application.javafile. -
Right-click on the
Part1Application.javafile and selectRun 'Part1Application'. -
Go to the
Runtab and click on theEdit Configurations...option. -
Click on the
+icon and selectGradle. -
Change the
NametoRun Part1Application. -
Change the
Gradle projecttoModule-Timetable-Management-System-RESTful-API. -
Change the
TaskstobootRun. -
Click on the
Applybutton and then click on theOKbutton. -
Now, you can run the project by clicking on the
Run Part1Applicationoption in theRuntab.
Note: Before testing the API, ensure that the project is running.
-
Open Postman.
-
Click on the
Collectiontab and create a new collection namedModule Timetable API. -
Now, click on the
Filetab and selectImport.... -
Go to the
src/main/resourcesdirectory and select thepart1.postman_collection.jsonfile.or
you can drag and drop the
part1.postman_collection.jsonfile to the Postman window.
If you have done everything correctly, you should see the Timetable - REST API collection in the Collections tab.
You can now call the API endpoints by clicking on the endpoints in the Collections tab.
Each endpoint has a test script that tests the endpoint and returns the result.
To run collection tests:
-
Click on the
Runnertab and follow instructions shown on the new window. -
Once you've imported the collection, click on the
Start Runbutton. -
It will run all the tests and show the results.
If you have any issues or need any help, please create an issue and I'll try to help you as soon as possible.