Skip to content

Commit

Permalink
updated the readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
dutradda committed Apr 30, 2018
1 parent d377e3a commit f37b85a
Showing 1 changed file with 98 additions and 2 deletions.
100 changes: 98 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,98 @@
# ll-employee-manager
Luizalabs Employee Manager Challenge Application
# LuizaLabs Employee Manager Challenge Application
[![Build Status](https://travis-ci.org/dutradda/ll-employee-manager.svg?branch=master)](https://travis-ci.org/dutradda/ll-employee-manager) [![Coverage Status](https://coveralls.io/repos/github/dutradda/ll-employee-manager/badge.svg?branch=master)](https://coveralls.io/github/dutradda/ll-employee-manager?branch=master)

## This is a simple application to manage employees.

The application uses a Makefile to support the development and run docker commands.

- Running the tests:

```shell
$ make integration
```

- Serving the application for development:

```shell
$ make dev-server
```

- Only running the `make` command will run the integration and after the dev-server rules.

```shell
$ make
```

- Running the deployment version of the server (with gunicorn):

```shell
$ make run-deploy
```

- Running the develop environment with a new database:

```shell
$ mv db.sqlite3 db.sqlite3.bkp && \
make dev-migrate && \
make dev-superuser && \
make dev-server
```

### Features

- Private endpoints for `write` access (the users are the same of the django admin)
- Public endpoints for `read-only` access
- Email validation


### API Examples

- Adding a new employee (with the default database):
```shell
$ curl -H 'Content-Type: application/json' -X POST -u admin:password123 '127.0.0.1:8000/employee' -d '
{
"name": "Diogo",
"email": "diogo@luizalabs.com",
"department": "Architecture"
}'
```

- Getting the employees:
```shell
curl '127.0.0.1:8000/employee'
[
{
"name": "Arnaldo Pereira",
"email": "arnaldo@luizalabs.com",
"department": "Architecture"
},
{
"name": "Renato Pedigoni",
"email": "renato@luizalabs.com",
"department": "E-commerce"
},
{
"name": "Thiago Catoto",
"email": "catoto@luizalabs.com",
"department": "Mobile"
},
{
"name": "Diogo",
"email": "diogo@luizalabs.com",
"department": "Architecture"
}
]
```

- Trying to add a employee without credentials:
```shell
$ curl -H 'Content-Type: application/json' -X POST '127.0.0.1:8000/employee' -d '
{
"name": "Diogo",
"email": "diogo@luizalabs.com",
"department": "Architecture"
}'
{
"detail": "Authentication credentials were not provided."
}
```

0 comments on commit f37b85a

Please sign in to comment.