fix(docs): Adjust getting started docs

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2022-12-05 20:16:27 +01:00
parent 298b6bc205
commit 60db7f4931
4 changed files with 36 additions and 26 deletions

View file

@ -7,3 +7,5 @@ HD_MEDIA_BACKEND="filesystem"
HD_MEDIA_BACKEND_FILESYSTEM_UPLOAD_PATH="uploads/"
HD_DATABASE_TYPE="sqlite"
HD_DATABASE_NAME="./hedgedoc.sqlite"
HD_LOGLEVEL=info
#HD_SESSION_SECRET=

View file

@ -1,8 +1,40 @@
# Getting started
This document will help you with setting up the development environment for HedgeDoc 2.
## Preparation
Setup the [backend](./setup/backend.md) and the [frontend](./setup/frontend.md).
### Preparing the directory
1. Make sure that NodeJS is installed. You need at least Node 14 (we recommend Node 18).
2. Make sure that [yarn](https://yarnpkg.com/) is installed.
3. Clone this repo (e.g. `git clone https://github.com/hedgedoc/hedgedoc.git hedgedoc`)
4. Go into the cloned directory
### Installing the dependencies
Because we use yarn workspaces, yarn collects the dependencies of all packages automatically in one central top-level node_modules folder.
To install the dependencies execute `yarn install` at the top level of the cloned repository.
Execute this command ONLY there. There is no need to execute the install-command for every package.
It's important to use [yarn](https://yarnpkg.com/). We don't support npm or any other package manager and using anything else than yarn won't work.
### Compile the commons package
Some code is shared by backend and frontend. This code lives in the "common" package and needs to be compiled so frontend and backend can import it.
This only needs to be done once, except if you've changed code in the commons package.
1. Go into the `commons` directory.
2. Execute `yarn build` to build the commons package.
## Setting up the backend
1. Go into the `backend` directory.
2. Create an environment file. We recommend to use the example file by running `cp .env.example .env`
You can modify this file according to the [configuration documentation](../config/index.md).
3. Make sure that you've set `HD_SESSION_SECRET` in your `.env` file. Otherwise, the backend won't start.
> In dev mode you don't need a secure secret. So use any value. If you want to generate a secure session secret you can generate one using e.g. `openssl rand -hex 16 | sed -E 's/(.*)/HD_SESSION_SECRET=\1/' >> .env`.
## Setting up the frontend
The instructions for the frontend can be found [here](./setup/frontend.md).
## Running backend and frontend together

View file

@ -1,19 +0,0 @@
<!--
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
SPDX-License-Identifier: CC-BY-SA-4.0
-->
## Setting up the backend
**ToDo:** Document how to set up development environment using docker.
You need at least Node 14 (we recommend Node 18) and [yarn](https://yarnpkg.com/).
You MUST use yarn! There is no support for npm.
1. Clone this repo (e.g. `git clone https://github.com/hedgedoc/hedgedoc.git hedgedoc`)
2. Go into the backend directory (e.g. `cd hedgedoc/backend`)
3. Run `yarn install`
4. Create an environment file. We recommend to use the example file by running `cp .env.example .env`
You can modify this file according to the [configuration documentation](../config/index.md).
5. Run `openssl rand -hex 16 | sed -E 's/(.*)/HD_SESSION_SECRET=\1/' >> .env` to generate a session secret if you have not set one manually before.

View file

@ -6,12 +6,7 @@ SPDX-License-Identifier: CC-BY-SA-4.0
# Setting up the frontend
You need at least Node 14 (we recommend Node 18) and [yarn](https://yarnpkg.com/).
You MUST use yarn! There is no support for npm.
1. Clone this repo (e.g. `git clone https://github.com/hedgedoc/hedgedoc.git hedgedoc`)
2. Go into the frontend directory (e.g. `cd hedgedoc/frontend`)
3. Run `yarn install`
Follow the preparation instructions in [getting started](../getting-started.md)
## Development mode