This is the backend of the Taxonomy Model App.
To develop the backend locally, you must install the following:
- Node.js ^16.0
- Yarn ^1.22
- A recent version of git (e.g. ^2.37 )
To develop this application locally, follow these steps:
-
Ensure you have the prerequisites installed before proceeding.
-
Clone the repository
-
Navigate to the backend directory:
cd ./backend -
Install the project's dependencies:
yarn installAfter running the above command, the
postinstallscript in the package.json will also run, and it will build and link the api-specifications dependency.
The backend project can't be run locally.
It is specifically designed for deployment on AWS Lambda, utilizing pulumi for its construction. It is composed of aws, Lambda functions, which are not designed for local execution.
For more information check the IaC README
To run the unit test cases for the application, execute the following command:
yarn test
Note:
Code coverage is generated based on the unit tests.
To run the integration test cases for the application, execute the following command:
yarn test:integration
Note:
Integration tests do not generate code coverage.
To build the backend application, execute the following command:
yarn build
Note: We are using esbuild to build the backend code.
It generates multiple bundles for the application, which can then be deployed to separate AWS Lambdas, see creating a .zip deployment package with no dependencies.
It uses tree-shaking, and bundles ESM and CJS modules, and the produced bundles contain all runtime dependencies, independently of where they are declared (e.g. in the
dependenciesordevDependenciessection of the package.json file). However, we do declare the dependencies is the correct section for the shake of clarity and to avoid confusion.Additionally, even though the AWS Lambda environment includes the AWS SDK, we still include it in the bundles to ensure that the correct version is used. By doing so, under the AWS shared responsibility model, we are responsible for the management of the dependency in our functions.
To run the linter, execute the following command:
yarn lint
The OpenAPI documentation for the backend is generated using the Swagger-jsdoc library. The documentation is generated from comments annotated with @openapi. For additional information, see the generateOpenApiDoc.ts file.
The API documentation is available in both Swagger UI and Redoc.
To generate the documentation locally, you can use the following commands:
yarn generate:openapi
yarn generate:swagger
yarn generate:redoc
To view the documentation locally, run:
yarn local-server:openapi
The image below shows an overview of the Database Schema of the Taxonomy Model App.
The import and export of the CSV format documentation can be found here
When constructing hierarchies (either occupation hierarchies or skill hierarchies) use the guide here
Contributions are highly valued in this project.
In addition to the contribution guidelines mentioned in the parent directory, please follow these specific rules while working on the frontend project:
- Before pushing your work, make sure to:
