Skip to content

Latest commit

 

History

History
186 lines (127 loc) · 6.8 KB

README.md

File metadata and controls

186 lines (127 loc) · 6.8 KB

Altinn Studio

Altinn Studio build status

Altinn Studio is the next generation Altinn application development solution. Together with Altinn Apps and Altinn Platform, it makes a complete application development and hosting platform.

Altinn Studio is available at https://altinn.studio.

Use the Altinn Studio documentation to get started.

Getting Started

These instructions will get you a copy of Altinn Studio up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

  1. Newest .NET 6 SDK
  2. Node.js (version 16.*)
  3. Newest Git
  4. A code editor - we like Visual Studio Code
  5. Docker Desktop
  6. Update hosts file (C:/Windows/System32/drivers/etc/hosts) by adding the following values as an local administrator:
    localhost altinn3.no
    127.0.0.1 altinn3.no
    127.0.0.1 altinn3local.no
    On MacOS add the same values to values /private/etc/hosts with sudo nano /private/etc/hosts in treminal.
  7. If you are running Docker Desktop in Hyper-V mode you need to make sure your C drive is shared with Docker, Docker Settings -> Shared Drives The File sharing tab is only available in Hyper-V mode, because in WSL 2 mode and Windows container mode all files are automatically shared by Windows. On MacOS: Change docker-compose.yml (both)
    volumes:
      - 'C:/AltinnCore/Repos:/AltinnCore/Repos'
    to:
    volumes:
      - '/Users/<yourname>/AltinnCore/Repos:/AltinnCore/Repos'
  8. World Wide Web Publishing Service must be disabled, Services -> "World Wide Web Publishing Service" rigth click and choose "stop"

Installing

Clone Altinn Studio repo and navigate to the studio folder.

git clone https://github.com/Altinn/altinn-studio
cd altinn-studio/src/studio

Run all parts of the solution in containers (Make sure docker is running)

docker-compose up -d --build

The solution is now available locally at altinn3.no. (Just create a new user for testing. No email verification required)

If you make changes and want to rebuild a specific project using docker-compose this can be done using

docker-compose up -d --build <container>

Example

docker-compose up -d --build altinn_designer

Running solutions locally

Designer

The Designer component can be run locally when developing/debugging. The rest of the solution (repository and load-balancer) will still have to be running in containers. Follow the install steps above if this has not already been done.

Stop the container running Designer.

docker stop altinn-designer

Navigate to the designer backend folder. The first time running, or after any package changes, get the latest packages.

cd src/studio/src/designer/backend
yarn --immutable
yarn run gulp-install-deps

On MacOS you need two extra steps:

  1. change the RepositoryLocation in src/studio/src/designer/backend/appsettings.json to

    "ServiceRepositorySettings": {
      "RepositoryLocation": "/Users/<yourname>/AltinnCore/Repos/"
    }
  2. Change location where the application stores the DataProtectionKeys

    export ALTINN_KEYS_DIRECTORY=/Users/<yourname>/studio/keys

Build and prepare for running the application

dotnet build
yarn run gulp # run this when there are changes in frontend that you want to serve from backend

There are multiple ways to start the applications

yarn run gulp-develop # Run the front end watching app-development
yarn run gulp-develop-dashboard # Run the front end watching dashboard

If you are not going to edit the designer react app (frontend) you can use

cd src/studio/src/designer/backend
yarn --immutable
yarn run gulp # run this when there are changes in frontend that you want to serve from backend
dotnet run

Which will build the Designer .net backend and the designer react app, but not listen to changes to the react app.

Building other react apps

If you need to rebuild other react apps, for instance dashboard or app-development, this can be done by navigating to their respective folders, example src/studio/src/designer/frontend/dashboard and then run the following build script

yarn run build

Some of the react projects also have various other predefined scripts, which can be viewed in the package.json file which is located in the root folder of each react project, example src/studio/src/designer/frontend/dashboard.

Running the tests

End to end tests

Automated end to end tests are currently being developed.

Lint checks

  1. Navigate to the folder src/studio/src/designer/frontend.
  2. Execute yarn --immutable. This step is only nescessary if you have not already done it, or if you change branches.
  3. Execute yarn run lint.

Unit tests

  1. Navigate to the folder src/studio/src/designer/frontend.
  2. Execute yarn --immutable. This step is only nescessary if you have not already done it, or if you change branches.
  3. Execute yarn run test.

Deployment

The current build is deployed in Kubernetes on Azure. Automated CI/CD using Azure DevOps pipelines.

Built With

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the 3-Clause BSD License - see the LICENSE.md file for details.