- git 2.7
- docker 18+
- docker-compose 1.21+
- nodejs LTS
codegen
- config and templates for openapi-based app generatorconfig
- node-config configuration filesdocker
- docker compose related fileslib
- project sourcesservices
- rest api services (partially implemented)migrations
- knex migrationsddl
- pure sql migrationsscripts
- scripts for dockerized setupspec
- openapi specificationwebapp
- auto-generated code for openapi-backed application server
- OpenAPI covers all data structures and preliminary checks
- Specification allows easy stub generation from a specification with pre-defined implementation
- Generated code checks for a live implementation in
lib/services
and falls back to stubs if no service is available - All services are independent from the application server and operate in terms of return values and thrown exceptions
Prepares all necessary resources and runs application
npm run prepare
- builds specification and created server stubnpm start
- runs application
Runs applicaiton within docker container
cd docker && docker-compose up -d
For all tests provided uuid values should be updated to existing ones
Swagger API
curl -X GET "http://localhost:8082/v1/books?limit=2&offset=10&sort=\[\{\"field\":\"name\",\"dir\":\"asc\"\}\]&group=\[\"title\"\]" -H "accept: application/json"
curl -X GET "http://localhost:8081/v1/books/30171801-04ad-4d7d-8064-b0ebf5ccd573?a=b" -H "accept: application/json"
curl -X POST "http://localhost:8082/v1/books" -d '{"title":"Test Book","date":"2001-02-12","authors":["d315c298-00d1-482d-9847-86a0e7d1f47e","72682938-2188-47c6-b2b4-a059afce235a"]}' -H 'Content-Type: application/json' -H 'Accept: application/json'
curl -X PUT "http://localhost:8082/v1/books/30171801-04ad-4d7d-8064-b0ebf5ccd573" -d '{"title":"T00d1-482d-9847-86a0e7d1f47e", "72682938-2188-47c6-b2b4-a059afce235a"]}' -H 'Content-Type: application/json' -H 'Accept: application/json'