The project io-ipatente
aims to provide, through App IO, some of the services currently provided by the iPatente mobile application (managed by Motorizzazione Civile on behalf of the Ministry of Infrastructure and Transport).
This repository contains the code of the iPatente services that will be exposed as web applications through the App IO services.
apps/vehicles
that exposes the web application for "I tuoi veicoli" service.apps/prj-name
tbd
These web applications are all NextJS projects.
This project requires specific versions of the following tools. To make sure your development setup matches with production follow the recommended installation methods.
-
Node.js
Use nodenv to install the required version of
Node.js
.nodenv install node --version
-
Yarn
Yarn must be installed using Corepack, included by default in
Node.js
.corepack enable yarn --version
-
Terraform
Use tfenv to install the required version of
terraform
.tfenv install terraform version
-
pre-commit
Follow the official documentation to install
pre-commit
in your machine.pre-commit install
To test the NextJS App
locally:
-
Setup the Environment Variables. Create a file called
.env.local
in eachNextJS App
folder (./apps/*
) valued according to the environment variables listed in.env.example
. -
Install the project (if you haven't already). Run the following commands from the root folder.
# to install the dependencies
yarn
# to generate the TypeScript models based on OpenAPI specs
yarn workspace <prj-name> generate
# to build all projects
yarn build
- Run the Web App. Run (from the root folder) the following command
yarn workspace <prj-name> dev
Each NextJS App uses MSW, an API mocking library that allows you to write client-agnostic mocks and reuse them across any frameworks, tools, and environments.
To enable MSW in a specific NextJS App, set the following environment variables in .env.local
file:
# enable MSW
NEXT_PUBLIC_IS_MSW_ENABLED=true
# enable mocks on Backend for frontend (for frontend development)
NEXT_PUBLIC_BFF_API_MOCKING=true
# enable mocks for external APIs (for backend development)
# !!! work in progress, to be confirmed !!!
NEXT_PUBLIC_EXTERNAL_API_MOCKING=true
This 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 describes that changes.
To create a new changeset
file run the following command from the project root:
yarn changeset