Skip to content

Latest commit

 

History

History
539 lines (370 loc) · 10.8 KB

Sprint1.md

File metadata and controls

539 lines (370 loc) · 10.8 KB

First Assignment(Sprint_1) status

GatorGiveaway

Generally, all the giveaways and sales of old stuff happen in WhatsApp groups. There are many groups, and it's very hard to keep track of those groups and posts. The idea is to provide a web-application for such sales and giveaway stuff. It's basically an eBay clone for UF.

React JS UI Progress

  • Added boilerplate template for the front end.
  • Added signup and signin pages for user.
  • Added a page to view posts.
  • Also added modals for edit, delete and creating the posts in the view posts page.
  • Integrated all the pages with the backend APIs and also maintaing the user session.

Go-Lang backend progress

  • Added boilerplate template for the back-end.
  • Using Gin Web Framework and GORM library.
  • Created APIs for giveaway post CRUD operations for sellers.
  • Created APIs for user CRUD operations.
  • Maintaing user sessions

Video Links:

Api documentation of backend services

Login

Target URL

"localhost:3000" + "/login"

Request

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

Response

{ "result": "login success" } Possible status: 200, 400, 401

Message format: json

Example

Code: 200 OK

login_success

Register

Target URL

"localhost:3000" + "/register"

Request

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

Response

{ "result": "registration success" } Possible status: 200, 400, 401

Message format: json

Example

Code: 200 OK

register_success

Logout

Target URL

"localhost:3000" + "/logout"

Request

Method: POST

Field { "result": "logout success" } Possible status: 200, 400, 401

Message format: json

Example

Code: 200 OK logout_success

Create Post

Target URL

"localhost:3000" + "/create"

Request

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

Response

{ "result": "post creation success" } Possible status: 200, 400, 401

Message format: json

Example

Code: 200 OK

create_success

Edit post

Target URL

"localhost:3000" + "/update/<post_id>"

Request

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 }

Response

{ "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, 401

Message format: json

Example

Code: 200 OK

update_success

Delete post

Target URL

"localhost:3000" + "/delete/<post_id>"

Request

Method: DELETE

Example

localhost:8080/delete/5

Response

{ "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, 401

Message format: json

Example

Code: 200 OK

delete_success

Get posts

Target URL

"localhost:3000" + "/read"

Request

Method: GET

Example

localhost:8080/read

Response

Possible status: 200, 400, 401

Message format: json

Example

Code: 200 OK

read_success

User operations
Get Users

Target URL

"localhost:3000" + "/users"

Request

Method: GET

Example

localhost:8080/users

Response

  [
    {
        "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

Target URL

"localhost:3000" + "/register"

Request

Method: POST

Example

localhost:8080/users

Input

{
   "username": "superuser1",
   "password": "Super@123",
   "firstname": "Super",
   "lastname": "User",
   "phone": "+1(111)-11-11111"
}   

Response

{
    "result": "registration success"
}

Possible status: 200, 400

Message format: json

Example

Code: 200 OK

  <details>
Delete User

Target URL

"localhost:3000" + "/user/6"

Request

Method: DELETE

Example

localhost:8080/user/6

Response

{
    "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

User Registration: To register your account, first route to localhost:3000, then click on "Register" button. You need to fill username and password fields and then submit. If you input something wrong, you'll get notified at the top of the page, or if you register successfully, you'll automatically redirected to login page.

Fields in signup form that needs your notice:

Username: Has to be unique, which means you can not register with a username that has already been taken, and case sensitive. Password: Must contains figure, uppercase letter, lowercase letter, and a special sign, and total length should be at least 9.

Login: Route to localhost:3000/login, input your registered username and password, and sign in. After signing in, you'll see home page to view the giveaway posts.

Home Page: In home page, we have a logout and create post buttons in the top-left. In cards, all the giveaway posts are displayed wich can be editted and deleted.

Useful links of the project

Hosted on AWS: