Common commands
Learn about common commands you need to know to work with the mobile 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.
Injecting environment variables
To inject environment variables into the command you run, prefix it with with-env:
pnpm with-env <command>For example, pnpm with-env pnpm build will run pnpm build with the environment variables injected.
Some commands, like pnpm dev, automatically inject the environment variables for you.
Installing dependencies
To install the dependencies, run:
pnpm installStarting development server
Start development server by running:
pnpm devBuilding project
To build the project (including all apps and packages), run:
pnpm buildBuilding specific app/package
To build a specific app/package, run:
pnpm turbo build --filter=<package-name>Cleaning project
To clean the project, run:
pnpm cleanThen, reinstall the dependencies:
pnpm installFormatting code
To check for formatting errors using Prettier, run:
pnpm formatTo fix formatting errors using Prettier, run:
pnpm format:fixLinting code
To check for linting errors using ESLint, run:
pnpm lintTo fix linting errors using ESLint, run:
pnpm lint:fixTypechecking
To typecheck the code using TypeScript for any type errors, run:
pnpm typecheckAdding UI components
To add a new web component, run:
pnpm --filter @turbostarter/ui-web ui:addThis 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:addThis command will add and export a new component to @turbostarter/ui-mobile package.
Services commands
We have a few commands to help you manage the services containers (for local development).
Starting containers
To start the services containers, run:
pnpm services:startIt will run all the services containers. You can check their configs in docker-compose.yml.
Setting up services
To setup all the services, run:
pnpm services:setupIt will start all the services containers and run necessary setup steps.
Stopping containers
To stop the services containers, run:
pnpm services:stopDisplaying status
To check the status and logs of the services containers, run:
pnpm services:statusDisplaying logs
To display the logs of the services containers, run:
pnpm services:logsDatabase commands
We have a few commands to help you manage the database leveraging Drizzle CLI.
Generating migrations
To generate a new migration, run:
pnpm with-env turbo db:generateIt will create a new migration .sql file in the packages/db/migrations folder.
Running migrations
To run the migrations against the db, run:
pnpm with-env pnpm --filter @turbostarter/db db:migrateIt 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 with-env pnpm --filter @turbostarter/db db:pushIt lets you push your schema changes directly to the database and omit managing SQL migration files.
Resetting database
To reset the database, run:
pnpm with-env pnpm --filter @turbostarter/db db:resetIt will reset the database to the initial state.
Seeding database
To seed the database with some example data (for development purposes), run:
pnpm with-env turbo db:seedIt will populate your database with some example data.
Checking database
To check the database schema consistency, run:
pnpm with-env pnpm --filter @turbostarter/db db:checkStudying database
To study the database schema in the browser, run:
pnpm with-env pnpm --filter @turbostarter/db db:studioThis will start the Studio on https://local.drizzle.studio.
How is this guide?
Last updated on