Skip to content

webshining/file-sharing-server

Repository files navigation

Express JS Template

Technologies used:

  • TypeScript
  • Express JS
  • TypeORM
  • PostgreSQL
  • SQLite
  • Docker and docker compose

Navigate

Getting started

Start typescript/dev app

$ git clone https://github.com/webshining/expressjs.template project_name
$ cd project_name
$ cp .env.ren .env
$ npm install
$ npm run start:dev

Build app

$ npm run build

Start javascript app

$ npm run start

Docker

Сontainer lifting

Build required (npm run build)

$ docker-compose up -d

Logs

$ docker-compose logs app
$ docker-compose logs db

Manage database container

You can change default database(default - postgres), username(default - postgres) and password(default - postgres) in docker-compose.yml

$ docker-compose exec db bash
# in container
$ psql -U postgres

Custom network name

Сreate a network (network_name: changeable(your custom network name))

$ docker network create network_name

Paste at the end of the docker-compose.yml file

networks:
    default:
        name: network_name
        external: true

Environment variables config

PORT - The port on which the server will run

DB_NAME - Database name(default: database)

DB_USER - Database username(required for PostgreSQL)

DB_PASS - Database password(required for PostgreSQL)

DB_HOST - Database host(required for PostgreSQL)

DB_PORT - Database port(required for PostgreSQL)

LOGGING - Enable/Disable database logging