Skip to content

Dhartim/project-4-Dhartim

 
 

Repository files navigation

Project 4-Dhartim - Service-Oriented Architecture

For this project you will implement a service-oriented version of a ticket purchase application (i.e., your own EventBrite!).

Overview

The architecture of the service will be as follows:

architecture

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:

  1. Get a list of all events
  2. Create a new event
  3. Get details about a specific event
  4. Purchase tickets for an event
  5. Create a user
  6. See a user's information, including details of all events for which the user has purchased tickets
  7. 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:

  1. Create a new event
  2. Get a list of all events
  3. Get details about a specific event
  4. 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:

  1. Create a new user
  2. Get user details
  3. Add a new ticket for a user
  4. Transfer tickets from one user to another

API

Front End Service

GET /events

Responses:

CodeDescription
200Event Details
[
	{
		"eventid": 0, 
		"eventname": "string", 
		"userid": 0,		
		"avail": 0, 
		"purchased": 0
	} 
]
	
400No events found
POST /events/create

Body:

{
	"userid": 0,
	"eventname": "string",
	"numtickets": 0
}

Responses:

CodeDescription
200Event created
{
	"eventid": 0
}	
400Event unsuccessfully created
GET /events/{eventid}

Responses:

CodeDescription
200Event Details
{
	"eventid": 0, 
	"eventname": "string", 
	"userid": 0,		
	"avail": 0, 
	"purchased": 0
}
400Event not found
POST /events/{eventid}/purchase/{userid} Body:
{
	"tickets": 0
}

Responses:

CodeDescription
200Tickets purchased
400Tickets could not be purchased
POST /users/create

Body:

{
	"username": "string",
}

Responses:

CodeDescription
200User created
{
	"userid": 0,
}	
400User could not be created
GET /users/{userid}

Responses:

CodeDescription
200User Details
{
	"userid": 0,
	"username": "string",
	"tickets": [
		{
			"eventid": 0, 
			"eventname": "string", 
			"userid": 0,		
			"avail": 0, 
			"purchased": 0
		}
	]	
}
400User not found
POST /users/{userid}/tickets/transfer

Body:

{
	"eventid": 0,
	"tickets": 0,
	"targetuser": 0
}

Responses:

CodeDescription
200Event tickets transferred
400Tickets could not be transferred

Event Service

POST /create

Body:

{
	"userid": 0,
	"eventname": "string",
	"numtickets": 0
}

Responses:

CodeDescription
200Event created
{
	"eventid": 0
}	
400Event unsuccessfully created
GET /list

Responses:

CodeDescription
200List of events
[
	{
		"eventid": 0, 
		"eventname": "string", 
		"userid": 0,		
		"avail": 0, 
		"purchased": 0
	}
]	
GET /{eventid}

Responses:

CodeDescription
200Event details
{
	"eventid": 0, 
	"eventname": "string", 
	"userid": 0,		
	"avail": 0, 
	"purchased": 0
}
400Event not found
POST /purchase/{eventid}

Body:

{
	"userid": 0,
	"eventid": 0,
	"tickets": 0
}

Responses:

CodeDescription
200Event tickets purchased
400Tickets could not be purchased

User Service

POST /create

Body:

{
	"username": "string",
}

Responses:

CodeDescription
200User created
{
	"userid": 0
}	
400User unsuccessfully created
GET /{userid}

Responses:

CodeDescription
200User details
{
	"userid": 0,
	"username": "string",
	"tickets": [
		{
			"eventid": 0
		}
	]
}
400User not found
POST /{userid}/tickets/add

Body:

{
	"eventid": 0,
	"tickets": 0
}

Responses:

CodeDescription
200Event tickets added
400Tickets could not be added
POST /{userid}/tickets/transfer

Body:

{
	"eventid": 0,
	"tickets": 0,
	"targetuser": 0
}

Responses:

CodeDescription
200Event tickets transfered
400Tickets could not be transfered

Requirements

  1. You will use Servlets/Jetty as your web framework.
  2. 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.
  3. 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.

Submission Requirements

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.

Grading Rubric

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.

Academic Dishonesty

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.

About

project-4-Dhartim created by GitHub Classroom

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%