Imagine you are a bike courier and you want to build a system that will help you track your rides during delivery of packages: how many kilometers did you ride on each day and how much did customer pay for delivery. The app will help you to control your work.
The repository has many methods to use it locally, the recommended method is to use docker-compose and set up the entire environment in containers, although you can also build the application locally on your machine (this is a slower way).
Docker Compose is the recommended method of using the application, it allows you to build and connect all the required
services for the application to function. Use the following commands to set up docker-compose.yml
on your local
machine.
git clone git@github.com:keinsell/bikeramp.git && cd bikeramp
cp example.env .env
docker-compose up -d
docker exec -it bikeramp-server yarn db:push
# Voila! Application is running at http://localhost:1337
In case you do not want to pull repository you can pull image from GitHub Package Registry
ghcr.io/keinsell/bikeramp:latest
, there is still need for executing docker exec -it bikeramp-server yarn db:push
to
migrate database - here is example of docker-compose.yml
that you can use.
version: '3.7'
services:
server:
restart: 'on-failure'
depends_on:
- postgres
container_name: bikeramp-server
image: ghcr.io/keinsell/bikeramp:latest
ports:
- '1337:3000'
environment:
DATABASE_URL: postgres://root:aamEnrMM9Qq42On1dE8MWwp-9epAyRODgzrOZmWHySHg_2t2Ysp563TlMFfnp55u@postgres:5432/bikeramp
postgres:
container_name: bikeramp-postgres
image: postgres:latest
ports:
- '5432:5432'
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: aamEnrMM9Qq42On1dE8MWwp-9epAyRODgzrOZmWHySHg_2t2Ysp563TlMFfnp55u
POSTGRES_DATABASE: bikeramp
In the case of running the application in a local environment pay attention to the configuration in .env
and use the
available PostgresSql database, additionally your machine should contain the software listed below:
node@v18.12.1
yarn@1.19.2
git clone git@github.com:keinsell/bikeramp.git && cd bikeramp
cp example.env .env
yarn install
yarn build
yarn db:push
node dist/main.js
# Voila! Application is running at http://localhost:1337
Applicaiton provides build-in OpenAPI 3.0 Documentation available at baseUrl
, so if your application in running on
localhost:1337
it should be available by http://localhost:1337
.
I'm too lazy for that, sorry.