Skip to content

rollemira/create-sst3-turbo

Repository files navigation

create-sst3-turbo

A starter repository based on create-t3-turbo with some modifications to deploy to AWS using SST.

You can find more docs in Notion here

What's in the box?

  • Expo mobile app
  • NextJS web site
  • Vite web site
  • API using tRPC

Prerequisites

brew install nvm pnpm awscli

Configure aws-cli

  1. Create an AWS account

  2. Create an IAM user

  3. Configure the aws-cli

Check your AWS profile

code ~/.aws/credentials

Note If you are using multiple profiles you can use the following command to set your profile.

export AWS_PROFILE=<profile_name>

Get Started

This repository uses Turso for database storage. You could easily use something else such as Supabase or Amazon RDS but it would require making changes to the packages/db project.

In this template, @acme is used as a placeholder for package names. As a user, you might want to replace it with your own organization or project name. You can use find-and-replace to change all the instances of @acme to something like @my-company or @project-name

Database Setup

  • Make a database at Turso
  • Click your database to get your URL
  • Set your DATABASE_URL in .env
  • Go to Databases -> Database -> Get Token to get your token
  • Set your DATABASE_TOKEN in .env

Turso is free to start.

Quick Start

Use the command below to make a .env and fill it in with the correct settings.

# configure environment variables
cp .env.example .env

# use node version
nvm use

# install dependencies
pnpm i

# setup SST secrets
pnpm run secrets

# push Drizzle schema to db
pnpm run db:push

Note Some lambda functions require secrets. (more about them here) To setup secrets, once you've filled in your .env file you can run the pnpm run secrets to set them in your AWS environment.

Developing

Terminal_1: Start backend server

<wsroot>$ pnpm run dev

Terminal_2: Start your frontend of choice

# mobile
<wsroot>$ pnpm run dev:mobile
# web (vite)
<wsroot>$ pnpm run dev:web

Running mobile apps iOS or Android

Database management

You can use the built in Drizzle-kit Studio to view your data

<wsroot>$ pnpm run db:studio

Deploying

# Mobile apps can be deployed using EAS
# Deploy API and web using SST
<wsroot>$ pnpm run deploy --stage prod