Installation
Get your development environment up and running with this step-by-step installation guide.
Prerequisites
Before you begin, make sure you have the following installed:
- Node.js - Version 20.x or higher (Download)
- PNPM - Version 9.x or higher (Install guide)
- PostgreSQL - Local or remote database (Download)
- Git - For version control (Download)
Clone the repository
First, clone the repository to your local machine:
git clone https://github.com/yourusername/rapidstack-nuxt4.git
cd rapidstack-nuxt4
git clone git@github.com:yourusername/rapidstack-nuxt4.git
cd rapidstack-nuxt4
Install dependencies
Install all project dependencies using PNPM:
pnpm install
This will install all required packages including Nuxt 4, Prisma, Stripe, authentication libraries, and more.
Set up environment variables
Create a .env file in the root directory. You can start by copying the example file:
cp .env.example .env
Then, edit .env with your configuration. At minimum, you'll need:
# Database
DATABASE_URL="postgresql://user:password@localhost:5432/myapp"
# Site configuration
NUXT_PUBLIC_SITE_URL="http://localhost:3000"
NUXT_PUBLIC_SITE_NAME="Your App Name"
NUXT_PUBLIC_SITE_DOMAIN="localhost"
# Email (Resend)
RESEND_API_KEY="re_..."
# Stripe payments
STRIPE_SECRET_KEY="sk_test_..."
NUXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_test_..."
STRIPE_WEBHOOK_SECRET="whsec_..."
# Payment mode: 'auth' or 'authless'
NUXT_PUBLIC_PAYMENT_MODE="auth"
.env file to version control. It contains sensitive credentials.Set up the database
Create your database
If you're using a local PostgreSQL instance, create a new database:
createdb myapp
Or use your PostgreSQL client to create a database.
Run migrations
Run Prisma migrations to set up your database schema:
pnpm prisma migrate dev
This creates all necessary tables including users, sessions, payments, subscriptions, and more.
prisma/schema.prisma.(Optional) Seed the database
If you want to add test data, you can create a seed script:
pnpm prisma db seed
Start the development server
Now you're ready to start the development server:
pnpm dev
The application will be available at http://localhost:3000.
Verify the installation
To make sure everything is working correctly:
- Visit the homepage - You should see the landing page
- Check dark mode - Toggle the theme switcher in the header
- Try registration - Create a test account at
/auth/register - Check the database - Verify the user was created in your database
Next steps
Now that your installation is complete:
Troubleshooting
Port 3000 is already in use
If port 3000 is already in use, you can change it:
PORT=3001 pnpm dev
Database connection errors
Make sure your DATABASE_URL is correct and PostgreSQL is running:
# Check if PostgreSQL is running
pg_isready
# Or with psql
psql -h localhost -U your_username -d your_database
Prisma errors
If you're having Prisma-related issues, try:
# Generate Prisma client
pnpm prisma generate
# Reset the database (⚠️ deletes all data)
pnpm prisma migrate reset
Module not found errors
If you see module import errors after installation:
# Clear Nuxt cache
rm -rf .nuxt
# Reinstall dependencies
rm -rf node_modules pnpm-lock.yaml
pnpm install