Skip to content

msal4/hassah_book_server

Repository files navigation

Hassah Book API

The backend for Hassah Book.

Requirements

Setup

  • Create a .env file
    cp .env.example .env
    set all the required variables.

Run

  • Using docker
    docker build -t <app-tag> .
    docker run -it <app-tag>
  • Without docker
    yarn
    yarn start

Deploy

  • Docker Compose
    • create a docker-compose.yml file and add your dependencies there (e.g. postgres)
    • upload to the server (e.g. using git)
    • build and run using docker-compose
  • Dokku
    • install the postgres plugin
    • create a postgres service
      dokku postgres:create <SERVICE_NAME>
      NOTE: postgres version must be 12.5 or higher.
    • create app
      dokku apps:create <APP_NAME>
    • link postgres
      dokku postgres:link <POSTGRES_SERVICE_NAME> <APP_NAME> -a TYPEORM_URL
    • using dokku config set your environment variables
      dokku config:set <APP_NAME> TYPEORM_CONNECTION=postgres JWT_SECRET=mysecret ...
    • push to dokku, for more details checkout the dokku docs
    • run the migrations
      dokku run <APP_NAME> yarn orm migration:run
    • Linking to a domain (optional):
      • change the app port to 80
          dokku proxy:ports-add <APP_NAME> http:80:<PORT> # the port in .env
      • add the domain
        dokku domains:set <APP_NAME> <DOMAIN>
        NOTE: make sure to remove the default domain/subdomain generated by dokku using
        dokku domains:remove <APP_NAME> <DOMAIN>
      • https
        dokku config:set --no-restart <APP_NAME> DOKKU_LETSENCRYPT_EMAIL=<EMAIL_ADDRESS>
        dokku letsencrypt <APP_NAME> 

About

Online bookstore backend for Hassah Book in Typescript and Graphql.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages