By now, you should have a folder in your Documents
folder called my-sanity-project
.
In Visual Studio Code (or IDE of your choice), open this folder. You'll see something similar to this for the file structure:

This should look like a traditional React project, with a few key exceptions. We'll be looking at these few exceptions. If you're unfamilliar with the React/Node file structure, check out the linked resources below.
/schemas
This is the most important folder when working with Sanity. This is where all of our schemas (which will act as the templates in a way, for the data we plan on storing within Sanity.)
Inside of this folder, you'll see an index.js
file, which will eventually contain import links to all of our schemas.
export const schemaTypes = []
sanity.config.js
The sanity.conifig.js
file is used for our project's information, along with importing additional plugins. (We'll talk about this later!)
You can see the title of your project, along with the name and dataset type. (Remember when we chose the default dataset configuration? That's why the name is 'default'
and our dataset is 'production'
.)
What's important here is your projectId
, which is unique to your project and allows you to link it to your web application. You'll see that our /schemas/index.js
file is imported into the schema section of this file, telling Sanity where our schemas are.
import {defineConfig} from 'sanity'import {deskTool} from 'sanity/desk'import {visionTool} from '@sanity/vision'import {schemaTypes} from './schemas'
export default defineConfig({ name: 'default', title: 'My Sanity Project',
projectId: 'YOURPROJECTID', dataset: 'production',
plugins: [deskTool(), visionTool()],
schema: { types: schemaTypes, },})
sanity.cli.js
This is the CLI (Command Line Interface) configuration file. We won't touch it, but it lets you set up project-specific configurations if you want to mess with Sanity via the command line. There's a link below if you want to learn more.
import {defineCliConfig} from 'sanity/cli'
export default defineCliConfig({ api: { projectId: 'YOURPROJECTID', dataset: 'production' }})
And that's basically it! The Sanity project structure is pretty straightforward, and as we add schemas to our project, you'll become more accustomed to it.