Stack of technologies:
- Spring Framework (Spring MVC, Spring Security, Spring Core, Spring Test)
- Hibernate
- MySQL
- SLF4J
- Templating engine - JSP/JSTL (+ Twitter Bootstrap library for a consistent UI)
- Lombok (to get rid of boiler-plate code)
- Maven
- jUnit 4
- H2 in-memory database (just for testing)
There are three roles in application - customer, manager and admin.
Responsibility of Admin is to toggle management status of users. It can be accomplished at /admin endpoint, that permits only requests from one IP address, mentioned at security.properties file.
Manager can view all the customers, and their orders as well as adding new hotels and attach rooms to them.
Customer can book view the hotels and book rooms in a certain room, that is not busy at mentioned period.
Instruction:
- In a root package of the project there is a file init.sql. It is an SQL script that creates schema pictured below.
Database schema visualisation:
-
In the resources package you will see db_example.properties file. It's an example of db.properties file that must be created in the same package.
-
Just for convenience I have added TestDBConnection class, that expects JDBC url, username and password to verify connection.
-
If you wish, you can execute data.sql script as well to prepopulate roles and countries in a database.
Application has been successfully run and manually tested using Tomcat server.