Skip to content

Devastus/eventshuffle-api-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EventShuffle API - example

An example of a much simplified microservice API for an application to help scheduling events with friends.

Usage

Local

To launch the service by itself, first navigate to event-service folder and install the required node modules:

npm install

After that, you can launch the API in development mode with this command:

npm run dev

It 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:unit

Docker

First 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 external
docker-compose up -d

This 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 down

Deployment

GKE (Google Kubernetes Engine)

A 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.

Technologies

  • Koa.js - Node.js backend framework
  • TypeORM
  • Typescript
  • MariaDB
  • SQLite
  • Nginx
  • Docker
  • Kubernetes
  • Github Actions
  • Google Cloud

About

An example API application

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors