-
This project is an API that simulates data manipulation, through lib
OZmap SDK, it must be possible to make a searching on a specific collection data throughidandtarget. -
Get Automaticaly data from a
json-serverdatabase, it's possible toscheduleatimerordateto set the frequency of it. -
Transfor the data at the previous step, to a valid
OZmap SDKstandard. -
Send the data at previous step to
OZmap SDK, using the lib and simulating the real usage. -
Save all the synchronized data at the previous step in a
MONGODBtrougthPrismaandDocker. -
It's possible to save all the logs of successful and fail operations in a
filethrough libwinston.
- Typescript
- Nodejs in version v20.18.0 (LTS)
- Express
- OZmap SDK
- Docker
- MongoDb
- Prisma
- Json-server
- Node-schedule
- Tsyringe
- Winston-logger
- Use an http request provider such as
InsomniaorPostmanand even theThunderClientextention on vscode IDE to create all the follow endpoints, to be able to test the app.
-
Make sure that all the enviroment variables is filled with the rigth configurations, you can rename this file after do it from
.env.exampleto.env, or create a new one ........... it is veryIMPORTANTto the all the stuffs working well. -
IMPORTANT.... Please before runnnig and testing all the endpoints of the app,DELETEthese 2 filesbase_data.jsonandozmap_output.json, fromsrc/utils/copy-mock-database, they will be created again when you start to running the endpoints ... I justed put them away for example of the work done.
-
For running the application at the following endpoints
getData\:idandgetAutoData, you don't need to run thedockercontainer, just split your terminal windown and runyarn devto start the app, and the original database of the challenge with the follow commandyarn json:server:origindb. -
For running the application at the following endpoints
tranformDataandsendDataToOZmapyou don't need to run thedockercontainer, just split your terminal windown and runyarn devto start the app, and the processed database datayarn json:server:ozmap_output. -
For the last endpoint
saveDataAtDB, you need to runyarn dc:upto run the docker ... wait until finish, then in another terminal windown runyarn setup:prisma, for prepere prisma to app .... wait until finish, then runyarn devto start the app ... finally in other terminal windown runjson:server:ozmap_output. -
For check the datas saved at
mongodbwith all the previous steps running, .... then runnpx prisma studio, this is going to open a brownser windonw with the interface tool ofprisma studio, that's able to manipulate the datas through the database.
- This app was created as the same as
MVCarchitecture, trying to keep the good organization and responsability of the layers, to make easy to give maintenance and to be able to implement new stuffs as well.
