Giter VIP home page Giter VIP logo

mystash's Introduction

mystash

Mystash @ duckdns

Docker repository

Install

  1. Setup postgres
  • Install Postgresql (if not yet installed), recommended version: 9.6 or higher
  • Connect to your postgresql server
  1. Setup database
create database mystashdb;
create user mystashuser with encrypted password 'changeme';
grant all privileges on database mystashdb to mystashuser;
  1. Create environment file
cp .env.example .env
  1. Set your own environment secrets!
nano .env
  1. Install packages
npm run ci
  1. Execute migrations
cd packages/mystash-backend
./node_modules/.bin/knex migrate:latest
cd ../..

Run

npm run dev

Development

Seeds creates user testi/salasana

./node_modules/.bin/knex seed:run

Deploy

Frontend

frontend build/ equals backend public/

1. npm run build # in frontend
2. mv build public
3. mv public ../mystash-backend

Production

./node_modules/.bin/pm2 start src/index.js

Docker

Build

docker build -t mystash-backend .
docker run -p 8080:8080 --name="mystash-backend" --restart="on-failure" mystash-backend

Debug

docker container exec -it mystash-backend bash
node --inspect=0.0.0.0:9229 src/index.js

Publish

docker push lahdeero/mystash-backend:tagname

Psql

Debug

psql -U mystashuser -d mystashdb
psql "postgres://mystashuser:changeme@localhost:5432/mystashdb"

docker-compose .env for dev (OUTDATED)

FRONTEND_URL=http://localhost:3000
BACKEND_URL=http://localhost:8080
CALLBACK_URL=http://localhost:8080/api/login/github/callback
DATABASE_URL=postgres://postgres:password@postgres:5432/postgres
DOCKER_DATABASE_URL=postgres://mystashuser:password@postgres:5432/mystashdb
SECRET=salaisuus
JWT_KEY=salaisuus

LOCATION=/home/lahdeero/sites/mystash-backend
NPMCOMMAND=run watchd
PORT=8080

GITHUB_CLIENT_ID=xxxxxxxxxxxxx
GITHUB_CLIENT_SECRET=xxxxxxxxxxx

In WSL1 locations was: LOCATION=/c/Sites/mystash-backend/

Build & run:

docker-compose build
docker-compose up

Connect to container:

docker container exec -it mystash-backend_backend_1 bash

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.