Installation

Learn how to install Strav and set up your development environment.

System Requirements

Before installing Strav, ensure your system meets these requirements:

  • Bun v1.3.9+ or higher

Installing Bun

Strav is built for the Bun runtime. See the official Bun installation guide for instructions on your platform.

Verify Installation

bun --version
# Should output: 1.3.9 or higher

Installing Strav

There are several ways to start a new Strav project:

Option 1: Using Spring Generator (Recommended)

The Spring generator creates a complete application structure with all necessary files:

# Create a new web application
bunx @strav/spring my-app --web --db=my_app_db

# Navigate to the project
cd my-app

# Install dependencies
bun install

Option 2: Manual Installation

For more control, you can manually install Strav packages:

# Create a new directory
mkdir my-app && cd my-app

# Initialize a new Bun project
bun init

# Install core Strav packages
bun add @strav/kernel @strav/http @strav/database @strav/view

# Install development dependencies
bun add -d @types/bun typescript

Environment Configuration

Create a .env file in your project root:

# Application
APP_NAME=my-app
APP_ENV=local
APP_KEY=your-secret-key-here
APP_DEBUG=true
APP_URL=http://localhost:3000
APP_PORT=3000

# Database
DB_HOST=127.0.0.1
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=your-password
DB_DATABASE=my_app_db

# Session
SESSION_SECRET=your-session-secret

# Cache
CACHE_DRIVER=memory

# Mail (optional)
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=
MAIL_PASSWORD=

Verifying Installation

After installation, verify everything is working:

# Run the development server
bun run dev

# You should see:
# Server running at http://localhost:3000
# Database connected successfully
# View engine initialized

Visit http://localhost:3000 in your browser. You should see the Strav welcome page.

Next Steps

Now that Strav is installed, you're ready to: