In this section - we will take an overview of the Next.js Supabase codebase. We will look at the different folders and files and what they do.
This is the folder generated by Supabase when initiating a new project. In this folder, Supabase stores the local configuration
config.toml, the database migrations, the seed file and the tests.
Most importantly, you will be more interested in the
migrations folder. This folder contains the database migrations that seed your database with the necessary tables and data when starting the Supabase server.
It's here where you will be editing or adding new migrations to your database.
In this folder you can store static files that you want to serve from your application. For example, you can store images, fonts, etc. in this folder.
src folder contains the various folders and files:
The core folder contains the building blocks of your application, and the core utilities that you will use throughout your application.
It does not contain any business logic, but rather contains the building blocks that you will use to build your business logic.
core/ui folder contains the reusable components that you will use throughout your application.
It's best to place here components not related to your app's business logic. For example, you can place here components like
lib folder contains business-logic related code - and it's here where you will be writing most of your code.
components folder contains the various components that you will use throughout your application.
For example, here you can add components such as
UserForm, etc. If they relate to a feature, this is a good place to put them.
This is the Next.js routes folder. It contains the various routes that your application will have.
This folder contains the settings and utilities for internationalization in your application.
This file contains the configuration for your application. It's here where you will configure your auth providers, your application's name, etc.
This file is automatically generated by Supabase. It contains the types for your database tables and we use it to add type-safety to our database queries.