Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/netodeolino/cars-trace-ms
Cars route data microservice
https://github.com/netodeolino/cars-trace-ms
csv-reader golang microservice postgresql
Last synced: about 10 hours ago
JSON representation
Cars route data microservice
- Host: GitHub
- URL: https://github.com/netodeolino/cars-trace-ms
- Owner: netodeolino
- Created: 2022-09-02T16:52:20.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-17T13:06:16.000Z (about 2 years ago)
- Last Synced: 2024-06-22T10:01:46.528Z (5 months ago)
- Topics: csv-reader, golang, microservice, postgresql
- Language: Go
- Homepage:
- Size: 92.8 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# WIP: Cars trace microservice
### Data example
| carId | latitude | longitude | operator | stopped | lineId |
|--------|-----------:|-----------:|:--------:|:-------:|:------:|
| c7831s | -17.167034 | -40.390721 | o152 | 0 | l171 |
| c7832s | -17.509504 | -40.491718 | o252 | 0 | l172 |
| c7833s | -17.167034 | -40.390721 | o352 | 1 | l173 |### Database (Postgres)
Using command line (may need admin privileges) run the follow commands:
1. Create volume
```shell
docker volume create --name=postgresdata
```2. Pull/Run postgres pointing to the volume created before and exposing 5432 port
```shell
docker run --name postgres-db -v postgresdata:/data/db -e POSTGRES_PASSWORD=developer -p 5432:5432 -d postgres
```3. (Optional) Create database
```sql
CREATE DATABASE cars;
GRANT ALL PRIVILEGES ON DATABASE cars TO postgres;
```#### Requirements
Download and install required tools:
- Go 1.19
- Docker (can use [rancher-desktop](https://rancherdesktop.io/))
- IDE
- DBeaver (Optional)