Skip to content

nlesyuk/klim-backend

Repository files navigation

klim-backend

> npm run dev

localhost:8090/
localhost:8090/login
localhost:8090/dashboard

Set up env

All variables located in env.example

Base

PORT=8090                            # work port
IS_PROD=0                            # 1 - prod, 0 - dev
PUBLIC_DOMAIN_LOCAL=localhost        # dev domain
PUBLIC_DOMAIN_PROD=klimstepan.ca     # prod domain

DB

local

DB_LOCAL_USER=postgres
DB_LOCAL_PASSWORD=1234567890
DB_LOCAL_HOST=localhost
DB_LOCAL_PORT=5432
DB_LOCAL_DBNAME=klim

prod

DB_PROD_USER=
DB_PROD_PASSWORD=
DB_PROD_HOST=localhost
DB_PROD_PORT=5432
DB_PROD_DBNAME=

TODO:

    • Add user_id column for each table
  1. swagger doc
  2. ESlint
  3. Prettier
  4. unit testin with Jest

Swagger

doc for api

how to deploy in EC2 instance

sudo apt-get update

// install n

curl -L https://raw.githubusercontent.com/tj/n/master/bin/n -o n bash n lts npm install -g n

// install https://pm2.keymetrics.io/docs/usage/pm2-doc-single-page/

npm install pm2@latest -g

// nginx config - see Cribs.md configs placed in ./config folder

sudo apt install nginx sudo nginx -t sudo service nginx restart

// Firewall Setup https://itnext.io/deploy-a-nodejs-and-expressjs-app-on-digital-ocean-with-nginx-and-free-ssl-edd88a5580fa

sudo ufw enable sudo ufw allow http sudo ufw allow https sudo ufw allow ssh

// install postgres

sudo apt install postgresql -y sudo su - postgres psql postgres=# CREATE ROLE ubuntu; postgres=# ALTER ROLE ubuntu WITH LOGIN; postgres=# ALTER USER ubuntu CREATEDB SUPERUSER; postgres=# ALTER USER ubuntu WITH PASSWORD 'password'; postgres=# \du postgres=# CREATE DATABASE klim; postgres=# \l postgres=# \c klim postgres=# HERE_YOU_SHOULD_INSERT_TABEL_SCHEME create TABLE users(...) postgres=# \d postgres=# ALTER USER "user" with superuser; psql=# grant all privileges on database to ; psql=# alter user with encrypted password ''; psql=# grant all privileges on database to ;

// create folders /public/uploads/klimstepan.com...

// set up .env

// pull git repo

About

Backend for cinematographer's portfolio!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published