Skip to content

Getting Started

Hey founder, welcome to Turboship πŸ‘‹

Here's a brief guide to setting up your monorepo. Follow these steps to get your app operational. After that, use this tutorial to get your project launched in just 5 minutes. Let’s quickly build that startup! ⚑️

Setting up the local environment

Starting a new project with Turboship is easy. The very first thing you need to do is to set up your local environment. To do that, you need to have the following tools installed:

After you have installed these tools, you are ready to start building your project. Just follow the steps below to get started.

Create a new repository

Create a new repo based on this template

Clone the repository

Open the terminal and execute

git clone https://github.com/MYORG/MYREPO.git
cd MYREPO

Set up the project

Navigate to your repository directory and execute:

docker-compose up -d   # start services
bun setup

This will install all the dependencies and set up the project properly. After that, edit .env.local and fill out the required information.

πŸŽ‰ Everything is ready

Now you are ready to start developing! To start the project, simply run bun dev and open your browser at http://localhost:3000.

The project structure

The project structure is very simple and easy to understand. Turboship uses a monorepo structure which means that all the code necessary to run your business is in a single repository. This makes it easier to manage the code and make sure everything runs in sync. If your not familiar with monorepos, don't worry, it's very easy to understand.

Here's a brief overview of the project structure:

  • /apps/ - This is where all the apps are located. Each app is a separate on a single folder. If want to add a new app, just create a new folder here.
  • /packages/ - This is where all the shared code between apps are located. This includes things like the database models, the design system and logger.

/apps/web structure

This is the initial Next.js app that comes with the template. It follows the same structure as a regular Next.js app does. Here's a brief overview of the folders:

  • /app - Pages and API routes
  • /components - Shared UI Components
  • /lib - Libraries and utilities functions (Stripe, Email, Analytics, etc)

/packages/email structure

This is the package that contains all the email templates. It uses react-email to render the emails. During development, it will start a server on port 4000 where you can preview the emails.

/packages/db structure

This is the package that contains all the database models. It uses Prisma to manage the database layer as well as migrations. The database is a PostgreSQL during development and production. You can change it to any other database you want.

Configuring the project

The project is configured using a .env.local file. This file contains all the environment variables necessary to run the project. After you have ran bun setup the file will be created for you.

There's a suficient amount of comments in the file to help you understand what each variable does. If you have any questions, feel free to ask in the Discord.