An example of a much simplified microservice API for an application to help scheduling events with friends.
To launch the service by itself, first navigate to event-service folder and install the required node modules:
npm installAfter that, you can launch the API in development mode with this command:
npm run devIt will spin up the server with SQLite in-memory database for easy testing.
Visit http://localhost:8080/api/v1/event to access the API, or http://localhost:8080/api/v1/event/swagger to test it through Swagger.
You can run unit tests with this command:
npm run test:unitFirst make sure you have Docker and Docker Compose installed.
Navigate to the project root and use these commands to run the whole stack in Docker Compose - we need to create the external network first.
docker network create externaldocker-compose up -dThis will build the event-service image and spin it up alongside MariaDB container behind an Nginx reverse proxy.
Visit http://localhost:8080/api/v1/event to access the API, or http://localhost:8080/api/v1/event/swagger to test it through Swagger.
Run this command at project root to take down the containers:
docker-compose downA Github Action is run for every master push that builds, tests and publishes a
Docker image into Google Container Registry. Another Github Action deploys a single
Kubernetes deployment (for the sake of simplicity) of the application into GKE.
See .github/workflows and deployment/ folders for specifics respectively.
Currently, you can visit http://eventshuffle.mullikka.ml/api/v1/event to access the API running at Google Kubernetes cluster, or http://eventshuffle.mullikka.ml/api/v1/event/swagger to test it through Swagger.
- Koa.js - Node.js backend framework
- TypeORM
- Typescript
- MariaDB
- SQLite
- Nginx
- Docker
- Kubernetes
- Github Actions
- Google Cloud