Gå till innehållet

How to get started

Follow the steps below to get a local development environment up and running.

Expectations

This guides expects you to:

  • know how to run simple commands and navigate in the terminal
  • have a code editor set up with all needed extensions

Prerequisites

Before you can start developing, you need to install the following tools:

Note

If you're running Windows, it's highly recommended to first installWSL. This sets up a Linux environment on your Windows machine and simplifies development.

When you have WSL installed, you can open a WSL terminal and follow the instructions below as if you were using Linux normally.

Be sure to always open a WSL terminal when doing development; Powershell is ass.

  1. Install Node.js.

Using nvm to install Node.js is strongly recommended.

The installation steps are provided below for reference, but for up-to-date instructions, visit the link above. Open a terminal and run the following commands:

# installs nvm (Node Version Manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash

Restart your terminal.

# Download and install Node.js LTS
nvm install 24

# verifies the right Node.js version is in the environment
node -v # should print `v24.12.0`
# verifies the right npm version is in the environment
npm -v # should print `10.9.3`
2. Install pnpm.

Now, install the package manager pnpm. Installing pnpm using Corepack is strongly recommended.

Note

if your installation of Node.js is newer than v25, you must first install corepack: npm i -g corepack

corepack enable pnpm
3. Install podman.

sudo apt install podman
podman -v # should print `podman version 5.6.0`

Setting up the project (NOT FINISHED YET!)

  1. Clone the repo into dsek-web and change into the directory.

git clone git@github.com:Dsek-LTH/web.git dsek-web && cd dsek-web
2. Install all dependencies using pnpm. Having problems?

pnpm install
3. Setup your local development database.

podman kube play podman-dev.yaml # If using docker: docker compose up -d
pnpm migrate
pnpm seed

After the first run, just do podman pod start dsekweb-services. You can stop the database with podman pod stop dsekweb-services. 4. Start the development server.

pnpm dev
5. Congratulations! You should now be able to visit your application on http://localhost:5173.

Troubleshooting

Node.js permissions issues

If you encounter permission issues when running the pnpm install command, you may have installed Node.js using sudo. This can cause permission issues when installing packages. To fix this, we recommend uninstalling Node.js completely and reinstalling it without sudo using nvm.