Skip to content

Starsky is a management application for employee scheduling.

License

Notifications You must be signed in to change notification settings

peroxy/starsky-frontend

Repository files navigation

Starsky frontend ⭐

Starsky frontend represents the website of the starsky application for employee scheduling. It uses React, Node.js and TypeScript.

Backend Java REST API is located in a repository called starsky-backend.

image

Requirements 📋

Development 💻

Running with docker 🐋

Please note that this has only been tested with docker on Ubuntu 20.04.

  1. Download frontend source files and go to docker directory:
git clone https://github.com/peroxy/starsky-frontend.git
cd starsky-frontend/docker
  1. Build and run the entire stack with docker-compose:
docker-compose up
  1. You will now be able to access:

The docker-compose.override.yml file is used for development configuration. It will bind your local starsky-frontend folder as a docker volume to enable live-reload.

Debugging

You can run and debug the frontend locally using your favorite JavaScript IDE:

  1. Run the backend REST API and database:
cd starsky-backend/docker
docker-compose up database api
  1. Run (npm run start) and debug the application with your IDE.

OpenAPI client

We are using the OpenAPI client generator library with typescript-fetch generator. TypeScript code files (using fetch) will be output to src/api/__generated__ folder.

To generate/update the client you can use the npm script specified inside packages.json:

npm run generate-api-client

Deployment 🚀

We host entire infrastructure on Azure, specifically using Azure Virtual Machine.

Please see server requirements section from starsky-backend for more information.

Repository secrets

These are the required secrets that should be stored inside Github repository secrets:

  • Dockerhub:
  • Server host (Azure VM):
    • REMOTE_HOST - remote host IP address / domain to SSH into
    • REMOTE_USER - username to SSH with
    • SERVER_SSH_KEY - private SSH key (OpenSSH, for example the contents of your ~/.ssh/id_rsa key) to connect to your server
  • Frontend:

How to deploy

Push a tag *.*.* (e.g. 1.0.3) to master branch and it will automatically deploy everything via Github workflow. See .github/main.yml workflow for more info.

In short, it does this if it gets triggered by a new tag:

  • Takes source code from master branch and extracts the newest version from tag.
  • Configures environment variables used by docker containers from Github repository's secrets.
  • Builds and pushes all apps as Docker images to DockerHub.
  • Copies environment variables and docker-compose files to Azure VM.
  • Stops starsky-frontend containers on Azure VM, pulls the newest images and starts the containers again.

About

Starsky is a management application for employee scheduling.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages