Skip to content

iPatente services

Notifications You must be signed in to change notification settings

pagopa/io-ipatente

Repository files navigation

io-ipatente

Code Review

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).

🚧 Work in Progress 🚧

This repository contains the code of the iPatente services that will be exposed as web applications through the App IO services.

  1. apps/my-vehicles that exposes the web application for "I miei veicoli" service.
  2. apps/prj-name tbd

These web applications are all NextJS projects.

Requirements

This project requires specific versions of the following tools. To make sure your development setup matches with production follow the recommended installation methods.

Local development

To test the NextJS App locally:

  1. Setup the Environment Variables. Create a file called .env.local in each NextJS App folder (./apps/*) valued according to the environment variables listed in .env.example.

  2. 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
  1. Run the Web App. Run (from the root folder) the following command
yarn workspace <prj-name> dev

Mocking data with MSW

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_BACKEND_API_MOCKING=true
# enable mocks for external APIs (for backend development)
# !!! work in progress, to be confirmed !!!
NEXT_PUBLIC_EXTERNAL_API_MOCKING=true

Release management

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