These instructions will get you a copy of the receipt component up and running on your machine for development and testing purposes.
- .NET 8.0 SDK
- Node LTS
- Newest Git
- A code editor - we like Visual Studio Code
- Also install recommended extensions (e.g. C#)
- Podman or another container tool such as Docker Desktop
The platform receipt component need to be run in Docker.
Clone Altinn Receipt repo and navigate to the folder.
git clone https://github.com/Altinn/altinn-receipt
cd altinn-receipt
Prerequisite
- This Receipt needs
app-localtest
for backend services. Before starting theapp-localtest
some modification would be needed in the docker-compose.yml file to set a couple of environment variables. - Also an app from Altinn Studio is needed for creating data that should be presented in the Receipt.
Process
-
app-localtest
: Before startingapp-localtest
add these below lines to theenvironment
section ofaltinn_localtest
in thedocker-compose.yml
file of theapp-localtest
:- PlatformSettings__ApiAuthorizationEndpoint=http://host.docker.internal:5101/authorization/api/v1/ - AuthnGeneralSettings__PlatformEndpoint=http://host.docker.internal:5101/
After adding these the section
altinn_localtest
in thedocker-compose.yml
file of theapp-localtest
will look like this:altinn_localtest: container_name: localtest image: localtest:latest restart: always networks: - altinntestlocal_network ports: - "5101:5101" build: context: . environment: - DOTNET_ENVIRONMENT=Docker - ASPNETCORE_URLS=http://*:5101/ - GeneralSettings__BaseUrl=http://${TEST_DOMAIN:-local.altinn.cloud}:${ALTINN3LOCAL_PORT:-80} - GeneralSettings__HostName=${TEST_DOMAIN:-local.altinn.cloud} - PlatformSettings__ApiAuthorizationEndpoint=http://host.docker.internal:5101/authorization/api/v1/ - AuthnGeneralSettings__PlatformEndpoint=http://host.docker.internal:5101/ volumes: - ./testdata:/testdata - ${ALTINN3LOCALSTORAGE_PATH:-AltinnPlatformLocal}:/AltinnPlatformLocal extra_hosts: - "host.docker.internal:host-gateway"
-
Start the app you have made in the Altinn Studio and run it. Check if this app is working fine with the
app-localtest
backend service. -
Then go to the altinn-receipt directory and run
podman compose up -d --build
. If you make changes to the code, you will need to re-runpodman compose up -d --build
to see the change in action. -
The application should now be available at
local.altinn.cloud/receipt/{instanceOwnerId}/{instanceId}
. You'll find the{instanceOwnerId}
and{instanceId}
in the URL after you successfully submitted the Altinn Studio app form.