Skip to content

Commit

Permalink
chore: improve and simplify development setup
Browse files Browse the repository at this point in the history
  • Loading branch information
simonwep committed Apr 17, 2024
1 parent 9eaf713 commit e40f405
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 7 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ dist
.gitignore
.eslintrc
.prettierrc
.data
*.md
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
OCULAR_GENESIS_HOST=/api

# Optional, pre-filled login credentials for local testing
OCULAR_TEST_USERNAME=
OCULAR_TEST_PASSWORD=
OCULAR_TEST_USERNAME=admin
OCULAR_TEST_PASSWORD=hgEiPCZP
14 changes: 14 additions & 0 deletions .env.genesis
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Genesis configuration file
# See https://github.com/simonwep/genesis for more information
GENESIS_PORT=8080
GENESIS_DB_PATH=.data
GENESIS_CREATE_USERS=admin!:hgEiPCZP,test:EczUR8dn
GENESIS_AUTHORIZED_URIS=localhost:3000
GENESIS_JWT_SECRET=84d62c48dd30ca7caf6561252c5bd919}
GENESIS_JWT_TOKEN_EXPIRATION=120000
GENESIS_USERNAME_PATTERN=^[\w]{0,32}$
GENESIS_KEY_PATTERN=^[\w]{0,32}$
GENESIS_DATA_MAX_SIZE=32
GENESIS_KEYS_PER_USER=3
GENESIS_GIN_MODE=test
GENESIS_LOG_MODE=development
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ dist-ssr

# Misc
.env
.data
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,17 @@ Your data stays on your server and is not shared with anyone else.

### Development

This app uses [genesis](https://github.com/simonwep/genesis) as generic backend.
Go to the [genesis](https://github.com/simonwep/genesis) repository and follow the instructions to set it up first.

To run the frontend make sure you have the latest [node LTS](https://nodejs.org/en/) installed, as well as [pnpm](https://pnpm.io/).
You can then start the frontend by running `pnpm run dev` in the root directory.
1. Make sure you have the latest [node LTS](https://nodejs.org/en/) installed.
2. Install [pnpm](https://pnpm.io/) via `npm i -g pnpm`.
3. Clone this repository.
4. Run `pnpm install` in the root directory.
5. Copy the `.env.example` to `.env`, you can leave the default values.
6. Start the backend with `docker run -p 8080:8080 -v "$(pwd)/.data:/app/.data" --env-file .env.genesis ghcr.io/simonwep/genesis:latest`.
7. Start the frontend with `pnpm run dev`.
8. Open `http://localhost:3000` in your browser.

> [!NOTE]
> To modify the backend, head over to [genesis](https://github.com/simonwep/genesis).
### Production

Expand Down

0 comments on commit e40f405

Please sign in to comment.