Skip to content

Commit

Permalink
docs: review readme
Browse files Browse the repository at this point in the history
  • Loading branch information
PupoSDC committed Jul 26, 2023
1 parent 0b8bbe5 commit 5b31ebd
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 36 deletions.
14 changes: 12 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
ENV_FILE_NAME=PROD
NEXT_PUBLIC_BASE_URL=http://localhost:4200
QUESTION_BANK_PROVIDER=local
PROVIDER_ANALYTICS_POSTGRES_URL="<You should generate a postgresql DB for analytics, or get the credentials for one>"
PROVIDER_ANALYTICS_POSTGRES_PRISMA_URL="<You should generate a postgresql DB for analytics, or get the credentials for one>"
PROVIDER_ANALYTICS_POSTGRES_URL_NON_POOLING="<You should generate a postgresql DB for analytics, or get the credentials for one>"
PROVIDER_ANALYTICS_POSTGRES_USER="<You should generate a postgresql DB for analytics, or get the credentials for one>"
PROVIDER_ANALYTICS_POSTGRES_HOST="<You should generate a postgresql DB for analytics, or get the credentials for one>"
PROVIDER_ANALYTICS_POSTGRES_PASSWORD="<You should generate a postgresql DB for analytics, or get the credentials for one>"
PROVIDER_ANALYTICS_POSTGRES_DATABASE="<You should generate a postgresql DB for analytics, or get the credentials for one>"
PROVIDER_QUESTION_BANK_REDIS_UPSTASH_URL="<You should generate a redis upstash DB for the question bank or get the credentials for one>"
PROVIDER_QUESTION_BANK_REDIS_UPSTASH_TOKEN="<You should generate a redis upstash DB for the question bank or get the credentials for one>"
PROVIDER_GITHUB_TOKEN="<You should generate a github token>"
PROVIDER_GITHUB_PROJECT_OWNER=PupoSDC
PROVIDER_GITHUB_PROJECT_NAME=chair-flight
PROVIDER_GITHUB_PROJECT_NAME=chair-flight
66 changes: 32 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ Built with
[`Next`](https://nextjs.org/),
[`Vite`](https://vitejs.dev/),
[`Storybook`](https://storybook.js.org/),
[`Prisma`](https://www.prisma.io/),
[`Trpc`](https://trpc.io/),
[`Redux`](https://redux.js.org/),
and [`MDX`](https://mdxjs.com/).

Managed with
Expand All @@ -20,9 +23,8 @@ and [`nx`](https://nx.dev/).

You will need to install
[`Git`](https://product.hubspot.com/blog/git-and-github-tutorial-for-beginners),
[`pnpm`](https://pnpm.io/installation),
and [`fnm`](https://github.com/Schniz/fnm)
manually.
[`pnpm`](https://pnpm.io/installation), and
[`fnm`](https://github.com/Schniz/fnm) manually.

```sh
git clone [email protected]:PupoSDC/chair-flight.git
Expand All @@ -41,53 +43,49 @@ can and will be introduced in patch releases.

### Apps

\*Note: `dev` indicates the port the service is availabel when running `pnpm run dev`
\*Note: `dev` indicates the port the service is available when running `pnpm run dev`

| Name | Desc | dev |
| -------- | -------------------------------------------------------------- | ----- |
| next-app | Next.js server for static/SSR pages and API | :4200 |
| next-cms | CMS for question bank development | :4210 |
| docs | Storybook used for docs | :4220 |
| upstash | Not a real app, rather an executor to update the QB in upstash | |

### Libs

| Name | Desc |
| ----------------------- | ----------------------------------------------------------- |
| base-env | Utility to safely access env variables |
| base-errors | Errors that can be handled in the front or in the backend |
| base-types | Base Business types used across the app |
| core-app | Business logic blocks sharable between React SPA/SSR and RN |
| core-openai | Chat GPT based solutions to some recurrent issues we solve |
| core-redux | Redux store to manage client side data |
| next-client | Next specific components, hooks, and logic blocks |
| next-server | Next specific server utilities |
| question-bank-content | Static Question Bank Content |
| question-bank-providers | Question Bank providers (Redis & local fs) |
| question-bank-schemas | Zod Question bank content validation schemas |
| react-components | Shared react (DOM) components |
| react-games | Shared react (three.js) components |
| question-bank | Static question bank files |
| external-upstash | Upstash connection provider |
| external-openai | OpenAi connection provider |
| Name | Desc |
| ----------------------------- | ----------------------------------------------------------- |
| base-env | Utility to safely access env variables |
| base-errors | Errors that can be handled in the front or in the backend |
| base-types | Base Business types used across the app |
| core-app | Business logic blocks sharable between React SPA/SSR and RN |
| core-redux | Redux state management for the more "Appy" logic of the app |
| core-schemas | Zod Schemas shared across our application (from base-types) |
| providers-analytics | Analytics provider (currently a custom solution) |
| providers-github | Github related functionalities |
| providers-question-bank-local | Local FS question bank provider |
| providers-question-bank-redis | Redis question bank provider |
| react/analytics | React hooks to interact with our analytics provider |
| react/components | Shared react (DOM) components |
| react/containers | Next.js specific components |
| react/games | Shared react (three.js) components |
| trpc/client | trpc next js specific client |
| trpc/mock | trpc mock server, for storybook and RTL tests |
| trpc/server | main trpc server. All our backend logic starts here |

### .env

When running locally, the webapp is self contained and no external services are
required. Nonetheless, to run remotely, or to run some CMS features (which are
powered by openAI) you will need to provide some env variables in an `.env` file
located at the repository root.
located at the repository root. Please check the `.env.example` file for the
variables you need to fill out.

```sh
NEXT_PUBLIC_BASE_URL="Set to localhost:4200 for local development."
QUESTION_BANK_PROVIDER="Set to `redis` to use redis locally. or `local` for local fs"
UPSTASH_URL="See https://docs.upstash.com/redis/quickstarts/nextjs13#database-setup"
UPSTASH_TOKEN="See https://docs.upstash.com/redis/quickstarts/nextjs13#database-setup"
OPENAI_API_KEY="Create here https://platform.openai.com/account/api-keys"
PROVIDER_GITHUB_TOKEN="See https://github.com/settings/tokens/new?scopes=repo"
PROVIDER_GITHUB_PROJECT_OWNER=PupoSDC
PROVIDER_GITHUB_PROJECT_NAME=chair-flight
```
Relevant links:

- https://github.com/settings/tokens/new?scopes=repo
- https://docs.upstash.com/redis/quickstarts/nextjs13#database-setup
- https://vercel.com/docs/storage/vercel-postgres

## Contributing

Expand Down

0 comments on commit 5b31ebd

Please sign in to comment.