Skip to content

jaimejim/soexpensive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

137 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SoExpensive πŸ’°

A fast and simple web application to compare prices of Finnish supermarket goods across multiple stores and track price changes over time.

Features

  • πŸ“Š Price Comparison - Compare prices across 6 major Finnish supermarkets
  • πŸ“ˆ Price History - Track and visualize price changes over time
  • πŸ” Smart Filtering - Search by product name and filter by category
  • πŸ“± Responsive Design - Works seamlessly on desktop and mobile
  • ⚑ Fast Performance - Minimal dependencies, optimized for speed
  • πŸ’Ύ Historical Data - Store and analyze price progression throughout the year

Supported Stores

  • S-Market
  • Prisma
  • K-Citymarket
  • K-Supermarket
  • Lidl
  • Alepa

Tech Stack

  • Backend: Node.js + Express
  • Database: PostgreSQL (Vercel Postgres)
  • Frontend: Vanilla JavaScript, HTML5, CSS3
  • Charts: Chart.js (only external library for visualizations)

πŸš€ Quick Deploy

Deploy to Vercel (Recommended)

Deploy with Vercel

  1. Click the button above or go to vercel.com/new
  2. Import this repository
  3. Add Vercel Postgres database (Storage β†’ Create β†’ Postgres)
  4. Deploy!
  5. Run node seed.js to populate the database (see VERCEL_DEPLOY.md)

See VERCEL_DEPLOY.md for complete deployment guide.

Deploy to Replit (Alternative)

  1. Go to Replit
  2. Click "Create Repl" β†’ "Import from GitHub"
  3. Paste this repository URL
  4. Click "Run"
  5. Your app is live!

See DEPLOY.md for Replit deployment instructions.

Installation

  1. Clone the repository
git clone <repository-url>
cd soexpensive
  1. Install dependencies
npm install
  1. Seed the database with sample data
node seed.js
  1. Start the server
npm start
  1. Open your browser and navigate to
http://localhost:3000

Usage

Viewing Prices

  • Browse all products in the main table
  • See which store has the best price (highlighted in green)
  • Compare prices across all stores at a glance

Filtering & Sorting

  • Search: Type product name in the search box
  • Category Filter: Select a category from the dropdown
  • Sort Options:
    • By name (alphabetical)
    • By category
    • By price (low to high, high to low)
    • By price variance (biggest price differences)

Price History

  • Click the "πŸ“Š History" button next to any product
  • View an interactive chart showing price changes over time
  • Compare price trends across different stores

Database Structure

Tables

products

  • id, name, category, unit, created_at

stores

  • id, name, created_at

prices

  • id, product_id, store_id, price, recorded_at

API Endpoints

GET /api/products

Returns all products with their latest prices

GET /api/products/:id/history

Returns price history for a specific product

GET /api/stores

Returns all stores

POST /api/prices

Add a new price entry

{
  "product_id": 1,
  "store_id": 1,
  "price": 2.99
}

GET /api/products/:id

Get details for a specific product

Adding New Data

To add new products or update prices, you can:

  1. Use the API endpoints
  2. Modify the seed.js file and re-run it
  3. Directly insert into the SQLite database

Example using the API:

fetch('http://localhost:3000/api/prices', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    product_id: 1,
    store_id: 1,
    price: 2.99
  })
});

Project Structure

soexpensive/
β”œβ”€β”€ package.json          # Dependencies and scripts
β”œβ”€β”€ server.js             # Express server
β”œβ”€β”€ db.js                 # Database operations
β”œβ”€β”€ seed.js               # Sample data seeder
β”œβ”€β”€ prices.db             # SQLite database (created after seeding)
β”œβ”€β”€ public/               # Frontend files
β”‚   β”œβ”€β”€ index.html        # Main HTML
β”‚   β”œβ”€β”€ styles.css        # Styling
β”‚   └── app.js            # Frontend JavaScript
└── README.md             # This file

Development

The application is designed to be simple and fast:

  • No build process required
  • No heavy frameworks
  • Minimal dependencies (only Express, better-sqlite3, and Chart.js)
  • Pure vanilla JavaScript on the frontend

Performance

  • Fast page loads (< 100ms)
  • Efficient database queries with indexing
  • Lazy loading of price history data
  • Responsive UI with debounced search

Future Enhancements

Potential features to add:

  • Real API integration with actual Finnish supermarket data
  • User accounts and shopping lists
  • Price alerts and notifications
  • Export data to CSV/Excel
  • Mobile app version
  • Barcode scanning

License

MIT

Author

Created as a simple, useful tool for comparing Finnish supermarket prices.

About

Price comparison of Finnish supermarkets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors