No description
  • Svelte 49.2%
  • TypeScript 47.9%
  • HTML 2%
  • CSS 0.5%
  • Dockerfile 0.2%
  • Other 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-03-23 09:11:55 +00:00
drizzle Add core pumps.gg project structure and initial files 2026-03-23 08:57:16 +00:00
placeholder docker fix 2026-03-23 09:11:55 +00:00
scripts Add core pumps.gg project structure and initial files 2026-03-23 08:57:16 +00:00
services/ocr-service Add core pumps.gg project structure and initial files 2026-03-23 08:57:16 +00:00
src Add core pumps.gg project structure and initial files 2026-03-23 08:57:16 +00:00
static Add core pumps.gg project structure and initial files 2026-03-23 08:57:16 +00:00
training-images Add core pumps.gg project structure and initial files 2026-03-23 08:57:16 +00:00
.env.example Add core pumps.gg project structure and initial files 2026-03-23 08:57:16 +00:00
.gitignore Add core pumps.gg project structure and initial files 2026-03-23 08:57:16 +00:00
ANALYTICS.md Add core pumps.gg project structure and initial files 2026-03-23 08:57:16 +00:00
CLAUDE.md Add core pumps.gg project structure and initial files 2026-03-23 08:57:16 +00:00
docker-compose.dev.yml Add core pumps.gg project structure and initial files 2026-03-23 08:57:16 +00:00
docker-compose.yml Add core pumps.gg project structure and initial files 2026-03-23 08:57:16 +00:00
Dockerfile Add core pumps.gg project structure and initial files 2026-03-23 08:57:16 +00:00
drizzle.config.ts Add core pumps.gg project structure and initial files 2026-03-23 08:57:16 +00:00
image.png Add core pumps.gg project structure and initial files 2026-03-23 08:57:16 +00:00
package-lock.json Add core pumps.gg project structure and initial files 2026-03-23 08:57:16 +00:00
package.json Add core pumps.gg project structure and initial files 2026-03-23 08:57:16 +00:00
plan.md Add core pumps.gg project structure and initial files 2026-03-23 08:57:16 +00:00
postcss.config.js Add core pumps.gg project structure and initial files 2026-03-23 08:57:16 +00:00
README.md update readme and placeholder 2026-03-23 09:02:40 +00:00
stations.csv Add core pumps.gg project structure and initial files 2026-03-23 08:57:16 +00:00
svelte.config.js Add core pumps.gg project structure and initial files 2026-03-23 08:57:16 +00:00
tailwind.config.ts Add core pumps.gg project structure and initial files 2026-03-23 08:57:16 +00:00
tsconfig.json Add core pumps.gg project structure and initial files 2026-03-23 08:57:16 +00:00
tsconfig.scripts.json Add core pumps.gg project structure and initial files 2026-03-23 08:57:16 +00:00
vite.config.js Add core pumps.gg project structure and initial files 2026-03-23 08:57:16 +00:00

pumps.gg

Community-powered fuel price tracker for Guernsey. Track real-time fuel prices across the island with crowdsourced data and official price verification.

Stack

  • Frontend: SvelteKit 5, TypeScript, Tailwind CSS
  • Backend: SvelteKit API routes, TypeScript
  • Database: PostgreSQL with Drizzle ORM
  • Storage: File-based photo storage with sharp for image processing
  • Auth: bcrypt password hashing, session-based authentication
  • Deployment: Docker + Docker Compose

Quick Start

Prerequisites

  • Node.js 20+
  • Docker & Docker Compose
  • PostgreSQL 16 (or use docker-compose)

Development

  1. Clone and install:

    cd pumpsgg
    npm install
    
  2. Setup environment:

    cp .env.example .env
    
  3. Start services:

    docker-compose -f docker-compose.dev.yml up -d
    
  4. Run migrations:

    npm run db:push
    npm run db:seed
    
  5. Start dev server:

    npm run dev
    

Access at http://localhost:5173

Production

  1. Build:

    npm run build
    
  2. Deploy with Docker:

    docker-compose up -d
    

Server runs on port 3000.

Project Structure

src/
├── lib/
│   ├── components/       # Svelte components
│   └── server/           # Backend utilities
│       ├── db/           # Database layer (Drizzle)
│       ├── auth.ts       # Authentication
│       ├── ratelimit.ts  # Rate limiting
│       └── photos.ts     # Image processing
├── routes/               # SvelteKit routes
│   ├── api/              # REST API endpoints
│   └── auth/             # Auth pages
└── app.css              # Global styles

Key Features

  • Community Crowdsourcing: Users submit real-time fuel prices
  • Official Prices: Official users can mark submissions as verified
  • Voting System: Community can verify or flag submissions
  • Reputation Score: Track user accuracy and reliability
  • Photo Verification: Optional OCR + EXIF verification
  • Rate Limiting: Per-user submission limits to prevent spam
  • Offline Support: Service worker for offline capability

API Endpoints

Auth

  • POST /api/auth/login - User login
  • POST /api/auth/register - Create account
  • POST /api/auth/logout - Sign out
  • GET /api/auth/me - Current user info

Stations

  • GET /api/stations - List all stations with latest prices
  • POST /api/stations - Create station (admin only)

Fuel Types

  • GET /api/fuel-types - List fuel types
  • POST /api/fuel-types - Create fuel type (admin only)

Prices

  • GET /api/prices - List prices with filters
  • POST /api/prices - Submit new price (auth required)
  • POST /api/prices/[id]/vote - Vote on a submission

Environment Variables

DATABASE_URL=postgres://user:pass@host:5432/db
SESSION_SECRET=<32+ char random string>
PUBLIC_SITE_URL=https://pumps.gg
ADMIN_EMAIL=admin@pumps.gg
PHOTO_UPLOAD_MAX_SIZE=5242880
PHOTO_STORAGE_PATH=/app/uploads/pump-photos
NODE_ENV=development

Database Schema

Key tables:

  • users - User accounts with reputation
  • stations - Fuel station locations
  • fuel_types - Available fuel categories
  • prices - Crowdsourced price submissions
  • votes - Community verification votes
  • badges - User achievement badges

Development Commands

npm run dev              # Start dev server
npm run build            # Production build
npm run preview          # Preview build locally
npm run check            # Type check
npm run db:generate      # Generate migrations
npm run db:push          # Apply migrations
npm run db:studio        # Open Drizzle Studio
npm run db:seed          # Seed database

Rate Limits

  • Price submissions: 10/hour per user
  • Votes: 50/hour per user
  • Login attempts: 5/15min per IP
  • Registration: 3/hour per IP

Security

  • CSRF protection on all state-changing requests
  • BCRYPT password hashing (12 rounds)
  • Secure session cookies (HttpOnly, SameSite=Strict)
  • Input validation at system boundaries
  • XSS protection headers
  • HSTS for production

License

© 2024 GSY Labs. All rights reserved.