data-processing
A modern application API built with Go and asynchronous CSV processing
Before running the application, make sure you have the following installed:
- Go 1.21 or higher
- PostgreSQL
- Golang Migrate
git clone https://github.com/arfian/data-processing.git
cd data-processingCreate a .env file in the root directory, you can copy value .env.example
WORKER_COUNT=5
BATCH_SIZE=20
DATABASE_URL=
SERVER_PORT=8088#mac
$ brew install golang-migrate
#linux
$ curl -L https://github.com/golang-migrate/migrate/releases/download/$version/migrate.$platform-amd64.tar.gz | tar xvz$ make migrateup$ make migratedown$ make run $ go mod download
$ go run main.go $ make test The API documentation is available in Postman format. Import the following files into Postman:
postman/Data Process.postman_collection.json
- CSV
- POST
/api/v1/csv/process- User registration
- POST
.
├── config/ # Setup config register env application
├── csv/ # Folder File CSV
├── docs/ # Generate docs API swagger
├── internal/ # Code with internal system
│ ├── delivery/ # Bussiness domain
│ ├── ├── http/ # Logic handle API logic
│ ├── domain/ # List all interface domain
│ ├── repository/ # Logic query SQL
│ ├── usecase/ # Business logic implementation
└── migrations/ # Generate code migration database
└── pkg/ # code package helper logic
└── postman/ # Postman collection and environment
- Golang
- Gorm
- golang-migrate
- Swaggo
- Gin
- PostgreSQL
localhost:8089/swagger/index.html