Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Technical Assignment #362

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 29 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,33 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

# Test binary, built with `go test -c`
*.test
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

# Output of the go coverage tool, specifically when used with LiteIDE
*.out
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

# Dependency directories (remove the comment below to include it)
# vendor/
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

out/

.idea
### VS Code ###
.vscode/
Binary file added .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
2 changes: 2 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
82 changes: 58 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,66 @@
### Requirements
## About The Project

- Implement one single API which accepts a todo task and records it
- There is a maximum **limit of N tasks per user** that can be added **per day**.
- Different users can have **different** maximum daily limit.
- Write integration (functional) tests
- Write unit tests
- Choose a suitable architecture to make your code simple, organizable, and maintainable
- Using Docker to run locally
- Using Docker for database (if used) is mandatory.
- Write a concise README
- How to run your code locally?
- A sample “curl” command to call your API
- How to run your unit tests locally?
- What do you love about your solution?
- What else do you want us to know about however you do not have enough time to complete?
Simple REST API Todo List Application.

### Notes
List supported features:
- Create new todo
- Get list todo
- Get list user
- Get user detail

- We're using Golang at Manabie. **However**, we encourage you to use the programming language that you are most comfortable with because we want you to **shine** with all your skills and knowledge.
## Prerequisites

### How to submit your solution?
- `Java 17+`
- `Docker`
- `Docker-compose`

- Fork this repo and show us your development progress via a PR
## Get Started

### Interesting facts about Manabie
### Setup environment

- Monthly there are about 2 million lines of code changes (inserted/updated/deleted) committed into our GitHub repositories. To avoid **regression bugs**, we write different kinds of **automated tests** (unit/integration (functionality)/end2end) as parts of the definition of done of our assigned tasks.
- We nurture the cultural values: **knowledge sharing** and **good communication**, therefore good written documents and readable, organizable, and maintainable code are in our blood when we build any features to grow our products.
- We have **collaborative** culture at Manabie. Feel free to ask [email protected] any questions. We are very happy to answer all of them.
```shell
docker-compose up -d
```

Thank you for spending time to read and attempt our take-home assessment. We are looking forward to your submission.
### Run project

```shell
./mvnw spring-boot:run -DskipTests=true
```

### Sample Curls

**NOTE:**
Created 1 user for testing purposes:

```shell
id: 1, name: 'uuhnaut69', limit_config: 10
```

Create new todo:

```shell
curl -H "Content-Type: application/json" -X POST -d '{"task":"Do assignment","userId": 1}' http://localhost:8080/todos
```

**NOTE:** Full API documentation can visit [here](http://localhost:8080/swagger-ui/index.html#/)

### Testing

For running Unit Tests:

```shell
./mvnw test
```

For running Integration Tests:

```shell
./mvnw verify -Pintegration
```

### Todo

- [ ] Authentication
- [ ] User limit configuration
- [ ] Web Interface
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: "3.7"

services:
postgres:
container_name: postgres
image: postgres
ports:
- "5432:5432"
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
restart: on-failure
Loading