This project represents a basic template of a Concert Agency API, where user can register and purchase tickets on different musical events.
There is used N-tier architecture with DB layer, DAO layer, Service layer and Controllers layer. Controllers endpoints are built according to REST principles and all project is developed according to SOLID principles with authorization and authentication. All these features are realized with:
- MySQL (DB layer)
- Hibernate (DAO layer)
- Java (Service layer)
- Spring MVC (Controllers layer)
- Spring Security (Authentication/Authorization)
All data is transferred as JSON. Every User can have multiple Roles
- POST
/register
New User registration endpoint
Data format:{"email" : "yourEmail", "password" : "yourPassword", "repeatPassword" : "repeatYourPassword"}
Access granted for anybody. - GET
/concert-halls
Get all available Concert Halls
Data format:{"id" : "concert_hall_Id","capacity" : "capacity","description" : "description"}
Access granted for authorized users. - POST
/concert-halls
Creating a Concert Hall
Data format:{"capacity" : "capacity","description" : "description"}
Access granted for Admin users. - GET
/performances
Get all available Performances
Data format:{"id" : "performance_Id","title" : "title","description" : "description"}
Access granted for authorized users. - POST
/performances
Creating a Performance
Data format:{"title" : "title","description" : "description"}
Access granted for Admin users. - GET
/events/available?performanceId={performance_id}&date=DD.MM.YYYY
Get all available Events of Performance with performance_id on date of format "DD.MM.YYYY"
Data format:{"id" : "event_id","performance" : "performance_title", "concertHall" : "concert_hall_description","showTime" : "DD.MM.YYYY HH.MM"}
Access granted for authenticated users. - POST
/events
Creating an Event
Data format:{"performanceId" : "performance_id", "concertHallId" : "concert_hall_id", "showTime" : "DD.MM.YYYY HH.MM"}
Access granted for Admin users. - PUT
/events/{event_id}
Update event with event_id
Data format:{"performanceId" : "performance_id", "concertHallId" : "concert_hall_id", "showTime" : "DD.MM.YYYY HH.MM"}
Access granted for Admin users. - DELETE
/events/{event_id}
Delete event with event_id
Access granted for Admin users. - GET
/users/by-email?email={userEmail}
Find User by his email
Data format:{"id" : "userId","email" : "user_email"}
Access granted for Admin users. - POST
/shopping-carts/events?eventId={event_id}
Adding ticket of Event with event_id into current logged User Shopping Cart
Access granted for authenticated users. - GET
/shopping-carts/by-user
Get current authenticated User Shopping Cart
Data format:{"id" : "userId","tickets" : "this_user_tickets"}
Access granted for authenticated users. - POST
/orders/complete
Complete order for current authenticated User
Access granted for authenticated users. - GET
/orders
Get all orders of current authenticated User
Data format:{"id" : "order_id","tickets" : "order_ticket_id's", "orderDate" : "DD.MM.YYYY HH.MM","userEmail" : "user_email"}
Access granted for authenticated users.
- Download and install the JDK
- Download and install Apache Tomcat
- Download and install MySQL Server
- You can send requests using your registered credentials with Postman
- Create "concert-agency" schema in your DB.
- Setup credentials in the file "/resources/db.properties"
- db.driver: leave as is, or use appropriate driver for the other DB than MySQL.
- db.url: jdbc:mysql://"your_DB_URL:port"/concert-agency
- db.use: "your username"
- db.password: "your password"
- Setup admin login and password in the file "/util/InitialInject.java".
By default they are :
- ADMIN_EMAIL = "admin"
- ADMIN_PWD = "1234"
- Run a project
- Add initial values into DB using admin credentials
- Register new user