Skip to content

Getting Started

Sabo edited this page Aug 6, 2024 · 10 revisions

Prerequestries

NX

Make sure you have NX installed globally. Otherwise, you will always have to use npx nx to execute commands in the workspace.

npm i -g nx

We also recommend installing the NX-Console Extension. It allows you to easily navigate through all the commands in our project, so you don't have to memorize all the commands or search through the docs.

pnpm

Make sure you have installed pnpm:

npm install -g pnpm

Node

In case you have an old Node version, you can use nvm to upgrade your node version.

First, install nvm

wget -qO- https://github.com/raw/nvm-sh/nvm/v0.39.7/install.sh | bash

Then activate it:

source ~/.bashrc

Get the latest node version:

nvm install --lts

HTTP Client

If you want to send HTTP-Requests, we recommend using tools such as Postman or Thunder Client

Go

Check, if you have installed go:

go version

If you don't have Go installed, try the following commands:

wget https://go.dev/dl/go1.20.4.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.20.4.linux-amd64.tar.gz

Open .bashrc and add the following lines to the end of the file:

export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH

General Commands

📦 Dependencies

To install all dependencies, run:

pnpm install

🐳 Start Database

In order to start the postgres database, start the docker containers:

docker-compose up

🧹 Format Code

To format the code, you can use Prettier:

prettier . --write --tab-width 4

📊 View Project Graph

You can view a graph of all tasks and dependencies in the workspace:

nx graph

Backend

📦 Dependencies

nx run backend:tidy

🔨 Build

nx run backend:build

🧪 Test

nx run backend:test

▶️ Run

nx run backend:serve

🔎 Lint

nx run backend:lint

Frontend

🔨 Build

nx run frontend:build

🧪 Test

nx run frontend:test

▶️ Run

nx run frontend:serve

🔎 Lint

nx run frontend:lint