Create Your First App
This tutorial walks you through creating a new Next.js application with RocketFuel. By the end, youβll have a fully configured project with authentication and database setup.
Create a New Project
-
Run the init command
Open your terminal and run:
Terminal window rocketfuel init my-appYou can replace
my-appwith any name for your project. -
Select features
RocketFuel will prompt you to select optional features:
π Welcome to Rocketfuel!Let's create your Next.js application.π¦ Select optional features:? Add Better Auth for authentication? (Y/n)? Add Stripe checkout integration? (y/N)? Add BullMQ for job queues and background workers? (y/N)? Add Resend for email sending? (y/N)? Add CLAUDE.md for AI coding assistants? (Y/n)For this tutorial, select:
- Better Auth: Yes (recommended for most apps)
- Stripe: No (skip for now)
- BullMQ: No (skip for now)
- Resend: No (skip for now)
- CLAUDE.md: Yes (helpful if using AI assistants)
-
Wait for project creation
RocketFuel will:
- Create a new Next.js project with TypeScript and Tailwind
- Set up the folder structure
- Install and configure shadcn/ui components
- Configure Drizzle ORM
- Add authentication pages and API routes (if selected)
- Generate configuration files
This typically completes in under a minute.
-
Review the output
When complete, youβll see:
β Your project is ready!π Next steps:cd my-app# Copy .env.example to .env and configure your variablescp .env.example .env# Set up your database and run migrationsnpx drizzle-kit push# Start the development servernpm run dev
Understanding the Project Structure
Your new project has this structure:
my-app/βββ src/β βββ app/β β βββ api/β β β βββ auth/[...all]/route.ts # Auth API routesβ β βββ (auth)/β β β βββ login/page.tsx # Login pageβ β β βββ signup/page.tsx # Signup pageβ β βββ layout.tsxβ β βββ page.tsxβ βββ components/β β βββ ui/ # shadcn/ui componentsβ βββ lib/β β βββ auth.ts # Better Auth configβ β βββ utils.tsβ βββ server/β βββ db/β βββ index.ts # Database clientβ βββ schema.ts # Drizzle schemaβββ .env.example # Environment templateβββ docker-compose.yml # Docker servicesβββ drizzle.config.ts # Drizzle configurationβββ package.jsonβββ CLAUDE.md # AI assistant docsConfigure Environment Variables
-
Copy the environment template
Terminal window cd my-appcp .env.example .env -
Edit the
.envfileOpen
.envand configure the required variables:Terminal window # DatabaseDATABASE_URL="postgresql://user:password@localhost:5432/myapp"# AuthenticationBETTER_AUTH_SECRET="generate-a-secure-secret"BETTER_AUTH_URL="http://localhost:3000" -
Generate a secure auth secret
Use OpenSSL to generate a random secret:
Terminal window openssl rand -base64 32Copy the output and paste it as your
BETTER_AUTH_SECRET.
Set Up the Database
RocketFuel uses Drizzle ORM with PostgreSQL. Youβll need a running PostgreSQL instance.
-
Start PostgreSQL
If you donβt have PostgreSQL running, you can use Docker:
Terminal window docker run --name postgres -e POSTGRES_PASSWORD=password -p 5432:5432 -d postgresOr create a database on a hosted service like Neon, Supabase, or Railway.
-
Push the schema
Once your database is running and
DATABASE_URLis configured:Terminal window npx drizzle-kit pushThis creates the necessary tables for authentication.
Next Steps
Your project is configured! Continue to Running Your App to start the development server and see it in action.