For this project you will implement a service-oriented version of a ticket purchase application (i.e., your own EventBrite!).
The architecture of the service will be as follows:
Web Front End - The web front end will implement an external web service API for the application and will support APIs for the following operations:
- Get a list of all events
- Create a new event
- Get details about a specific event
- Purchase tickets for an event
- Create a user
- See a user's information, including details of all events for which the user has purchased tickets
- Transfer tickets from one user to another
Event Service - The event service will manage the list of events and the number of tickets sold and available for each. When a ticket is purchased it is the responsibility of the Event Service to notify the User Service of the user's purchase. The API will support the following operations:
- Create a new event
- Get a list of all events
- Get details about a specific event
- Purchase tickets for an event, updating the user's ticket list
User Service - The user service will manage the user account information, including the events for which a user has purchased tickets. The API will support the following operations:
- Create a new user
- Get user details
- Add a new ticket for a user
- Transfer tickets from one user to another
GET /events
Responses:
Code | Description |
200 | Event Details[ { "eventid": 0, "eventname": "string", "userid": 0, "avail": 0, "purchased": 0 } ] |
400 | No events found |
POST /events/create
Body:
{ "userid": 0, "eventname": "string", "numtickets": 0 }
Responses:
Code | Description |
200 | Event created
{ "eventid": 0 } |
400 | Event unsuccessfully created |
GET /events/{eventid}
Responses:
Code | Description |
200 | Event Details{ "eventid": 0, "eventname": "string", "userid": 0, "avail": 0, "purchased": 0 } |
400 | Event not found |
POST /events/{eventid}/purchase/{userid}
Body:{ "tickets": 0 }
Responses:
Code | Description |
200 | Tickets purchased |
400 | Tickets could not be purchased |
POST /users/create
Body:
{ "username": "string", }
Responses:
Code | Description |
200 | User created{ "userid": 0, } |
400 | User could not be created |
GET /users/{userid}
Responses:
Code | Description |
200 | User Details{ "userid": 0, "username": "string", "tickets": [ { "eventid": 0, "eventname": "string", "userid": 0, "avail": 0, "purchased": 0 } ] } |
400 | User not found |
POST /users/{userid}/tickets/transfer
Body:
{ "eventid": 0, "tickets": 0, "targetuser": 0 }
Responses:
Code | Description |
200 | Event tickets transferred |
400 | Tickets could not be transferred |
POST /create
Body:
{ "userid": 0, "eventname": "string", "numtickets": 0 }
Responses:
Code | Description |
200 | Event created
{ "eventid": 0 } |
400 | Event unsuccessfully created |
GET /list
Responses:
Code | Description |
200 | List of events [ { "eventid": 0, "eventname": "string", "userid": 0, "avail": 0, "purchased": 0 } ] |
GET /{eventid}
Responses:
Code | Description |
200 | Event details{ "eventid": 0, "eventname": "string", "userid": 0, "avail": 0, "purchased": 0 } |
400 | Event not found |
POST /purchase/{eventid}
Body:
{ "userid": 0, "eventid": 0, "tickets": 0 }
Responses:
Code | Description |
200 | Event tickets purchased |
400 | Tickets could not be purchased |
POST /create
Body:
{ "username": "string", }
Responses:
Code | Description |
200 | User created{ "userid": 0 } |
400 | User unsuccessfully created |
GET /{userid}
Responses:
Code | Description |
200 | User details{ "userid": 0, "username": "string", "tickets": [ { "eventid": 0 } ] } |
400 | User not found |
POST /{userid}/tickets/add
Body:
{ "eventid": 0, "tickets": 0 }
Responses:
Code | Description |
200 | Event tickets added |
400 | Tickets could not be added |
POST /{userid}/tickets/transfer
Body:
{ "eventid": 0, "tickets": 0, "targetuser": 0 }
Responses:
Code | Description |
200 | Event tickets transfered |
400 | Tickets could not be transfered |
- You will use Servlets/Jetty as your web framework.
- You will use a SQL database to store all data including user information, event information, and ticket transaction/purchase information. You are required to design the database tables. Though you will use the same centralized database for each service, to accurately mimic a service-oriented architecture ensure that one service does not access the database tables of the other service. Instead, services should communicate via the API implemented.
- By the time of your interactive grading appointment you must have your application deployed on the microcloud. The web front end must be deployed on your primary node port 7070. Your services (all three components!) must be running on different hosts at the time your solution is graded. See the guide to running on the microcloud to ensure that your process is long running.
You will schedule an interactive grading appointment during finals week. Before your scheduled appointment, submit all code to your github repository for this assignment and ensure your complete solution is be running on the microcloud. Your web front end must be deployed on your primary node port 7070. Your services (all three components!) must be running on different hosts.
Use the following link to create your private github repository for this assignment: Project 4
For full credit, make sure to follow all Style Guidelines. Points will be deducted for each violation.
Requirements for demonstration of the functionality and database integration will be made available prior to interactive grading. It will be the responsibility of the student to clearly demonstrate the functionality of all APIs via appropriate test cases and to demonstrate that data is saved to the database correctly.
Points | Criterion |
---|---|
5 | Project Checkpoint |
10 | Style |
15 | Code Quality |
15 | Event Service Functionality - Demonstration |
10 | Event Service Functionality - Instructor Test Cases |
15 | User Service Functionality- Demonstration |
10 | User Service Functionality - Instructor Test Cases |
10 | Front End Service Functionality - Demonstration |
10 | Front End Service Functionality - Instructor Test Cases |
10 | Database Integration |
A student who earns full credit for this assignment will earn 110% (110/100) for this project.
Partial credit may be awarded for partial functionality and/or partially correct design or style elements.
Any work you submit is expected to be your own original work. If you use any web resources in developing your code you are strongly advised to cite those resources. The only exception to this rule is code that is posted on the class website. The URL of the resource you used in a comment in your code is fine. If I google even a single line of uncited code and find it on the internet you may get a 0 on the assignment or an F in the class. You may also get a 0 on the assignment or an F in the class if your solution is at all similar to that of any other student.