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.
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
The project utilizes:
-
Golang
-
Gin Framework
-
MongoDB
-
Redis
-
Docker (Dockerfile, Docker-compose)
Ensure you have Docker and Docker-compose installed on your machine.
To run this application:
- Clone the repository
git clone https://github.com/your-username/robinhood-assignment.git
- Navigate to the project folder
cd robinhood-assignment
- 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.
URL: /interview
Method: POST
Body:
{
"Description": "Test"
}
Response:
{
"Create Interview": "Success"
}
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"
}
}
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"
}
]
URL: /interview/status
Method: PUT
Body:
{
"InterviewId": "64afc1feafab7c977749add5",
"Status": "In Progress"
}
Response:
{
"Update Status": "Success"
}
OR
{
"Update Status": "invalid status"
}
URL: /comment
Method: POST
Body:
{
"InterviewId": "64afcc9dafab7c977749add6",
"Content": "test1"
}
Response:
{
"Create Comment": "Success"
}
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"
}
URL: /login
Method: POST
Body:
{
"username": "creator3",
"password": "creator3"
}
Response:
{
"result": "Login Success"
}
OR
{
"error": "Username or Password is incorrect"
}