From 509b510d5b42b7d0335a5626e10697b18700f6ac Mon Sep 17 00:00:00 2001 From: geisterfurz007 Date: Sat, 6 Jan 2024 14:26:01 +0100 Subject: [PATCH] chore: create / update package readme's --- packages/cms/.prettierignore | 3 +++ packages/cms/README.md | 24 ++++++++++-------------- packages/e2e/.prettierignore | 3 +++ packages/e2e/README.md | 13 ++++++++++++- packages/scripts/.prettierignore | 1 + packages/scripts/README.md | 8 ++++++++ packages/server/README.md | 16 +++++++++++++++- packages/web/README.md | 29 ++++++++++------------------- 8 files changed, 62 insertions(+), 35 deletions(-) create mode 100644 packages/cms/.prettierignore create mode 100644 packages/e2e/.prettierignore create mode 100644 packages/scripts/.prettierignore diff --git a/packages/cms/.prettierignore b/packages/cms/.prettierignore new file mode 100644 index 00000000..69c575d1 --- /dev/null +++ b/packages/cms/.prettierignore @@ -0,0 +1,3 @@ +build/ +dist/ +node_modules/ diff --git a/packages/cms/README.md b/packages/cms/README.md index a687f3a6..c504336c 100644 --- a/packages/cms/README.md +++ b/packages/cms/README.md @@ -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 diff --git a/packages/e2e/.prettierignore b/packages/e2e/.prettierignore new file mode 100644 index 00000000..945fcd0d --- /dev/null +++ b/packages/e2e/.prettierignore @@ -0,0 +1,3 @@ +node_modules/ +playwright-report/ +test-results/ diff --git a/packages/e2e/README.md b/packages/e2e/README.md index 6280098a..44a8105f 100644 --- a/packages/e2e/README.md +++ b/packages/e2e/README.md @@ -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`) diff --git a/packages/scripts/.prettierignore b/packages/scripts/.prettierignore new file mode 100644 index 00000000..c2658d7d --- /dev/null +++ b/packages/scripts/.prettierignore @@ -0,0 +1 @@ +node_modules/ diff --git a/packages/scripts/README.md b/packages/scripts/README.md index 5a95d01d..a087f64e 100644 --- a/packages/scripts/README.md +++ b/packages/scripts/README.md @@ -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 diff --git a/packages/server/README.md b/packages/server/README.md index 00db566d..84154896 100644 --- a/packages/server/README.md +++ b/packages/server/README.md @@ -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 ` 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) diff --git a/packages/web/README.md b/packages/web/README.md index 5b69a902..5c4f52e0 100644 --- a/packages/web/README.md +++ b/packages/web/README.md @@ -1,25 +1,16 @@ -# Preact example +# @yestheory.family/web - +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