Skip to content

sorathank/robinhood-assignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Robinhood Assignment

Robinhood Assignment is a simple backend system for storing and fetching interview data. The system handles descriptions, creation times, usernames, a list of comments (which includes the creation time and commenter's name), and status.

Provided Data

You can check all of the provided data in /db/data folder. The password of all users are same as the username for each account.

Example:

username: creator1

password: creator1

Tech Stack

The project utilizes:

  • Golang

  • Gin Framework

  • MongoDB

  • Redis

  • Docker (Dockerfile, Docker-compose)

Prerequisites

Ensure you have Docker and Docker-compose installed on your machine.

Installation

To run this application:

  1. Clone the repository
git  clone  https://github.com/your-username/robinhood-assignment.git
  1. Navigate to the project folder
cd  robinhood-assignment
  1. Run the Docker-compose command
docker-compose  up

This will launch the application and its associated services. The application will be accessible at localhost:8080 by default.

Please replace PORT with the correct port number which is mentioned in the .env file.

API Endpoints

Create Interview

URL: /interview

Method: POST

Body:

{
    "Description": "Test"
}

Response:

{
    "Create Interview": "Success"
}

Get Interview by ID

URL: /interview/id/:interviewId

Example: localhost:8080/interview/id/64afcc9dafab7c977749add6

Method: GET

Response:

{
   "comments": [
       //...Comments Data...
   ],
   "interview": {
       "Id": "64afcc9dafab7c977749add6",
       "Description": "Test2",
       "User": "creator1",
       "Status": "Todo",
       "CreatedTime": "2023-07-13T10:06:21.6Z"
   }
}

Get Interviews by Page

URL: /interview/page/:page

Example: localhost:8080/interview/page/1

Method: GET

Response:

[
    {
        "Id": "64afcc9dafab7c977749add6",
        "Description": "Test2",
        "User": "creator1",
        "Status": "Todo",
        "CreatedTime": "2023-07-13T10:06:21.6Z"
    }
]

Update Interview Status

URL: /interview/status

Method: PUT

Body:

{
    "InterviewId": "64afc1feafab7c977749add5",
    "Status": "In Progress"
}

Response:

{
    "Update Status": "Success"
}

OR

{
    "Update Status": "invalid status"
}

Create Comment

URL: /comment

Method: POST

Body:

{
    "InterviewId": "64afcc9dafab7c977749add6",
    "Content": "test1"
}

Response:

{
    "Create Comment": "Success"
}

Create User

URL: /user

Method: POST

Body:

{
    "username": "creator3",
    "password": "creator3",
    "email": "creator3@mail.com"
}

Response:

{
    "Create User": "Success"
}

OR

{
    "Create User": "Duplicated Username"
}

OR

{
    "Create User": "Duplicated Email"
}

User Login

URL: /login

Method: POST

Body:

{
    "username": "creator3",
    "password": "creator3"
}

Response:

{
    "result": "Login Success"
}

OR

{
    "error": "Username or Password is incorrect"
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published