Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fabianoleittes/code-challenge-levee

:mortar_board: Backend Engineer Code Challenge - Levee
https://github.com/fabianoleittes/code-challenge-levee

clean-architecture clean-code cleanarchitecture docker gin-gonic go golang gorilla-mux jwt-authentication logrus mongodb mongodb-database postgresql restful-api zap

Last synced: 13 days ago
JSON representation

:mortar_board: Backend Engineer Code Challenge - Levee

Awesome Lists containing this project

README

        


Code challenge Levee API


Backend Engineer Code Challenge - Levee

Testing

GitHub language count

Repository size


GitHub last commit

License

Stargazers


Status: WIP


About
Features
How it works
Tech Stack
Author
License

## About

This project is a simple API for some `Job` routines, such as creating, listing, and activate.

---

## Features

- [x] Create job
- [x] List the all jobs
- [ ] Activate the status for a specific job
- [ ] List the percentage and number of active jobs by category.
- [ ] JWT Token Based Authentication
- [x] API versioning
- [x] JSON Schema implementation
- [x] Setup scripts

---

## How it works

This project is Restful API:
1. Backend

### Pre-requisites

Before you begin, you will need to have the following tools installed on your machine:
[docker](https://docs.docker.com/install/), [docker compose](https://docs.docker.com/compose/install/), [Git](https://git-scm.com).

In addition, it is good to have an editor to work with the code like [VSCode](https://code.visualstudio.com/)

#### Running the Backend (server)

```bash

# Clone this repository
$ git clone https://github.com/fabianoleittes/code-challenge-levee

# Access the project folder cmd/terminal
$ cd code-challenge-levee

# Environment variables
$ make init

# Run the application in development mode
$ make up

# The server will start at port: 3001 - go to http://localhost:3001

# Run tests in container
$ make test

# View logs
$ make logs
```

#### API Request

Endpoint | HTTP Method | Description |
| --------------- | :---------------------: | :-----------------: |
| `/v1/jobs` | `POST` | `Create jobs` |
| `/v1/health`| `GET` | `Health check` |
---

## Test endpoints `API` using curl

- #### Creating new job

`Request`
```bash
curl -i --request POST 'http://localhost:3001/v1/jobs' \
--header 'Content-Type: application/json' \
--data-raw '{
"partner_id": "1",
"title": "Sr Ruby Dev",
"category_id": "1",
"expires_at": "2021-02-15"
}'
```

`Response`
```json
{
"id":"68de685e-3a37-431f-ba6b-dcd0076e5138",
"partner_id":"1",
"title":"Sr Ruby Dev",
"status":"draft",
"category_id": "1",
"expires_at":"2021-02-15T14:50:46Z",
"created_at":"2021-02-08T14:50:46Z"
}
```

## Tech Stack

The following tools were used in the construction of the project:

#### **API** ([Golang](https://golang.org/))

- **[Gorilla/mux](https://github.com/gorilla/mux)**
- **[Gin Web Framework](https://github.com/gin-gonic/gin)**
- **[PostgreSQL](https://www.postgresql.org/)**
- **[MongoDB](https://www.mongodb.com/)**

**Utilities**

- Commit Conventional: **[Commitlint](https://github.com/conventional-changelog/commitlint)**
- API Test: **[Insomnia](https://insomnia.rest/)**
---

## How to contribute

1. Fork the project.
2. Create a new branch with your changes: `git checkout -b my-feature`
3. Save your changes and create a commit message telling you what you did: `git commit -m" feature: My new feature "`
4. Submit your changes: `git push origin my-feature`
> If you have any questions check this [guide on how to contribute](./CONTRIBUTING.md)

---

## Author





Fabiano Leite


[![Twitter Badge](https://img.shields.io/badge/-@fabianoleittes-1ca0f1?style=flat-square&labelColor=1ca0f1&logo=twitter&logoColor=white&link=https://twitter.com/fabianoleittes)](https://twitter.com/fabianoleittes) [![Linkedin Badge](https://img.shields.io/badge/-Fabiano-blue?style=flat-square&logo=Linkedin&logoColor=white&link=https://www.linkedin.com/in/fabianoleittes/)](https://www.linkedin.com/in/fabianoleittes/)

---

## License 📝

This project is under the license [MIT](./LICENSE).

##### Made with love by Fabiano Leite 👋🏽 [Get in Touch!](Https://www.linkedin.com/in/fabianoleittes/)
---