This server consists of:
- a Node.js backend exposing a REST API written with the Express library;
- an Angular frontend (i.e. the website), and;
- a Postgres database.
This (very) rough sketch outlines the interaction between the client (the user's iOS device) and this server,
plus interaction with Apple.
Before development, you need to:
- clone this repository to your machine;
- install Postgres on your machine, create yourself a user and database, and start the server, and;
- set the
DATABASE_URL
environment variable to reference your local database by runningexport DATABASE_URL=postgres://$(whoami)@localhost:5432/$(whoami)?sslmode=disable
from the terminal.
- The developer pushes changes to GitHub.
- The GitHub CI action runs all unit tests.
- If all tests have succeeded, Heroku builds and deploys the server.
Execute using npm run command-name
from the terminal.
Build the frontend static files to dist/
, where they can be served by the backend.
Runs automatically after npm install
, in order to deploy using Heroku.
Serve only the frontend at http://localhost:4200, hot-reloading after code changes.
Useful for frontend development when the backend is not required.
Start the backend and frontend at http://localhost:8080 serving both the API endpoints and the frontend.
Can be run locally for development or by Heroku for production.
Open a Chromium browser, run unit tests and display the results.
Tests are re-run after code changes.
Run unit tests without opening a browser, while using Chrome in the background.
Used by GitHub for continuous integration (CI).
Format all files in the project.
The server can be deployed into production from the terminal using the Heroku CLI.