Its-Alex / flatsharing

FlatSharing backend made for roommate

Home Page:https://flatsharing.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status codecov

FlatSharing backend repository at http://flatsharing.io

Requirements

  • make
  • docker
  • direnv (optional)

If you don't want to get direnv you can source .envrc each time you open a new shell session

$ source .envrc

This repo use new go module feature, please read how it works before start

You need nothing special in your host, this project use docker to dev/build

In this project I tried to follow this template

Environments variables

All services have some environments variables to change some dynamics values (usefull to setup and scale).

All variables for all services all listed in docker-compose.yml

Get started

To up all services

$ make up

Then all services run in a container

You can fetch service with shared port in docker-compose.yml

When you build a service it's auto-refreshed in the container

There are global rule that works for all services

$ make build

This command will build all current services that can be build

You can stop project (containers) with this command:

$ make down

How to dev

There are a container workspace that is used to work inside it

Some makefile commands must be executed inside or outside this container, it will display a message if your wrong about where you execute a command.

There is a rule to install dependencies inside container

$ make dep

So if you need to add a binary for the project see here or you can add it when container builds in Dockerfile

To enter inside workspace please use:

$ make enter

This command patch some annoying bugs. Same to entrer inside database

$ make enter-postgresql

This project use gRPC you can find code in src folder and proto files in src/protobuf. There are commands to build proto

$ make protoc-${service}

Same to build go code

$ make build-${service}

You can check if tests failed:

$ make test

You can see if the linter pass:

$ make lint

Same for coverage:

$ make coverage

Migrations

All databases migrations are defined in assets/migrations folder

You will find a up and down, they are used by migrate

To apply all migrations:

$ make migrate

License

MIT

About

FlatSharing backend made for roommate

https://flatsharing.io

License:GNU General Public License v3.0


Languages

Language:Go 67.3%Language:JavaScript 10.0%Language:HTML 9.6%Language:Makefile 8.0%Language:Dockerfile 4.7%Language:TSQL 0.3%Language:Shell 0.1%