Skip to content

Quick Start

This guide will walk you through creating and deploying your first SQLPage application using Spry.

Follow these steps to generate SQLPage assets and start the development server:

  1. Generate the SQLPage source files from your Spryfile.md:

    Terminal window
    ./spry.ts spc --fs dev-src.auto --destroy-first --conf sqlpage/sqlpage.json
  2. Run Spry in watch mode for live reloading:

    Terminal window
    ./spry.ts spc --fs dev-src.auto --destroy-first --conf sqlpage/sqlpage.json --watch
  3. Deploy SQLPage components to your SQLite database:

    Terminal window
    ./spry.ts task deploy
  4. Launch the SQLPage server:

    Terminal window
    SQLPAGE_SITE_PREFIX="" sqlpage

    Your application will be available at http://localhost:8080

The Spryfile.md is where you define your application. Here’s a simple example:

# My First Spry App
## Database Setup
```bash prepare-db --descr "Initialize database"
sqlite3 app.db < schema.sql
```
## Home Page
```sql index.sql
SELECT 'text' AS component,
'Welcome to Spry!' AS title,
'This is my first SQLPage app' AS contents;
```

1. Write in Markdown

Define your application logic, routes, and tasks in Spryfile.md

2. Generate Assets

Spry converts your Markdown into SQLPage-compatible files

3. Deploy

Run tasks and deploy your application to the database

4. Serve

SQLPage serves your application directly from the database