ProConnect, l'accรจs pour les pros, validรฉ par l'รtat
ProConnect Identitรฉ is an "OpenId Connect" identity provider managed by the DINUM.
For professionals who don't have a designated identity provider in the ProConnect federation, the DINUM provides an account in ProConnect Identitรฉ. Thus, any person affiliated with an organization registered with INSEE, meaning they have a SIRET number, can use an identity provided by the DINUM within the ProConnect federation.
To integrate with the ProConnect federation, please refer to our online documentation.
โ ๏ธ ProConnect Identitรฉ can no longer be used outside of the ProConnect federation.
The codebase employs a monorepo structure using npm workspaces under the @proconnect-gouv namespace.
Each package serves distinct architectural responsibilities within the broader identity management ecosystem.
proconnect-identite/
โโโ ๐จ assets/ # CSS & JS files served by the app
โโโ ๐ค cypress/ # End2end testing
โโโ โฌ migrations/ # Migration managed by node-pg-migrate
โโโ ๐ packages/ # Modular workspace packages
โ โโโ ๐ง core/ # Shared utilities & business logic
โ โโโ ๐ญ identite/ # Main OIDC PCI logic
โ โโโ ๐ข entreprise/ # INSEE/SIRENE integration
โ โโโ โ๏ธ email/ # Email templates
โ โโโ ๐ฌ crisp/ # Crisp API wrapper
โ โโโ โฑ๏ธ debounce/ # DeBounce API wrapper
โ โโโ ๐ insee/ # INSEE API wrapper
โ โโโ ๐งช testing/ # Test utilities & mocks
โ โโโ โ๏ธ devtools/ # Development toolchain
โโโ ๐ public/ # Images served by the app
โโโ ๐ src/ # Main Express.js application
โ โโโ ๐ config/ # Configuration management
โ โโโ ๐ connectors/ # External service connectors: all external ressources are listed here
โ โโโ ๐ฎ controllers/ # Route handlers: 1 controller = params check + call to manager(s) + HTTP response generation
โ โโโ ๐ managers/ # High-level business managers: they contains call to database and services
โ โโโ ๐ก๏ธ middlewares/ # Express middleware stack
โ โโโ ๐ repositories/ # Data access layer
โ โโโ ๐ฃ๏ธ routers/ # API route definitions
โ โโโ โ๏ธ services/ # Core business services: stateless logic
โ โโโ ๐ types/ # TypeScript type definitions
โ โโโ ๐จ views/ # Template rendering & UI
โ โโโ index.ts # Application entry point
โ โโโ instrument.ts # Monitoring & instrumentation
โโโ ๐งช test/ # Node unit tests
โโโ ๐ scripts/ # Database & deployment scripts
This guide provides steps to run the ProConnect Identitรฉ Node.js application locally while managing its dependencies in Docker containers.
- Node.js (v22) installed locally (we suggest the usage of nvm)
- Docker (>= v25) and Docker Compose (>= v2.24) installed (doc)
- Clone the ProConnect Identitรฉ repository
On MacOS, you may need to enable host networking. Please follow these instructions: https://docs.docker.com/engine/network/drivers/host/#docker-desktop
- Start Dependencies: Navigate to the root directory of the cloned repository and run:
docker compose upThis will start all required services (e.g., databases) defined in the docker-compose.yml.
-
Install Node.js Dependencies:
Inside the projectโs root directory, run:
npm ci
npm run build- Database Initialization: The database will be automatically initialized with data from
scripts/fixtures.sql.
npm run fixtures:loadAfter setting up the application, start the Node.js server with:
npm run devThe application is now available at http://localhost:3000.
To log in, use the email address user@yopmail.com and the password "user@yopmail.com".
Emails are not sent but printed in the console.
By default, the application will run with testing mocks for external apis.
ProConnect Identitรฉ is provided with a test client: https://github.com/proconnect-gouv/proconnect-test-client
This container is launched within the ProConnect Identitรฉ docker-compose.yml.
It's available at http://localhost:3001
In our OIDC provider project, navigating through certain paths can be particularly challenging due to the diverse range of scenarios that may arise.
Recognizing this complexity, we provide comprehensive datasets and associated configurations tailored for executing specific test cases.
You can manually execute a Cypress end-to-end test to thoroughly explore these paths by following this doc.
Docker Compose initializes both a PostgreSQL and a Redis database.
To connect to these databases, use the following commands:
docker compose exec db psql postgres://proconnect-identite:proconnect-identite@db:5432/proconnect-identite
docker compose exec redis redis-cli -h redis -p 6379The default environment variables are defined in the .env file, which applies to all environments. Based on the NODE_ENV variable, the corresponding file is selected: .env.development for the development environment, .env.production for production, or .env.test for testing.
To customize or override these defaults, we recommend using the .env*.local files. The file .env.<NODE_ENV>.local will have higher priority over both .env.local and .env.<NODE_ENV>.
If you prefer not to run end-to-end tests locally and want to avoid downloading the large Cypress binary, you can prevent it during the installation process. To do this, run the following command:
CYPRESS_INSTALL_BINARY=0 npm ciThis command ensures that the Cypress binary is not downloaded, saving time and disk space during the installation process.
We use changeset to manage our package changelog. You can read more about it here.
To create a new changeset, run the following command:
npx changesetYou will be prompted to select the type of change you want to make.
As this changelog is intended for French end users, we recommend you write your change in French ๐ซ๐ท.
Commit your changes and push them in your branch.
We will merge a "Version Packages" PR when we are ready to release ๐
Remember to request production API credentials from a colleague.
Use the testing cli to add additional data needed for dev or tests.
$ npx tsx scripts/testing.ts --helpNote that the ./packages/testing/src/api/data/people.ts file contains a list of people that are used to anonymize data.
I can access the core service (on port 3000), but all the other services are unavailable (maildev, test client, etc.)
If you're using Docker Desktop, you might have not enabled the host networking. Your version of Docker Desktop must be 4.34 or later, and you can enable it by following these steps:
- Open Docker Desktop
- Navigate to Settings.
- Under the Resources tab, select Network.
- Check the Enable host networking option.
- Select Apply and restart.