io-sign is the IO platform feature that allows citizens to sign digitally documents and contracts sent by public administration.
This repository contains the code that composes the io-sign back-end, that is organized into two microservices:
io-func-sign-issuerthat exposes the API used by public entitiesio-func-sign-userthat exposes the ReST API consumed by the IO mobile app
These services are deployed as Azure Function App, and use the Node.js Azure runtime.
It also contains io-sign-backoffice-app the frontend for self-care integration.
In order to run the io-sign back-end/front-end locally you need the following tool installed on your machine.
Node.js 20pnpm 10.28.1
The preferred way to set up the local environment is using nodenv to manage Node.js installation and corepack (included with Node.js) to manage the installation of pnpm.
To test the Azure Functions locally:
-
Setup the Environment Variables. Create a file called
local.settings.jsonin eachAzure Functions Appfolder (./apps/*) valued according to the environment variables listed inlocal.settings.json.example. -
Install the project. Run from the root folder the following commands.
# to install the dependencies
pnpm
# to generate the TypeScript models based on OpenAPI specs
pnpm -r run generate:api-models
# to build all projects
pnpm buildTo test the webapp locally:
- Install the project (if you haven't already). Run from the root folder the following commands.
# to install the dependencies
pnpm
# to build all projects
pnpm build- Run the Web App. Run (from the root folder) the following command
pnpm --filter io-sign-backoffice-app devThis project uses changesets to automate updating package versions, and changelogs.
Each Pull Request that includes changes that require a version bump should include a changeset file that describe that changes.
To create a new changeset file run the following command from the project root:
pnpm changesetThis project uses pnpm@10.28.1 with workspaces to manage projects and dependencies. Here is a list of useful commands to work in this repo.
# to execute COMMAND on WORKSPACE_NAME
pnpm --filter WORKSPACE_NAME run command
# to execute COMMAD on all workspaces
pnpm -r run command
# run unit tests on @io-sign/io-sign
pnpm --filter @io-sign/io-sign run test
# run the typecheck script on all workspaces
pnpm -r run typecheck
# generate the API models for all workspaces
pnpm -r run generate:api-models# add a dependency to the workspace root
pnpm add turbo
# add a jest as dev dependency on @io-sign/io-sign
pnpm --filter @io-sign/io-sign add -D jest
# add io-ts as dependency on each workspace
pnpm -r add io-tsThis command generates a deployment package (ZIP), in the workspace folder, with bundled dependencies, ready to be deployed on Azure.
pnpm --filter WORKSPACE_NAME run build:package
# example
pnpm --filter io-func-sign-issuer run build:packageThis command generates static frontend files inside the .next folder which can then be uploaded to a static website:
pnpm --filter io-sign-backoffice-app run buildFor detailed information regarding the licensing of this project please take a look at the LICENSE file.