https://github.com/brandaoplaster/api_report
mini api to generate report in csv format
https://github.com/brandaoplaster/api_report
elixir phoenix-framework
Last synced: 10 months ago
JSON representation
mini api to generate report in csv format
- Host: GitHub
- URL: https://github.com/brandaoplaster/api_report
- Owner: brandaoplaster
- Created: 2023-02-20T15:09:03.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-02T04:15:09.000Z (over 3 years ago)
- Last Synced: 2025-02-03T23:48:31.837Z (over 1 year ago)
- Topics: elixir, phoenix-framework
- Language: Elixir
- Homepage:
- Size: 93.8 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ApiReport
To start your Phoenix server:
- Create database
```
docker compose run --rm web mix ecto.create
```
- Make database migrations
```
docker compose run --rm web mix ecto.migrate
```
- Run the tests
```
docker compose run --rm web mix test
```
- Generate test coverage report
```
docker compose run --rm web mix coveralls.html
```
- Format the code
```
docker compose run --rm web mix format
```
- Run the application
```
docker compose up
```
## Endpoint List
- Endpoint can be **DailyRegistrationsByPartner** or **DailyRegistrations** - **method** POST
```
localhost:4000/api/csv_report/:report_name
```
- Endpoint to create a partner - **method** POST
```json
{
"partner": {
"name": "Dan"
}
}
```
```
localhost:4000/api/partners/
```
- Endpoint to list a partner - **method** GET
```
localhost:4000/api/partners/
```
- Endpoint to create a registration - **method** POST
```json
{
"cpf": "111.222.333-45",
"email": "Lavínia@hotmail.com",
"name": "Lavínia Pires",
"partner_id": registered partner id
}
```
```
localhost:4000/api/registrations
```
Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
Ready to run in production? Please [check our deployment guides](https://hexdocs.pm/phoenix/deployment.html).
## Learn more
* Official website: https://www.phoenixframework.org/
* Guides: https://hexdocs.pm/phoenix/overview.html
* Docs: https://hexdocs.pm/phoenix
* Forum: https://elixirforum.com/c/phoenix-forum
* Source: https://github.com/phoenixframework/phoenix