Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docu): change link of deployment description #924

Merged
merged 15 commits into from
May 31, 2024
Merged
102 changes: 98 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Dreammall.earth

[![nodejs][badge-nodejs-img]][badge-nodejs-href]
[![npm][badge-npm-img]][badge-npm-href]
[![remark-cli][badge-remark-cli-img]][badge-remark-cli-href]
Expand All @@ -11,20 +12,26 @@ Dreammall.earth websites & services
## Modules

### Frontends

- [Presenter](presenter/README.md)
- [Frontend](frontend/README.md)
- [Admin](admin/README.md)

### Backend

- [Backend](backend/README.md)

### Dev-Op

- [Authentik](authentik/README.md)

## Deployment

Instructions how to deploy this software are available [here](deplyoment/README.md)
Instructions how to deploy this software are available [here](deployment/README.md)

## Commands

The following commands are available:
### The following commands are available

| Command | Description |
| -------------------------- | ---------------------------------------------- |
Expand All @@ -41,9 +48,96 @@ The following commands are available:
| **Maintenance** | |
| `npm run update` | Check for updates |

## Bare-metal

### Install Authentik

```bash
# Go in authentik folder
cd $rootFolder/authentik
# Delete existing database
rm -rf database
# Unpack database in database folder
./database.unpack.sh
# Start authentik docker
docker compose up
```

### Start Database

```bash
# In new Terminal
cd $rootFolder
# Start database in docker
docker compose up database
```

### Start Backend

```bash
# In new Terminal
cd $rootFolder/backend
# Copy .env.dist .env
cp .env.dist .env
# Symbolik for authentik key
ln -s src/auth/public.pem public.pem
nvm use 21
npm install
# Initialize Database
npm run db:reset
# Migration Database
# npm run db:migrate
npm run dev
```

### Start Presenter

```bash
# In new Terminal
cd $rootFolder/presenter
cp .env.dist .env
nvm use 21
npm install
export PORT=3001
# Run dev mode
npm run dev
# Run prod mode (faster)
# npm run prod
```

### Start Frontend

```bash
# In new Terminal
cd $rootFolder/frontend
cp .env.dist .env
nvm use 21
npm install
# export PORT=3000(default)
# Run dev mode (for development)
npm run dev
# Run prod mode (faster)
# npm run prod
```

### Start Admin

```bash
# In new Terminal
cd $rootFolder/admin
cp .env.dist .env
nvm use 21
npm install
export PORT=3002
# Run dev mode
npm run dev
# Run prod mode (faster)
# npm run prod
```

## Docker

The following endpoints are provided if `docker compose` is used:
### The following endpoints are provided for `docker compose`

| Endpoint | Description |
| -------------------------------------------------------------------- | -------------------------- |
Expand Down Expand Up @@ -71,7 +165,7 @@ Then run `npm run release` to propagate the new version and generate the changel

You can get a list of packages to update by running `npm run update`.

Appending `-u ` will also update the packages in the `package.json`. You have to run `npm install` again after.
Appending `-u` will also update the packages in the `package.json`. You have to run `npm install` again after.

```bash
npm run update -- -u
Expand Down
14 changes: 10 additions & 4 deletions admin/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# boilerplate-frontend

[![nodejs][badge-nodejs-img]][badge-nodejs-href]
[![npm][badge-npm-img]][badge-npm-href]
[![docker][badge-docker-img]][badge-docker-href]
Expand Down Expand Up @@ -32,7 +33,7 @@ This projects utilizes `storybook` and `chromatic` to develop, document & test f

## Commands

The following commands are available:
### The following commands are available

| Command | Description |
| --------------------------- | ------------------------------------------------ |
Expand Down Expand Up @@ -68,12 +69,14 @@ The following commands are available:

### Docker

Docker can be run in development mode utilizing `docker-compose.overwrite.yml`:
### Docker development mode

```bash
docker compose up
```

Docker can be run in production mode:
### Docker can be run in production mode

```bash
docker compose -f docker-compose.yml up
```
Expand All @@ -83,11 +86,14 @@ docker compose -f docker-compose.yml up
In order to use the chromatic workflow you need to provide a `CHROMATIC_PROJECT_TOKEN` in the repository secrets.

If you want to run chromatic from the command line you either have to provide this variable as well

```bash
export CHROMATIC_PROJECT_TOKEN=...
npm run chromatic
```

or you have to append it via parameter:

```bash
npm run chromatic -- --project-token=...
```
Expand All @@ -96,7 +102,7 @@ npm run chromatic -- --project-token=...

You can get a list of packes to update by running `npm run update`.

Appending `-u ` will also update the packages in the `package.json`. You have to run `npm install` again after.
Appending `-u` will also update the packages in the `package.json`. You have to run `npm install` again after.

```bash
npm run update -- -u
Expand Down
8 changes: 7 additions & 1 deletion authentik/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,24 @@ This is an Authentik setup for development in order to make local testing for pr

This package comes with an preconfigured authentic - which has its data mainly residing in a postgress database. The contents of this database is available in packed form.

To extract the database use:
### Extract the database

```bash
./database.unpack.sh
```

(Note: make sure the database is not running before executing this command)

Alternatively you can not extract the database, which will start the service with an empty database. Use the [Docker Guide](https://goauthentik.io/docs/installation/docker-compose#preparation) from Authentik to get you going then.

## Start Docker

To start the authentik server and its services run:

```bash
docker compose up
```

(Note: make sure to run this command in the authentik folder, since there is another docker-compose setup in the main folder)

## User Credentials
Expand All @@ -37,8 +41,10 @@ To login you can use the superadmins credentials:
## Publish changes

If you want to publish changes to the database you can use the following command to pack the database:

```bash
./database.pack.sh
```

(Note: this assumes you are not root and sets the permissions of the database files via sudo)
(Note: make sure to shut down the database first before you run the script)
13 changes: 11 additions & 2 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,27 @@ This mechanic was taken from this [source](https://stackoverflow.com/questions/1

## Database setup

The project is set up for a `mysql` database. Use
### The project is set up for a `mysql` database

```bash
docker-compose up database
```
in the main folder to run the database inside docker. You need to copy the `.env.dist` file to `.env`. Run `npm run db:migrate` to generate the database. It might be required to delete the migration folder beforehand.

in the main folder to run the database inside docker.
You need to copy the `.env.dist` file to `.env`.

Run `npm run db:migrate` to generate the database.

It might be required to delete the migration folder beforehand.

## Token validation

If you use the authentik database from the zip file, link the `src/auth/public.pem` to the main folder:

```bash
ln -s src/auth/public.pem public.pem
```

Otherwise place the according certificate in the main folder with the name `public.pem`

## License
Expand Down
Loading