Giter Club home page Giter Club logo

hatsuportal's Introduction

hatsuportal

Development environment installation (Windows)

Running development environment

  • Navigate to project root
  • Run sh install.sh (installs node packages for all projects, needed so that volume mount won't override projects and delete node_modules folders and runs docker-compose up)
  • (on windows run docker-volume-watcher, see http://blog.subjectify.us/miscellaneous/2017/04/24/docker-for-windows-watch-bindings.html for more info)
  • http://localhost/docs/ should now answer with swagger documentation
  • http://localhost:8080/ should now answer with PostgreSQL Adminer. (see credentials from docker-compose.yml)
  • http://localhost should now answer with React UI
  • DISCLAIMER: note that in the API project, nodemon only updates dependency changes trough the ./src/server.ts inclusion hierarchy (see nodemon.json file), but does not run for example commands like tsoa swagger or tsoa routes. To make sure all changes are deployed to server, run yarn build, docker-compose down and finally docker-compose up to generate all files and deploy them to the server.

Destroying development environment

  • Navigate to project root
  • Run sh uninstall.sh (removes node_modules folders, kills and destroys all docker containers, deletes all images and removes all not used volumes.
  • DISLAIMER: If you have other docker projects on your machine, this will destroy them too!!

Using SwaggerUI

  • Navigate to http://localhost/docs/
  • Open any of the API descriptions and press the Try it out button on the right side.
  • SwaggerUI will generate a placeholder request for you. Pressing the Execute button will send the request.
  • Some of the API requests require a Json Web Token https://jwt.io/ and will respond with 401 Unauthorized without a proper jwt in the client cookies.
  • Login to the application using the login POST request (find it in the API listing under Auth)
  • Both test users jykajee and Mister Thane use the password root
  • Login response will set a cookie named token which then will be be sent to server on all subsequent requests
  • Use logout POST request (also under Auth) to remove the cookie

Docker cheatsheet

  • docker ps lists all running docker containers
  • docker image ls lists all downloaded images
  • docker volume ls lists all the volumes
  • docker rm <container id> deletes a container
  • docker rmi <image id> deletes an image
  • docker kill $(docker ps -q) kills all running containers
  • docker rm $(docker ps -a -q) deletes all stopped containers
  • docker rmi $(docker images -q) deletes all images
  • docker volume prune removes all dangling volumes
  • docker build -t <friendlyname> builds a docker image with specified name
  • docker run -p <hostport>:<containerport> <friendlyname> run a docker image and publish a port to host
  • docker stop <container ID> stops the container (find the id with docker ps)
  • docker exec -it <container ID> /bin/bash
  • docker-compose up -d starts the containers and detaches from run command after finished
    • on windows, remember to share the drive that you are developing on, with docker
  • docker-compose down stops all running containers
  • docker-compose restart <worker> restarts a single container within docker-compose

Troubleshooting

$ docker-volume-watcher
WARNING:root:No mounts match container name pattern * and host directory pattern *

  • SOLUTION: you have not started docker-compose with docker-compose up

hatsuportal's People

Contributors

lassemon avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

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.