Skip to content

Commit

Permalink
Update readme files
Browse files Browse the repository at this point in the history
  • Loading branch information
Ty-ci committed Jan 14, 2025
1 parent bfd326a commit 4271657
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## How to use this template

Copy the template repo and change the following:

- the main title of this README.md
- `name` in `package.json` for both `strapi` and `next` - this will be used by deploy pipeline
- `"name": "template-strapi"` in `strapi/package.json`
Expand All @@ -15,23 +16,24 @@ Copy the template repo and change the following:
- `DATABASE_HOST=template-strapi-database`
- `MINIO_BUCKET=template-strapi` - this is used in `strapi/config/env/production/plugins.js`
- add envs in bratiska-cli env files `.env.bratiska-cli-build.*`
- `STRAPI_URL`
- `NEXT_PUBLIC_STRAPI_URL`
- `NEXT_PUBLIC_MEILISEARCH_SEARCH_API_KEY`
- `NEXT_PUBLIC_MEILISEARCH_HOST`

What is set up manually (this is WIP list):

- `strapi/config/env/production/plugins.ts` - upload provider is set to minio
- custom `strapi::security` middleware is added to `strapi/config/middleware.js`
- custom `app.ts` in `strapi/src/admin` - add SK language to admin panel, disable tutorials and release notifications
- custom schema for User content type added as extention in `strapi/src/extensions/users-permissions/content-types/user/schema.json` to hide Users from admin panel
- the base is the original shema file from strapi repo, only change is adding `pluginOptions.content-manager.visible: false`
- the base is the original shema file from strapi repo, only change is adding `pluginOptions.content-manager.visible: false`
- env `STRAPI_PLUGIN_I18N_INIT_LOCALE_CODE=sk` to set default strapi content locale to SK
- in `strapi/env.example` and `strapi/kubernetes/base/.env`
- docs: https://docs.strapi.io/dev-docs/plugins/i18n#configuration-of-the-default-locale
- in `strapi/env.example` and `strapi/kubernetes/base/.env`
- docs: https://docs.strapi.io/dev-docs/plugins/i18n#configuration-of-the-default-locale
- `codegen.ts`
- `yarn add graphql graphql-request graphql-tag`
- `yarn add -D @graphql-codegen/cli @graphql-codegen/typescript @graphql-codegen/typescript-operations @graphql-codegen/typescript-graphql-request`
- add script `yarn gen`
- `yarn add graphql graphql-request graphql-tag`
- `yarn add -D @graphql-codegen/cli @graphql-codegen/typescript @graphql-codegen/typescript-operations @graphql-codegen/typescript-graphql-request`
- add script `yarn gen`
- `next/prettierrc.js` - added `prettier-plugin-tailwindcss` according to [Additional setup for Frontend projects
](https://bratislava.github.io/eslint-and-prettier#additional-setup-for-frontend-projects) in our docs
- `next/package.json` scripts according to [our docs](https://bratislava.github.io/eslint-and-prettier#installation-and-setup)
Expand Down Expand Up @@ -88,4 +90,5 @@ curl --request GET \
Then use "Default Admin API Key" for strapi in `strapi/.env.local` as `MEILISEARCH_ADMIN_API_KEY` and "Default Search API Key" in `next/.env.local` file as `NEXT_PUBLIC_MEILISEARCH_SEARCH_API_KEY`.

## Stay in touch

[https://inovacie.bratislava.sk/](https://inovacie.bratislava.sk/)
4 changes: 2 additions & 2 deletions next/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ yarn dev

When you change something in Strapi Content type builder, and/or if you change GraphQL queries, you always need to generate new types using Strapi SKD. To update queries, modify files in `services/graphql` directory.

> Note: Strapi V4 does not export schema.graphql by default - instead, you'll need a running server to generate types from graphql endpoint. The Strapi url is set up directly in `codege.yml` file.
> Note: Strapi V4 does not export schema.graphql by default - instead, you'll need a running server to generate types from graphql endpoint. The Strapi url is set up directly in `codegen` file.
To generate new types run:

Expand All @@ -36,4 +36,4 @@ Open [http://localhost:3000](http://localhost:3000) with your browser to see the

## Static Site Generation

If you want to test static site generation locally, you need to run `yarn build` and `yarn start`. This commands run by default with the prod env variable, so in order to have the local env variable for strapi, you need to create `.env.local` with `STRAPI_URL=localhost:1337` to override the prod values. This file is ignored by git, because it often contains sensitive secrets.
If you want to test static site generation locally, you need to run `yarn build` and `yarn start`. This commands run by default with the prod env variable, so in order to have the local env variable for strapi, you need to create `.env.local` with `NEXT_PUBLIC_STRAPI_URL=localhost:1337` to override the prod values. This file is ignored by git, because it often contains sensitive secrets.

0 comments on commit 4271657

Please sign in to comment.