Example monorepo setup for strapi, next using turborepo. Typescript
is first class citizen here.
git clone [email protected]:antokhio/turbo-strapi-next-rtk.git ./my-strapi-next-project
go to `./apps/backend rename` `.env.example` to `.env`
go to `./apps/frontend rename` `.env.example` to `.env`
yarn
yarn dev
http://localhost:3000 your next js frontend
http://localhost:1337 your strapi backend
/apps/_shared/src/types/shared.ts
is place you can assemble types
/apps/frontend/features/layoutApi.ts
is where the example type is consumed
The idea behind, that you define and modify types in shared and then you can use them directly on frontend:
// /apps/_shared/src/types/shared.ts
export type SomeComponent = StrapiComponent<'some.component'>
// frontend/src/components/SomeComponent
import { SomeComponent as SomeComponetType } from '@repo/shared'
export const SomeComponent = ({...stuff}:Partial<SomeComponentType>): JSX.Element => {
return <>{...stuff}</>
}
- TODO: add example types
@repo/shared
frontend
backend
@repo/eslint-config
:eslint
configurations.TODO
@repo/typescript-config
:tsc
configurationsTODO
.