https://github.com/silvergama/streetfair
Street Fair is an information center for street fairs in the city of São Paulo.
https://github.com/silvergama/streetfair
clean-architecture cmd docker docker-compose go golang makefile
Last synced: 5 months ago
JSON representation
Street Fair is an information center for street fairs in the city of São Paulo.
- Host: GitHub
- URL: https://github.com/silvergama/streetfair
- Owner: silvergama
- Created: 2021-08-18T02:12:57.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-09-04T17:51:20.000Z (almost 3 years ago)
- Last Synced: 2024-11-16T00:43:11.037Z (over 1 year ago)
- Topics: clean-architecture, cmd, docker, docker-compose, go, golang, makefile
- Language: Go
- Homepage:
- Size: 375 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://sonarcloud.io/summary/new_code?id=silvergama_streetfair)
[](https://sonarcloud.io/summary/new_code?id=silvergama_streetfair)
[](https://sonarcloud.io/summary/new_code?id=silvergama_streetfair)
[](https://sonarcloud.io/summary/new_code?id=silvergama_streetfair)
[](https://sonarcloud.io/summary/new_code?id=silvergama_streetfair)
# Street Fair

The objective of this project is to centralize information about street fairs in the city of São Paulo.
## Running
This app is written in Golang. If you don't have experience with it: https://golang.org/doc/install.
It depends on a Golang version with module support (at least 1.11, latest version is recommended).
Should you interoperate with Golang versions >= 1.11, don't forget to proper set your _GO111MODULE_ environment variable (https://dev.to/maelvls/why-is-go111module-everywhere-and-everything-about-go-modules-24k)
### Install deps
- Install `docker` and `docker-compose`
*Attention*: you should first set `$GOBIN` environment variable, add it to the `$PATH`, and then run the commands bellow:
# How to Run
* **Install dependencies**
``` bash
$ make clean install
```
* **To running local dependencies** if you want to run the application using local dependencies with docker, run the command below before running the API
``` bash
$ make deps/up
```
* **To run import CSV**
``` bash
$ make run/import file=docs/example.csv
```
* **To stop**
``` bash
$ make deps/down
```
* **To run API**
``` bash
$ make run/api
```
* **To help**
``` bash
$ make help
```
## Test coverage
* **To generate**
``` bash
$ make coverage
```
* **To show in browser**
``` bash
$ make coverage-html
```
## Runing tests
Just run:
``` bash
$ make test
```
# Log
All logs are stored in the fair.log file.
* **To show logs:**
``` bash
$ make show/logs
```
Then commit the contents of `docs/swagger` dir.
# Swagger
When change/add any HTTP API stuff, just run:
``` bash
$ make swagger/api
```
Then commit the contents of `docs/swagger` dir.
# Docker
This tasks below are used from CircleCI flow but FTW:
Generate `test` image to run tests and coverage:
```sh
make docker/build
```
With the `test` image we can run test and coverage inside CircleCI:
```sh
make docker/test
make docker/coverage
```
Generate final image getting binary from `test` image:
```sh
make docker/image
```