Skip to content

Commit

Permalink
Added README.md & remove extra bits
Browse files Browse the repository at this point in the history
  • Loading branch information
changesbyjames committed Nov 7, 2024
1 parent 3e6de38 commit a467c12
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 106 deletions.
55 changes: 55 additions & 0 deletions census/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Getting started with developing

Prerequisites:

- Clone the repo
- Ensure you have `pnpm` installed
- Run `pnpm install` to install the dependencies
- Ensure you have `docker` installed and running on your machine
- You will need to copy the `src/services/api/.env.example` file to `src/services/api/.env` and supply the correct environment variables.

### Variables you will need to change

- `TWITCH_CLIENT_ID`
- `TWITCH_CLIENT_SECRET`

Go to the [Twitch Developer Dashboard](https://dev.twitch.tv/console) and create a new application to get your `TWITCH_CLIENT_ID` and `TWITCH_CLIENT_SECRET`. Ensure that you set the redirect URL to `http://localhost:35523/auth/redirect` & `http://localhost:35523/admin/redirect`.

- `STORAGE_ACCOUNT_NAME`
- `STORAGE_ACCOUNT_KEY`
- `CONTAINER_NAME`

Currently, we don't support the Azurite emulator for local development, so you'll need to have an Azure storage account and container that you can use.

### Variables you could change

- `JWT_SECRET`

This is the secret that the API uses to sign the JWTs. For local development, you can stick to the default value but know that it makes the token insecure. If you want to generate a new secret, you can run `pnpm --filter=@alveusgg/census-api setup:jwt` to generate a new secret.

### Variables you probably should keep the same

- `UI_URL`
- `POSTGRES_USER`
- `POSTGRES_PASSWORD`
- `POSTGRES_DB`
- `POSTGRES_HOST`
- `HOST`
- `PORT`

These are all the default values that are used when the local docker compose file is ran. Unless you have a reason to change them, it's best to keep them the same.

### Running the services

In the root of the repo, run `docker compose up` to start the remaining services needed for the API to function.

- Edit the file found in `apps/ui/src/services/backstage/local.ts` and point the `apiBaseUrl` to the API URL you're running locally. (You can probably just uncomment the line.)

You can now make changes to both the UI and API and submit a PR for it!

- Run `pnpm --filter=@alveusgg/census-api start` to start the API (you can use `pnpm --filter=@alveusgg/census-api dev` to start the API in "watch" mode.)
- Run `pnpm --filter=@alveusgg/census-ui start` to start the UI

### Seeding the database

You will need to seed the database with the correct data. To add yourself as an admin, run `pnpm --filter=@alveusgg/census-api setup:api` and follow the prompts.
4 changes: 2 additions & 2 deletions census/api/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ POSTGRES_DB=db01
POSTGRES_HOST=localhost

UI_URL=http://localhost:5173
JWT_SECRET=
JWT_SECRET=bed840003446895cfee2372afad1c9adace070b0b54cdfdc640d61b521b5a5aeb3af9519785d5935b8de0f25469b782701b2276a22df329a971c3065bd59a565

STORAGE_ACCOUNT_NAME=
STORAGE_ACCOUNT_KEY=
CONTAINER_NAME=snapshots
CONTAINER_NAME=
Binary file removed census/api/assets/shiny/s1.zip
Binary file not shown.
Binary file removed census/api/assets/shiny/s1/1012092.png
Binary file not shown.
12 changes: 0 additions & 12 deletions census/api/assets/shiny/s1/index.json

This file was deleted.

81 changes: 0 additions & 81 deletions census/api/src/services/special/index.ts

This file was deleted.

8 changes: 0 additions & 8 deletions clips/dev/docker-compose.yml

This file was deleted.

3 changes: 0 additions & 3 deletions clips/dev/mediamtx.yml

This file was deleted.

0 comments on commit a467c12

Please sign in to comment.