This is a Blitz.js app.
Run your app in the development mode.
blitz dev
Open http://localhost:3000 with your browser to see the result.
Ensure the .env.local file has required environment variables:
DATABASE_URL=postgresql://<YOUR_DB_USERNAME>@localhost:5432/console
Ensure the .env.test.local file has required environment variables:
DATABASE_URL=postgresql://<YOUR_DB_USERNAME>@localhost:5432/console_test
Runs your tests using Jest.
blitz test
or
yarn test
Blitz comes with a test setup using Jest and react-testing-library.
Blitz comes with a powerful CLI that is designed to make development easy and fast. You can install it with npm i -g blitz
blitz [COMMAND]
build Create a production build
console Run the Blitz console REPL
db Run database commands
generate Generate new files for your Blitz project
help display help for blitz
start Start a development server
test Run project tests
You can read more about it on the CLI Overview documentation.
Here is the structure of your app.
console
βββ app
β |ββ auth
βΒ Β βΒ Β βββ components
βΒ Β βΒ Β β βββ LoginForm.tsx
βΒ Β βΒ Β βββ mutations
βΒ Β βΒ Β β βββ login.ts
βΒ Β βΒ Β β βββ logout.ts
βΒ Β βΒ Β β βββ signup.ts
βΒ Β βΒ Β βββ pages
βΒ Β βΒ Β βββ login.tsx
βΒ Β βΒ Β βββ signup.tsx
βΒ Β βββ auth-utils.ts
βΒ Β βββ validations.ts
βΒ Β βββ components
βΒ Β βΒ Β βββ Form.tsx
βΒ Β βΒ Β βββ LabeledTextField.tsx
βΒ Β βββ hooks
βΒ Β βΒ Β βββ useCurrentUser.ts
βΒ Β βββ layouts
βΒ Β βΒ Β βββ Layout.tsx
βΒ Β βββ pages
βΒ Β β βββ _app.tsx
βΒ Β β βββ _document.tsx
βΒ Β β βββ 404.tsx
βΒ Β β βββ index.tsx
βΒ Β β βββ index.test.tsx
βΒ Β βββ users
βΒ Β βΒ Β βββ queries
βΒ Β βΒ Β βββ getCurrentUser.ts
βββ db
βΒ Β βββ migrations
βΒ Β βββ index.ts
βΒ Β βββ schema.prisma
βββ integrations
βββ node_modules
βββ public
βΒ Β βββ favicon.ico
βΒ Β βββ logo.png
βββ test
βΒ Β βββ __mocks__
βΒ Β βΒ Β βββ fileMock.js
βΒ Β βββ setup.ts
βΒ Β βββ utils.tsx
βββ utils
βββ .env
βββ .eslintrc.js
βββ .gitignore
βββ .npmrc
βββ .prettierignore
βββ babel.config.js
βββ blitz.config.js
βββ jest.config.js
βββ package.json
βββ README.md
βββ tsconfig.json
βββ yarn.lock
These files are:
-
The
app/directory is a container for most of your project. This is where youβll put any pages or API routes. -
db/ is where your database configuration goes. If youβre writing models or checking migrations, this is where to go. -
node_modules/is where your βdependenciesβ are stored. This directory is updated by your package manager, so you donβt have to worry too much about it. -
public/is a directory where you will put any static assets. If you have images, files, or videos which you want to use in your app, this is where to put them. -
test/is a directory where you can put your unit and integration tests. -
utils/is a good place to put any shared utility files which you might use across different sections of your app. -
.babelrc.js,.env, etc. ("dotfiles") are configuration files for various bits of JavaScript tooling. -
blitz.config.jsis for advanced custom configuration of Blitz. It extendsnext.config.js. -
jest.config.jscontains config for Jest tests. You can customize it if needed. -
package.jsoncontains information about your dependencies and devDependencies. If youβre using a tool likenpmoryarn, you wonβt have to worry about this much. -
tsconfig.jsonis our recommended setup for TypeScript.
You can read more about it in the File Structure section of the documentation.
Read the Blitz.js Documentation to learn more.
Read the Blitz Manifesto to learn the Blitz foundational principles.
Blitz is built on Next.js. For more info on this see Why use Blitz instead of Next.js
The Blitz community is warm, safe, diverse, inclusive, and fun! Feel free to reach out to us in any of our communication channels.
Thanks goes to these wonderful people (emoji key):
0xflotus π |
Talor Anderson π |
This project follows the all-contributors specification. Contributions of any kind welcome!
