- GatorGiveaway is a common platform for users to sell their items/belongings and also to buy items they need. Its like ebay platform for UF students
- This is developed as a web application portal using ReactJS as front end and GoLang to write backend services
- AWS S3 for block storage of images/files
- Azure Virtual Machine for deploying backend services to remote server
- Git Hub pages for deploying UI to remote server
- GORM for persistance framework in GoLang
- GIN for webservice framework in GoLang
- CYPRESS/JEST for unit testing
- SQLite for DBMS
- Register: New users can register to our portal
- Login: Already registered users can login using their credentials
- Buyer/Seller: Buyer and sellers have custom login functionalities, like buyer has addtocart, favorites tab and can see all posts, whereas seller can only see what items he has posted for selling
- Create Post: For a user he can create a post to sell what items he needs to sell and mention all details like Product name, size, age, weight, image etc.,
- Mark Favorite:
- Users can mark their products as favorite and can see those items in the favorites tab
- About Us: Details about all our developers
- Remote Website url : https://raghusaripalli.github.io/GatorGiveaway/
- Backend URL: Cloud link for Backend APIs - http://13.71.87.168:8080
- We have deployed backend services using amazon aws
- For UI we have used git-hub pages to deploy our application
- Functionality Video - Full Video in Youtube
- Video Link: youtube backend video link
Place Order API Tests
- TestPlaceOrderPassCase
- Tested the /placeOrder API by logging in with a user and placing an order using posts he could see
- TestPlaceOrderNotLoggedInFailCase
- Tested the /placeOrder API NOT logging in with user, this return status of UNAUTHORIZED
- TestPlaceOrderJsonFieldsMissing
- Json Fileds missing is handled in this test
Cancel Order API Tests
- TestCancelOrderSuccessCase
- Tested the /cancelOrder API by logging in with a user and cancelling the user order by order id, STATUS is updated to 2
- TestCancelOrderUserNotLoggedInCase
- Tested the /cancelOrder API NOT logging in with user, this return status of UNAUTHORIZED
- TestCancelOrderOrderNotExistsCase
- Order Id not existing in this case is handled, with a positive response and message in json response.
List Orders API Tests
- TestGetAllOrdersPassCase
- Lists all orders by calling the /alOrders, it returns in a pagination format
- TestGetParticularOrderPassCase
- List Order based on the Order ID, return a single json
- TestGetParticularOrderFailCase
- Provided order ID if it's not present, returns a 409 status and validated the same.
- Raghu Saripalli (Backend)
- Tejasri Dontham (Backend)
- Sujay (Front end)
- Yamini Palnati (Front end)
Login
"localhost:3000" + "/login"
Method: POST
Example
{
"username" : "myUserName",
"password" : "myPASSW1234!"
}
Fields
Elements | Descriptions | Type | Required |
---|---|---|---|
username | The username cannot be empty | String | true |
password | The password cannot be empty | String | true |
{ "result": "login success" } Possible status: 200, 400, 401
Message format: json
Example
Code: 200 OK
Register
"localhost:3000" + "/register"
Method: POST
Example
{
"username" : "myUserName",
"password" : "myPASSW1234!"
}
Fields
Elements | Descriptions | Type | Required |
---|---|---|---|
username | The username cannot be empty | String | true |
password | The password cannot be empty | String | true |
{ "result": "registration success" } Possible status: 200, 400, 401
Message format: json
Example
Code: 200 OK
Logout
"localhost:3000" + "/logout"
Method: POST
Field { "result": "logout success" } Possible status: 200, 400, 401
Message format: json
Example
Create Post
"localhost:3000" + "/create"
Method: POST
Example
{
"name":"Laptop Stand",
"description": "Useful to put laptop in a height and at a distance.",
"location": "4000 SW 34th St Block #733C",
"dimensions": "5 x 2 x 6 m",
"weight":10,
"age": 1,
"count": 2
}
Fields
Elements | Descriptions | Type | Required |
---|---|---|---|
name | Name of the product | String | true |
description | Description of the item | String | true |
location | Location to pickup the item | String | true |
dimensions | Dimensions of the item | String | true |
weight | Weight of the item | int | true |
age | Age of the item | int | true |
count | No pof items | int | true |
{ "result": "post creation success" } Possible status: 200, 400, 401
Message format: json
Example
Code: 200 OK
Edit post
"localhost:3000" + "/update/<post_id>"
Method: PATCH
Example
{
"name":"Steel Laptop Stand",
"weight": 11,
"count": 1
}
Fields
Same as create post fields. Eg: { "name":"Steel Laptop Stand", "weight": 11, "count": 1 }
{ "ID": 5, "CreatedAt": "2022-02-04T20:42:18.1731823-05:00", "UpdatedAt": "2022-02-04T20:47:02.5941861-05:00", "DeletedAt": null, "name": "Steel Laptop Stand", "description": "Useful to put laptop in a height and at a distance.", "location": "4000 SW 34th St Block #733C", "dimensions": "5 x 2 x 6 m", "weight": 11, "age": 1, "count": 1 } Possible status: 200, 400, 401Message format: json
Example
Code: 200 OK
Delete post
"localhost:3000" + "/delete/<post_id>"
Method: DELETE
Example
localhost:8080/delete/5
{ "ID": 5, "CreatedAt": "2022-02-04T20:42:18.1731823-05:00", "UpdatedAt": "2022-02-04T20:47:02.5941861-05:00", "DeletedAt": null, "name": "Steel Laptop Stand", "description": "Useful to put laptop in a height and at a distance.", "location": "4000 SW 34th St Block #733C", "dimensions": "5 x 2 x 6 m", "weight": 11, "age": 1, "count": 1 } Possible status: 200, 400, 401Message format: json
Example
Code: 200 OK
Get posts
"localhost:3000" + "/read"
Method: GET
Example
localhost:8080/read
Possible status: 200, 400, 401
Message format: json
Example
Code: 200 OK
User operations
Get Users
"localhost:3000" + "/users"
Method: GET
Example
localhost:8080/users
[
{
"ID": 2,
"CreatedAt": "2022-02-04T22:39:18.8175326-05:00",
"UpdatedAt": "2022-02-04T22:39:18.8175326-05:00",
"DeletedAt": null,
"username": "superuser",
"password": "Supr@123",
"firstname": "Super",
"lastname": "User",
"phone": "+1 (111)-11-11111"
},
{
"ID": 3,
"CreatedAt": "2022-02-04T22:40:26.5245709-05:00",
"UpdatedAt": "2022-02-04T22:40:26.5245709-05:00",
"DeletedAt": null,
"username": "admin",
"password": "Admin@123",
"firstname": "Admin",
"lastname": "User",
"phone": "+1 999-99-99999"
},
{
"ID": 4,
"CreatedAt": "2022-02-04T23:35:52.370314-05:00",
"UpdatedAt": "2022-02-04T23:35:52.370314-05:00",
"DeletedAt": null,
"username": "User1",
"password": "User@123",
"firstname": "User First Name",
"lastname": "User Last Name",
"phone": "+1 443-77-66666"
},
{
"ID": 5,
"CreatedAt": "2022-02-04T23:41:40.2563053-05:00",
"UpdatedAt": "2022-02-04T23:41:40.2563053-05:00",
"DeletedAt": null,
"username": "Shangchi",
"password": "Shang@123",
"firstname": "Shang",
"lastname": "Chi",
"phone": "+1 333-22-88888"
},
{
"ID": 6,
"CreatedAt": "2022-02-04T23:46:39.8110102-05:00",
"UpdatedAt": "2022-02-04T23:46:39.8110102-05:00",
"DeletedAt": null,
"username": "MayaMattew",
"password": "Maya@123",
"firstname": "Maya",
"lastname": "Mattew",
"phone": "+1 333-22-88888"
}
]
Possible status: 200, 400
Message format: json
Example
Code: 200 OK
Create User
"localhost:3000" + "/register"
Method: POST
Example
localhost:8080/users
{
"username": "superuser1",
"password": "Super@123",
"firstname": "Super",
"lastname": "User",
"phone": "+1(111)-11-11111"
}
{
"result": "registration success"
}
Possible status: 200, 400
Message format: json
Example
Code: 200 OK
<details>
Delete User
"localhost:3000" + "/user/6"
Method: DELETE
Example
localhost:8080/user/6
{
"ID": 6,
"CreatedAt": "2022-02-04T23:46:39.8110102-05:00",
"UpdatedAt": "2022-02-04T23:46:39.8110102-05:00",
"DeletedAt": "2022-02-04T23:58:22.7753997-05:00",
"username": "MayaMattew",
"password": "Maya@123",
"firstname": "Maya",
"lastname": "Mattew",
"phone": "+1 333-22-88888"
}
Possible status: 200, 400
Message format: json
Example
Code: 200 OK
Buyers view
"localhost:8080" + "/allPosts"
Method: GET
Example
localhost:8080/allPosts
{
"Page": 1,
"TotalPages": 1,
"Products": [
{
"ID": 6,
"CreatedAt": "2022-02-21T20:41:23.0404376-05:00",
"UpdatedAt": "2022-02-21T20:41:23.0404376-05:00",
"DeletedAt": null,
"name": "Wireless Keyboard",
"description": "Keyboard with adapter",
"location": "4000 SW 37th Blvd",
"dimensions": "12*12",
"weight": 11,
"age": 2,
"count": 1,
"imageUrl": https://s3ufsebucket.s3.amazonaws.com/wireless_keyboard.jpg
},
{
"ID": 7,
"CreatedAt": "2022-02-21T20:42:46.8338981-05:00",
"UpdatedAt": "2022-02-21T20:42:46.8338981-05:00",
"DeletedAt": null,
"name": "Wooden Study Table",
"description": "Wooden table safe with kids. Very sturdy.",
"location": "2600 SW Archer Rd Apt J250",
"dimensions": "12*12",
"weight": 110,
"age": 1,
"count": 1,
"imageUrl": https://s3ufsebucket.s3.amazonaws.com/wooden_Study_table.jpg
}
]
}
Possible status: 200, 400, 401
Message format: json
Example
Pagination
"localhost:8080/allPosts?page=" + page_number
Method: GET
Example
localhost:8080/allPosts?page=1
We get the first 10 records in that page
If the page is empty:
localhost:8080/allPosts?page=100
{
"Page": 100,
"TotalPages": 1,
"Products": []
}
Possible status: 200, 400, 401
Message format: json
Example
Code: 200 OK
Get page info from script tags
localhost:8080/allPosts?page=<script>...</script>
Method: GET
Example
localhost:8080/allPosts?page=<script>alert("123")</script>
Requested page records
Possible status: 200, 400, 401
Message format: json
Code: 200 OK
Unit Testing
Used go lang package for unit testing- User Auth Tesing :
- Created functions to test login and register cases.
- Created function to login with Valid credentials , invalid credentials.
- Created function to register a user with valid details, a user with existing username(fail case)
- User CRUD operations test :
- Created functions to test fetching users by Id, name, deleting users.
- Posts CRUD opertions test :
- Created functions to test reading posts, creating , deleting and editing posts..
Place Order
- While placing orders initially we keep it in pending state and then we move it to confirmed state.
- Once we delete we move status as cancelled state
PENDING status = 0
CONFIRMED status = 1
CANCELLED status = 2
"localhost:8080" + "/placeOrder"
Method: POST
Example
localhost:8080/placeOrder
Body :{ "posts":[ { "count": 1, "productId": 2 }, { "count": 2, "productId": 3 } ] }
{
"orderId": 8,
"result": "order successfully placed!"
}
Possible status: 200, 400, 401
Message format: json
Example
Code: 200 OK
View All Orders Of All Users
"localhost:8080" + "/allorders"
Method: GET
Example
localhost:8080/allOrders
- This API is for sellers to view all the orders.
{
"Page": 1,
"TotalPages": 1,
"Orders": [
{
"ID": 1,
"CreatedAt": "2022-04-01T17:22:12.7615198-04:00",
"UpdatedAt": "2022-04-01T17:22:12.7615198-04:00",
"DeletedAt": null,
"posts": [],
"Status": 1
},
{
"ID": 2,
"CreatedAt": "2022-04-01T17:29:50.5213792-04:00",
"UpdatedAt": "2022-04-01T17:29:50.5213792-04:00",
"DeletedAt": null,
"posts": [
{
"count": 1,
"productId": 1
}
],
"Status": 1
},
{
"ID": 3,
"CreatedAt": "2022-04-01T17:35:38.8661683-04:00",
"UpdatedAt": "2022-04-01T17:35:38.8661683-04:00",
"DeletedAt": null,
"posts": [
{
"count": 1,
"productId": 1
}
],
"Status": 1
},
]
}
Possible status: 200, 400, 401
Message format: json
Example
Code: 200 OK
View Particular Order
"localhost:8080" + "/order/:orderId"
Method: GET
Example
localhost:8080/order/5
{
"ID": 5,
"CreatedAt": "2022-04-01T17:41:37.7922598-04:00",
"UpdatedAt": "2022-04-01T17:41:37.7922598-04:00",
"DeletedAt": null,
"posts": [
{
"count": 1,
"productId": 1
}
],
"Status": 1
}
Possible status: 200, 400, 401
Message format: json
Example
Code: 200 OK
Cancel Order
"localhost:8080" + "/cancelOrder/:OrderId"
It take the user id from the session.
Method: GET
Example
localhost:8080/cancelOrder/3
{
"ID": 3,
"CreatedAt": "2022-04-01T17:35:38.8661683-04:00",
"UpdatedAt": "2022-04-01T21:08:07.3701319-04:00",
"DeletedAt": null,
"posts": [
{
"count": 1,
"productId": 1
}
],
"Status": 2
}
- Status is updated to 2 - Which means order is cancelled. Possible status: 200, 400, 401
Message format: json
Example
Code: 200 OK
View all Order of the particular user
"localhost:8080" + "/orders"
It takes the user id from the session.
Method: GET
Example
localhost:8080/orders
{
"ID": 3,
"CreatedAt": "2022-04-01T17:41:37.7922598-04:00",
"UpdatedAt": "2022-04-01T17:41:37.7922598-04:00",
"DeletedAt": null,
"posts": [
{
"count": 1,
"productId": 1
}
],
"Status": 1
}
Possible status: 200, 400, 401
Message format: json
Example
Code: 200 OK
View all tags of All Posts
"localhost:8080" + "/allTags"
It takes the user id from the session.
Method: GET
Example
localhost:8080/allTags
[
"laptop",
"support",
"laptopstand",
"studylight",
"lamp",
"bulb"
]
Possible status: 200, 400, 401
Message format: json
Example
Code: 200 OK
View all tags of a particular Posts
"localhost:8080" + "/tags/:postId"
It takes the user id from the session.
Method: GET
Example
localhost:8080/tags/1
[
"laptop",
"support",
"laptopstand"
]
Possible status: 200, 400, 401
Message format: json
Example
Code: 200 OK
Search Posts by tags
"localhost:8080" + "/getProducts/:tags"
It takes the user id from the session.
Method: GET
Example
localhost:8080/getProducts/%23laptop%23bulb
{
"bulb": [
{
"ID": 2,
"CreatedAt": "2022-04-20T17:10:28.822168-04:00",
"UpdatedAt": "2022-04-20T17:10:28.822168-04:00",
"DeletedAt": null,
"name": "Study light",
"description": "Study light with 4 bulb holders",
"location": "3800 SW 34TH street",
"dimensions": "10cm",
"weight": 15,
"age": 1,
"count": 1,
"isFav": null,
"tags": "#studylight#lamp#bulb",
"imageUrl": ""
}
],
"laptop": [
{
"ID": 1,
"CreatedAt": "2022-04-20T16:56:40.7459361-04:00",
"UpdatedAt": "2022-04-20T16:56:40.7459361-04:00",
"DeletedAt": null,
"name": "Laptop Stand",
"description": "Useful to put laptop in a height and at a distance.",
"location": "4000 SW 34th St Block #733C",
"dimensions": "5 x 2 x 6 m",
"weight": 10,
"age": 1,
"count": 2,
"isFav": null,
"tags": "#laptop#support#laptopstand",
"imageUrl": ""
}
]
}
Possible status: 200, 400, 401
Message format: json
Example
Code: 200 OK