How the database and ORM are configured in SuperStarter.
SuperStarter aims to provide a robust, type-safe database client that makes it easy to work with your database while maintaining strong typing throughout your application. We aim to support tooling that:
By default, SuperStarter uses Neon as its database provider and Prisma as its ORM. However, you can easily switch to other providers if you’d prefer, for example:
Database and ORM configuration is located in @repo/database
. You can import this package into any server-side component, like so:
The database schema is defined in packages/database/prisma/schema.prisma
. This schema file uses Prisma’s schema definition language to describe your database tables, relationships, and types.
Let’s say we want to add a new model called Post
, describing a blog post. The blog content will be in a JSON format, generated by a library like Tiptap. To do this, we would add the following to your schema:
To deploy your schema changes, run the following command:
This runs the following commands:
npx prisma format
to format the schema filenpx prisma generate
to generate the Prisma clientnpx prisma db push
to push the schema changes to the databasestudio
application runs on port 3005.SuperStarter includes Prisma Studio, which is a visual editor for your database. To start it, run the following command: