- Clone or download this repository.
- Install docker (enable Linux containers - right click the docker icon in the system tray and select 'Switch to Linux containers' if already using Windows Containers).
- Update the ip address in
docker-compose.yml
to your ip. - Go to the repository root and run
docker-compose up
.
To query the api you can import Paris.postman_collection.json
. The two apis are running at localhost:3000
and localhost:3001
respectively - in future a reverse proxy could be used to allow access on a single port.
Web interfaces are available for the two databases at localhost:8081
and localhost:8082
.
Consists of two microservices:
- units (node.js)
- materials (node.js)
Both have dedicated MongoDb databases:
- units collections:
- units (primary data store)
- _id
- name
- shortName
- type (0 = length, 1 = density) - simplified
- materials (material cache for unit deletion) ** TODO **
- _id
- densityUnitId
- units (primary data store)
- materials collections:
- materials (primary data store)
- _id
- name
- externalName
- ultimateTensileStrength
- strainHardeningCoefficient
- bendingMaterialType
- density
- value
- unitId
- units (unit cache for material density validation):
- _id
- shortName
- materials (primary data store)
Inter-service communication is achieved using Apache Kafka which operates a publish-subscribe model. Example event:
{
"mode": "create",
"value": {
"_id": "8277f7c1-eabe-4774-ae80-07c97e31eeed",
"name": "kilograms per cubic metre",
"shortName": "kg/m3",
"type": 1
}
}
All endpoints are included in Paris.postman_collection.json
.
- No authentication or user management
- No concurrency checks
- Limited validation (unique name check & unit existence check is about it!)