Question
Creating AirBnB GraphQL API The main objective of this assignment is to demonstrate your knowledge about GraphQL API development. Refer class and lab code for
Creating AirBnB GraphQL API
The main objective of this assignment is to demonstrate your knowledge about GraphQL API development. Refer class and lab code for the GraphQL examples. Create a NodeJS application and Git Repository having the namestudentId_comp3133_assig1.
Store all data using Mongodb atlas cloud (Name mongodb Database as studentId_comp3133_assig1 and think of your own collections name for saving listing, user info and booking info (use nodeJS mongoose module)
1. Create a new User Profile (type = admin OR type = customer) (validate that All fields are mandatory)
"username": "pritamworld", "firstname": "Pritesh, "lastname": "Patel", "password": "test123", "email": "p@p.com",
type": "admin"
-
All fields are required
-
Username must be unique i.e., must not be same as existing user
-
Validate email format
-
Password must be min 6 characters length and can contain only
upper/lower alphabets, 0-9, #, $, &, _
2. Login API Pass the username and password to validate the user to allow booking of any listing (both user and admin) (Optional: implement JWT token)
3. Create a new listing (Admin) (validate All fields are mandatory)
"listing_id": "L001", "listing_title": "Sea face home for rent", "description": "max 1000-character description", "street": "171 Young Street", "city": "Toronto",
"postal_code": "M1X0Y5", "price": 150.00, "email": "contact@hilton.com", "username": "pritamworld"
4. View all listings created by Admin 5. Book listings as a User
"listing_id": "L001", "booking_id": "B001", "booking_date": "01-24-2022", "booking_start": "01-25-2022", "booking_end": "01-30-2022",
"username": "pritamworld"
6. Search listing by Name
City / Postal code 7. List all User bookings (Only when logged in as User) 8. View all listing added by Admin user (Only when logged in as Admin)
-
All fields are required
-
Validate email format
Evaluation
A) GraphQL end point/queries (9 points each) B) Validate new User and new Listings (5 points each)
C) GitHub Repo D) Submitting Postman project with all endpoints
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started