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

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

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

backend docker insomnia jwt postgresql rails ruby solid-principles tdd

Last synced: 6 months ago
JSON representation

🎓 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
- [x] Activate the status for a specific job
- [x] List the percentage and number of active jobs by category.
- [x] 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-ruby

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

# building the project
$ docker-compose build

# Run the application in development mode
$ docker-compose up

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

# Run tests in container
$ docker-compose run --rm api bin/rspec spec

```

#### API Request

### Signup/Login

| URL / ENDPOINT | VERB | DESCRIPTION |
| ----------------------- | ---- | ---------------- |
| /v1/signup | POST | Create user |
| /v1/auth/login | POST | Generate token |

### Jobs
| URL / ENDPOINT | VERB | DESCRIPTION |
| ----------------------- | ---- | ---------------- |
| /v1/jobs | POST | Create Job |
| /v1/jobs | GET | Returns all Job |
| /v1/jobs/:id | PUT | Update Job Status |
| /v1/category/:id | GET | List percentage |
---

## Test endpoints `API` using Insomnia


Run in Insomnia

---
## Tech Stack

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

#### **API** ([Ruby on Rails](https://rubyonrails.org/) + [PostgreSQL](https://www.postgresql.org/))

- **[rspec](https://github.com/rspec/rspec-rails)**
- **[Factory Bot](https://github.com/thoughtbot/factory_bot_rails)**
- **[Shoulda Matchers](https://github.com/thoughtbot/shoulda-matchers)**
- **[JWT](https://github.com/jwt/ruby-jwt)**
- **[ffaker](https://github.com/ffaker/ffaker)**
- **[Rack Cors](https://github.com/cyu/rack-cors)**

> See more [Gemfile](https://github.com/fabianoleittes/mob2con-challenge-ruby/blob/main/Gemfile)

**Utilities**

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

## 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/)
---