Skip to content

A sample server application built applying Domain Driven Design

Notifications You must be signed in to change notification settings

nelsonkopliku/ddd-typescript-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a79b606 · Apr 7, 2022

History

2 Commits
Apr 7, 2022
Apr 7, 2022
Apr 7, 2022
Apr 7, 2022
Apr 7, 2022
Apr 7, 2022
Apr 7, 2022
Apr 7, 2022
Apr 7, 2022
Apr 7, 2022
Apr 7, 2022
Apr 7, 2022
Apr 7, 2022
Apr 7, 2022
Apr 7, 2022
Apr 7, 2022
Apr 7, 2022
Apr 7, 2022

Repository files navigation

Cluster Node API

Getting started

System requirements

  • git
  • docker
  • docker-compose

Startup

A Makefile provides a couple of commands

$ make
Usage:
 make [target]

Available targets:
 help:            Help
 start:           starts platform
 recreate:        destroys containers and recreates platform

To startup the project just run make start. Wait a bit for the containers to start and then browse http://localhost:3000/api and you should see a Swagger UI

Screenshot

Authentication

username: john.doe
password: password
curl --request POST 'http://localhost:3000/api/v1/auth/login' \
--header 'Content-Type: application/json' \
--data-raw '{
    "username": "john.doe",
    "password": "password"
}'

it will give an access token that should be used to access other APIs

{
    "access_token": "<THE GENERATED TOKEN>"
}
curl --request GET 'http://localhost:3000/api/v1/<some endpoint>' \
--header 'Authorization: Bearer <THE GENERATED TOKEN>'
What it does

A simple API to manage nodes of computing clusters.

There are two possible types of end users for this API: an unauthenticated one, and an authenticated one. "Anonymous user" and "Privileged user" respectively. The privileged user can implicitly also do everything the anonymous user can.

  • As an anonymous user, I shall be able to access The API remotely.
  • As an anonymous user, I shall be able to read a list of features The API offers.
  • As an anonymous user, I shall be informed when trying to use a feature that is only available to privileged users.
  • As a privileged user, I shall be able to search for nodes, either by node name or by cluster name.
  • As a privileged user, I shall be able to create/read/update/delete nodes.
  • As a privileged user, I shall be able to issue power-on/shutdown/reboot commands to a single node.

About

A sample server application built applying Domain Driven Design

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published