https://github.com/fabianoleittes/mob2con-challenge
Backend engineer challenge
https://github.com/fabianoleittes/mob2con-challenge
docker jwt-authentication postgresql rails ruby
Last synced: 3 months ago
JSON representation
Backend engineer challenge
- Host: GitHub
- URL: https://github.com/fabianoleittes/mob2con-challenge
- Owner: fabianoleittes
- Created: 2020-10-07T16:00:04.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-05-01T16:37:51.000Z (about 2 years ago)
- Last Synced: 2025-02-04T15:49:28.957Z (over 1 year ago)
- Topics: docker, jwt-authentication, postgresql, rails, ruby
- Language: Ruby
- Homepage:
- Size: 116 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mob2ConLabs API
 [](https://codeclimate.com/github/fabianoleittes/mob2con-challenge/maintainability)
🚧 Mob2ConLabs API em construção 🚀 🚧
Sobre •
Funcionalidades •
Como executar •
Tecnologias
•
Autor •
Licença
## đź’» Sobre o projeto
Mob2ConLabs - Ă© um API Restful feita como teste para a vaga de backend engineer.
---
## ⚙️ Funcionalidades
- [x] RESTful API
- [x] JSON Schema implementation
- [x] RSpec testing
- [x] Setup scripts
- [x] Usage of http methods/verbs
- [x] Structured endpoints
- [x] Return appropriate status code
- [x] JWT Token Based Authentication
- [x] API versioning
- [x] API subdomain
- [x] O administrador pode gerenciar Redes Varejistas (crud) para dar entrada em novos clientes.
- [x] O administrador pode pesquisar redes varejistas pelo nome para ter acesso as informações.
- [x] O administrador pode gerenciar visiantes (crud) de cada rede para que mais pessoas utilizem o sistema.
- [x] O administrador pode enviar fotos dos visitantes para identificá-los.
- [x] O administrador pode pesquisar visitantes por nome para ter acesso as informações.
- [x] Usuário da rede pode se deslogar no sistema.
- [x] Usuário da rede pode fazer login
- [x] Usuário da rede pode registrar entradas e saidas de visitantes.
- [x] Usuário externo, não autenticado, pode ver o número total de redes e seus visitantes.
---
## 🚀 Como executar o projeto
Este projeto Ă© uma API Restful:
1. Backend
### Pré-requisitos
Antes de começar, você vai precisar ter instalado em sua máquina as seguintes ferramentas:
[docker](https://docs.docker.com/install/) e [docker compose](https://docs.docker.com/compose/install/)
#### 🎲 Rodando a API (servidor)
```bash
# Clone este repositĂłrio
$ git clone https://github.com/fabianoleittes/mob2con-challenge.git
# Acesse a pasta do projeto no terminal/cmd
$ cd mob2con-challenge
# Instalando as dependências e Execute a aplicação em modo de desenvolvimento
$ docker-compose up --build
# O servidor inciará na porta:3000 - acesse http://api.dev.local:3000
# Rodando dos testes
$ docker-compose run --rm api bundle exec rspec
# Criando simples dados para ambiente de development
$ docker-compose run --rm api bundle exec rake dev:prime
```
## Endpoints
### Login
| URL / ENDPOINT | VERB | DESCRIPTION |
| ----------------------- | ---- | ---------------- |
| /v1/signup | POST | Create user |
| /v1/auth/login | POST | Generate token |
### Retail Chains
| URL / ENDPOINT | VERB | DESCRIPTION |
| ----------------------- | ---- | ---------------- |
| /v1/admin/retail_chains | POST | Create Retail Chains |
| /v1/admin/retail_chains | GET | Return all Retail Chains |
| /v1/admin/retail_chains/:id | PUT | Update Retail Chain |
| /v1/admin/retail_chains/:id | GET | Show Retail Chain |
| /v1/admin/retail_chains/:id | DELETE | Destroy Retail Chains |
### Visitors
| URL / ENDPOINT | VERB | DESCRIPTION |
| ----------------------- | ---- | ---------------- |
| /v1/admin/retail_chains/:id/visitors | POST | Create Visitor |
| /v1/admin/retail_chains/:id/visitors | GET | Return all Visitors |
| /v1/admin/retail_chains/:id/visitors:id | PUT | Update Visitor |
| /v1/admin/retail_chains/:id/visitors/:id | GET | Show Visitor |
| /v1/admin/retail_chains/:id/visitors/:id | DELETE | Destroy Visitor |
### Visits
| URL / ENDPOINT | VERB | DESCRIPTION |
| ----------------------- | ---- | ---------------- |
| /v1/visitors/:id/visits | POST | Create Visits |
| /v1/visitors/:id/visits | GET | Return all Visits |
### Summaries
| URL / ENDPOINT | VERB | DESCRIPTION |
| ----------------------- | ---- | ---------------- |
| /v1/retail_chains/summaries | GET | Retail Chain summaries |
---
## đź› Tecnologias
As seguintes ferramentas foram usadas na construção do projeto:
#### **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)**
> Veja o arquivo [Gemfile](https://github.com/fabianoleittes/mob2con-challenge/blob/main/Gemfile)
#### Utilitários
- Conventional commits: **[Commits](https://www.conventionalcommits.org/en/v1.0.0/)**
- Teste de API: **[Insomnia](https://insomnia.rest/)**
---
## Autor
[](https://twitter.com/fabianoleittes) [](https://www.linkedin.com/in/fabianoleittes/)
---
## 📝 Licença
Este projeto esta sobe a licença [MIT](./LICENSE).
Feito com ❤️ por Fabiano Leite 👋🏽 [Entre em contato!](https://www.linkedin.com/in/fabianoleittes/)
---