que Svelte Themes

Que

💸 Que is a proof-of-concept application for browsing companies’ financial data.

Que

Que is a SvelteKit proof of concept application for browsing company data, powered by Cloudflare D1.

Setup

Prerequisites

  • Node.js >= 20
  • Wrangler CLI (npm install -g wrangler)

1. Install dependencies

npm install

2. Set up Cloudflare D1 database

Create a D1 database:

npx wrangler d1 create que-db

Copy the database_id from the output and update wrangler.json:

{
  "d1_databases": [
    {
      "binding": "que_db",
      "database_name": "que-db",
      "database_id": "YOUR_DATABASE_ID_HERE"
    }
  ]
}

3. Import CSV data

Generate SQL from CSV files in data/:

node scripts/csv_to_d1_sql.js

Import schema and data:

npx wrangler d1 execute que-db --file d1/schema.sql --local
npx wrangler d1 execute que-db --file d1/companies_inserts.sql --local

Verify the import:

npx wrangler d1 execute que-db --command "SELECT COUNT(*) FROM companies;" --local

4. Run development server

npm run dev
# or
npx wrangler dev

Production

Build for production:

npm run build

Deploy to Cloudflare Pages:

npx wrangler pages deploy build

Note: For production, run the D1 import commands without --local flag to import into your production database.

Top categories

Loading Svelte Themes