This is the repository for The NGDIL Demo.
NGDIL Demo by default uses the TangleLabs NGDIL backend but it can consume any provider's backend which comply's to this API Spec
- Clone this repository
- Fill out the
.envtaking a copy from.env.sample, only fill the fields which are required by the frontend - Change the
PUBLIC_BASE_URIin.envto be the base URI for your API which follows the spec as defined in this API Spec
- You can use
./.env.sampleas a boiler to create your own environment config file (./.env).
And then with some docker compose magic, we are ready to roll!
$ docker-compose up| Service | Default URL |
|---|---|
| Client (SvelteKit) | localhost:5173 |
| Storybook (Svelte Component Library) | localhost:6006 |
| REST API Server (Express JS) | localhost:4269 |
| REST API Docs (Swagger) | localhost:4269 |
| Server Metrics (Grafana) | localhost:1337 |
- Sveltepress is separated into 2 Yarn Workspaces, the client and the server.
- The Client is the SvelteKit Front-End with Storybook setup to view and interact with UI Library components.
- The
./client/src/libfolder holds all the UI components, helper functions, configs etc. - The
./client/src/routesfolder is used by SvelteKit to serve the pages on the mapped routes.
- The
- The REST API Server is the Express.JS server with monitoring setup using Prometheus && Grafana && also Swagger API Docs which can be accessed via
http://<Server IP>:<Server Port>/api/docs.- The
./server/src/configfolder handles usage of environment variables in the server and setting up of connection to the PostgreSQL DB. - The
./server/src/controllersfolder is where the business logic of the app handles. - The
./server/src/middlewarefolder is where the requests and responses of the server a processed before sending to client. - The
./server/src/modelsfolder is where the tables to be used in the DB are setup. - The
./server/src/routersfolder is where the routes of the server are defined. - The
./server/src/servicesfolder is where the DB operations have been abstracted to allow for complete modularity and easy switching of DB if need be. - The
./server/src/utilsfolder is where the helper functions are stored. - The
./server/src/validatorsfolder is where the validators are stored.
- The