Skip to content

digdir/norge.no

Repository files navigation

Table of Contents

Getting Started

Prerequisites

To get started with the project, follow these steps:

  1. Clone the repository:

    git clone git@github.com:digdir/norge.no.git
  2. Navigate to the project directory:

    cd norge.no
  3. Set correct environment variables in the cms directory:

    cp ./apps/cms/.env.example ./apps/cms/.env

    Update the .env file with your desired configuration.

  4. Set correct environment variables in the frontend directory:

    cp ./apps/frontend/.env.example ./apps/frontend/.env
  5. Update the .env file with your desired configuration. You can find the Strapi STRAPI_API_KEY in the Strapi admin panel under Settings > API Tokens when running the cms application.

Local Development without Docker

  1. Make sure you have the required tools installed.

  2. Install the workspace dependencies:

    deno install --allow-scripts=npm:sharp@0.33.5

Running the cms application

  1. For simplicity use sqlite for development without containers. To do this:
    a. Uncomment the variables under Databse configuration for SQLite in the apps/cms/.env file
    b. Commnet out the variables under Database configuration for Postgres.

  2. Install the cms dependencies:

    deno task cms:install
  3. Start the cms development server:

    deno task cms:dev
  4. Open your browser and go to http://localhost:1337 to see the application running.

Running the frontend application

  1. Open a new terminal at the project directory

  2. Start the cms development server:

    deno task frontend:dev
  3. Open your browser and go to http://localhost:4321 to see the application running.

Local development with Docker Compose

  1. Build the cms app locally due to some compatibility issues with the latest version of Strapi and the Docker image:

    deno task cms:build
  2. Start the cms and cms-db services first to create and store an api key in the database which will be used later by the frontend application:

    docker-compose up --build cms cms-db
  3. Go to the Strapi admin panel at http://localhost:1337/admin and create an API key under Settings > API Tokens. Copy the API key. and paste it in the .env file of the frontend application in the STRAPI_API_KEY variable.

  4. Start the frontend service in a new terminal:

    docker-compose up --build frontend

    (Optional) Alternatively, you can run all three services together by running the following command in a new terminal:

    docker-compose up --watch --build

    This will start all three services, but rebuild the frontend service automatically when the ./apps/frontend/.env file changes after you add the STRAPI_API_KEY variable (step 2).

  5. Open your browser and go to http://localhost:1337 for the cms and http://0.0.0.0:8085 for the frontend to see the applications running.

🤝 Contributing

Learn how you can contribute to this project by reading our Code of Conduct and Contributing Guide.

Contributing

About

Backlog for norge.no

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •