- Install Docker
- Install VSCode
- Install Remote - Containers extension
- Open the project in VSCode.
- Copy the
.env.example
to.env
. - Click on the button in the bottom left corner and select "Reopen in Container".
The devcontainer consists of the following services:
- Development Container itself
- PostgreSQL Database
- Directus CMS
Before getting started, install the global dependencies:
bun install
Once the devcontainer is running, you can access the Directus CMS at http://localhost:8055.
To load the schema, run the following command in the terminal:
bun directus-apply
Login with the default credentials admin@example.com
and d1r3ctu5
.
Create a random new Collection to fix the No Permission error. You can delete it afterwards.
-
In Directus, create a new directus token under Users -> Admin User -> Token.
-
Copy the token and add it to the
.env
file asDIRECTUS_TOKEN
. -
To start the frontend, run the following command in the terminal:
bun dev --turbo
The frontend is now accessible at http://localhost:3000.
-
Create a snapshot of the new schema:
bun directus-snapshot
-
Generate types for the new schema (you might have to reload the window after):
bun gen-types
This will:
- Introspect the database and generate the file
backend/schema.prisma
. - Fix the naming of the Prisma schema using
prisma-case-format
. - Generate types for the Prisma client. The generated types are saved in
node_modules/.prisma/client/index.d.ts
.
- Introspect the database and generate the file