Skip to content

Commit

Permalink
chore: create / update package readme's
Browse files Browse the repository at this point in the history
  • Loading branch information
mvarendorff committed Jan 6, 2024
1 parent c6b679e commit 509b510
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 35 deletions.
3 changes: 3 additions & 0 deletions packages/cms/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build/
dist/
node_modules/
24 changes: 10 additions & 14 deletions packages/cms/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
# cms
# @yestheory.family/cms

This project was created using create-payload-app using the blank template.
This package contains the Payload CMS hosted at https://admin.yestheory.family.

## How to Use
## Important commands

`yarn dev` will start up your application and reload on any changes.
- `yarn dev` runs the CMS in development mode, restarting on changes
- `yarn seed` inserts some basic data including an initial user based on the .env file into the database
- `yarn generate:types` generates TypeScript types based on the collection definitions (can be imported
as `import { type GeneratedTypes } from "payload";`)

### Docker
## Requirements

If you have docker and docker-compose installed, you can run `docker-compose up`

To build the docker image, run `docker build -t my-tag .`

Ensure you are passing all needed environment variables when starting up your container via `--env-file` or setting them with your deployment.

The 3 typical env vars will be `DATABASE_URI`, `PAYLOAD_SECRET`, and `PAYLOAD_CONFIG_PATH`

`docker run --env-file .env -p 3000:3000 my-tag`
- Needs both the database and typesense running to start
- Needs Node.js Backend launched after it to authenticate requests
3 changes: 3 additions & 0 deletions packages/e2e/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
playwright-report/
test-results/
13 changes: 12 additions & 1 deletion packages/e2e/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
# e2e
# @yestheory.family/e2e

This package contains [Playwright](https://playwright.dev/) tests that run in the pipeline to ensure proper
functionality of the all the moving parts.

## Important commands

- `yarn playwright test` runs the testsuite against a currently running setup

## Requirements

- A functional web application on port `http://localhost:3000` (can be changed using the env variable `FRONTEND_URL`)
1 change: 1 addition & 0 deletions packages/scripts/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
8 changes: 8 additions & 0 deletions packages/scripts/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# @yestheory.family/scripts

This package contains one-off scripts that are not bundled into any running application code.

## Important commands

- `yarn tsx path/to/script` runs the given script

## Requirements

- Depend on the script
16 changes: 15 additions & 1 deletion packages/server/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
# server
# @yestheory.family/server

This package contains the Node.js Backend that acts as a data juggler between all the different parts of the
application. It uses [Prisma ORM](https://prisma.io) for connecting to the database.

## Important commands

- `yarn dev` runs the backend in development mode, restarting on changes
- `yarn prisma <prisma command>` interact with the database
- `yarn prisma db push` pushes the current schema into the database without migrations (used during development)
- `yarn prisma migrate dev` creates a new migration for the project (required for PRs when the schema changes)

## Requirements

- A running CMS (required because the backend stitches the CMS' schema)
29 changes: 10 additions & 19 deletions packages/web/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
# Preact example
# @yestheory.family/web

<!-- TODO Clean this from Preact mentions -->
This package contains the Next.js Frontend that is displayed to the user when visiting https://yestheory.family.

This example uses [Preact](https://github.com/preactjs/preact) instead of React. It's a React like UI framework which is fast and small.
## Important commands

## How to use
- `yarn codegen` regenerates code based on the .graphql files in the package
- `yarn dev` runs the frontend in development mode, hot-reloading on changes (runs `yarn codegen` on first start)
- `yarn storybook` runs Storybook in development mode, hot-reloading on changes

Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
## Requirements

```bash
npx create-next-app --example using-preact using-preact-app
# or
yarn create next-app --example using-preact using-preact-app
```
*These requirements are for running the actual frontend; they don't apply to running Storybook*

Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).

### Aliasing react -> preact

Using `preact` with `next.js` depends on aliasing react packages to preact ones (like `@preact/compat`). This is done directly in the [`package.json`](./package.json) dependencies.

### next-plugin-preact

This example was [updated](https://github.com/vercel/next.js/pull/18588) to use [`next-plugin-preact`](https://github.com/preactjs/next-plugin-preact) and now requires minimal configuration, if you want to add preact without a plugin, or see how it works, head to the previous [`next.config.js`](https://github.com/vercel/next.js/blob/629884af7d3ced97b8c2ec7aebdfb1a3a5d808f0/examples/using-preact/next.config.js).
- A running backend (required because the codegen fetches its schema from there)
- Typesense running when searching through group-chats

0 comments on commit 509b510

Please sign in to comment.