├── app/
│ ├── core/
│ │ ├── components/
│ │ │ ├── Form.tsx
│ │ │ └── LabeledTextField.tsx
│ │ ├── hooks/
│ │ │ └── useCurrentUser.ts
│ │ └── layouts/
│ │ └── Layout.tsx
│ ├── pages/
│ │ ├── 404.tsx
│ │ ├── _app.tsx
│ │ ├── _document.tsx
│ │ ├── index.test.tsx
│ │ ├── index.tsx
│ │ └── projects/
│ │ ├── [id]/
│ │ │ └── edit.js
│ │ ├── [id].js
│ │ ├── index.js
│ │ └── new.js
│ ├── api/
│ │ └── stripe-webhook.js
│ ├── auth/
│ │ ├── components/
│ │ │ ├── LoginForm.tsx
│ │ │ └── SignupForm.tsx
│ │ ├── mutations/
│ │ │ ├── login.ts
│ │ │ ├── logout.ts
│ │ │ └── signup.ts
│ │ ├── pages/
│ │ │ ├── login.tsx
│ │ │ └── signup.tsx
│ │ ├── auth-utils.ts
│ │ └── validations.ts
│ ├── users/
│ │ └── queries/
│ │ └── getCurrentUser.ts
│ └── projects/
│ ├── components/
│ │ ├── Project.js
│ │ ├── ProjectForm.js
│ │ └── Projects.js
│ ├── mutations/
│ │ ├── createProject.js
│ │ ├── createProject.test.js
│ │ ├── deleteProject.js
│ │ ├── deleteProject.test.js
│ │ ├── updateProject.js
│ │ └── updateProject.test.js
│ └── queries/
│ ├── getProject.js
│ └── getProjects.js
├── db/
│ ├── index.ts
│ ├── schema.prisma
│ └── seeds.ts
├── integrations/
│ └── sentry.ts
├── public/
│ ├── favicon.ico*
│ └── logo.png
├── test/
│ ├── setup.ts
│ └── utils.tsx
├── README.md
├── babel.config.js
├── blitz.config.js
├── jest.config.js
├── package.json
├── tsconfig.json
├── types.ts
└── yarn.lockappContains all your core application code.
app/ can be anything you want, but we
recommend the following:core/,
projects/, users/, billing/, etc.components/ and hooks/ go inside one of the
above domain context foldersapp.pages/ expose a React component at a URL. Follows the same semantics
as the Next.js pages/ folder.api/ expose a Node.js request handler at URL. Same semantics as
Next.js pages/api/ folder.queries/ and mutations/ are for your Blitz queries and mutations.
Each query and mutation is exposed at a URL corresponding to its file
path.dbContains database configuration, schema, and migration files.
db/index.js exports your initialized database client so you can use it
anywhere in your app.
integrationsContains third-party integration code. Ex: auth0.js, twilio.js, etc.
These files are a good place to instantiate a client with shared
configuration.
pagesThe top level pages folder and all nested pages folders inside app
are merged together at build time. The build will fail if the same route
is defined in two places.
pages folder. All files in here
are mapped to the url corresponding to their file paths.app. But if you want, you can instead place all your
route files in this top level folders instead of being spread out in
various folders inside appapiSame as Next.js pages/api folder, but not nested inside pages.
And like the pages folder, the top level api folder and all nested
api folders inside app are merged together at build time.
publicAll files in here are served statically from your app's root URL
blitz.config.jsA configuration file with the same format as next.config.js
app/projects/queries/getProject from anywhere in our app.