Common commands
Learn about common commands you need to know to work with the project.
For sure, you don't need these commands to kickstart your project, but it's useful to know they exist for when you need them.
Want shorter commands?
You can set up aliases for these commands in your shell configuration file. For example, you can set up an alias for pnpm
to p
:
alias p='pnpm'
Or, if you're using Zsh, you can add the alias to ~/.zshrc
:
alias p='pnpm'
Then run source ~/.bashrc
or source ~/.zshrc
to apply the changes.
You can now use p
instead of pnpm
in your terminal. For example, p i
instead of pnpm install
.
Installing dependencies
To install the dependencies, run:
pnpm install
Starting development server
Start development server by running:
pnpm dev
Building project
To build the project (including all apps and packages), run:
pnpm build
Building specific app/package
To build a specific app/package, run:
pnpm turbo build --filter=<package-name>
Cleaning project
To clean the project, run:
pnpm clean
Then, reinstall the dependencies:
pnpm install
Formatting code
To format code using Prettier, run:
pnpm format:fix
Linting code
To lint code using ESLint, run:
pnpm lint:fix
Typechecking
To typecheck the code using TypeScript, run:
pnpm typecheck
Adding UI components
To add a new web component, run:
pnpm --filter @turbostarter/ui-web ui:add
This command will add and export a new component to @turbostarter/ui-web
package.
To add a new mobile component, run:
pnpm --filter @turbostarter/ui-mobile ui:add
This command will add and export a new component to @turbostarter/ui-mobile
package.
Database commands
We have a few commands to help you manage the database leveraging Drizzle CLI.
Generating migrations
To generate a new migration, run:
pnpm db:generate
It will create a new migration .sql
file in the migrations
folder.
Running migrations
To run the migrations against the db, run:
pnpm db:migrate
It will apply all the pending migrations.
Pushing changes directly
Don't mess up with your schema!
Make sure you know what you're doing before pushing changes directly to the db.
To push changes directly to the db, run:
pnpm db:push
It lets you push your schema changes directly to the database and omit managing SQL migration files.
Checking database
To check the database schema consistency, run:
pnpm db:check
Docker commands
We have a few commands to help you manage the database instance (for local development).
Starting container
To start the database container, run:
pnpm db:start
It will run the PostgreSQL container. You can check its config in packages/db/docker-compose.yml
.
Stopping container
To stop the database container, run:
pnpm db:stop
Displaying status
To check the status and logs of the database container, run:
pnpm db:status
How is this guide?
Last updated on