Skip to content

rdiol12/smartcart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SmartCart

A smart grocery shopping app for Israeli supermarkets. Compare prices across chains, manage shopping lists in real-time with family members, and track spending.

Live: https://smartcartapp.net

Features

  • Email verification & JWT auth (access + refresh tokens)
  • Product search and price comparison across Israeli supermarket chains
  • Shopping lists with real-time collaboration (Socket.IO)
  • Family accounts (parent/child) with shared lists
  • Price history charts
  • List templates with scheduled recurring lists
  • Invite links to share lists
  • Dark/Light theme support
  • PWA — installable on mobile
  • Rate limiting and input validation

Tech Stack

Layer Technology
Frontend React 19, Vite, React Router 7
Backend Express 5, Node.js
Database PostgreSQL (Neon)
Real-time Socket.IO
Auth JWT access/refresh tokens + HTTP-only cookies
Email Resend (HTTP API)
Hosting Vercel (frontend) + Railway (backend)

Project Structure

smartcart/
├── frontend/              # React + Vite app
│   ├── src/
│   │   ├── pages/         # Login, Register, Home, MyLists, ListDetail, Store, Profile, etc.
│   │   ├── components/    # NavBar, BarcodeScanner, PriceHistoryChart, ListItemRow, etc.
│   │   ├── context/       # AuthContext, ThemeContext
│   │   ├── api.js         # Axios client with token refresh interceptor
│   │   └── socket.js      # Socket.IO client
│   ├── public/            # PWA manifest, service worker, icons
│   └── vercel.json        # SPA rewrite rules
├── server/                # Express.js API
│   ├── routes/            # auth.js, lists.js, family.js, simplified_products.js
│   ├── middleware/         # JWT auth, rate limiter, validators
│   ├── utils/             # Logger (Winston), price snapshots
│   └── db/                # Migrations, parser, exports
├── init.sql/              # Database schema (app + app2 schemas)
└── railway.json           # Railway deployment config

Local Development

Prerequisites

  • Node.js >= 22
  • PostgreSQL database

Setup

  1. Clone the repo:

    git clone https://github.com/rdiol12/smartcart.git
    cd smartcart
  2. Set up the database:

    psql <your-connection-string> < init.sql/init.sql
  3. Start the backend:

    cd server
    npm install
    cp .env.example .env  # then fill in your values
    node server.js
  4. Start the frontend:

    cd frontend
    npm install
    npm run dev

Environment Variables

Backend (server/.env):

Variable Description
DATABASE_URL PostgreSQL connection string
JWT_SECRET Secret for access tokens
JWT_REFRESH_SECRET Secret for refresh tokens
CORS_ORIGIN Frontend URL(s), comma-separated
FRONTEND_URL Frontend URL for email redirects
BASE_URL Backend public URL (for verify-email links)
RESEND_API_KEY Resend.com API key for emails
EMAIL_FROM Sender email (e.g. register@smartcartapp.net)
PORT Server port (default: 3000)

Frontend (VITE_ env vars in Vercel or .env):

Variable Description
VITE_API_URL Backend API URL

Deployment

The app is deployed across three services:

Frontend — Vercel

Backend — render

Database — Neon

Email — Resend

for the scraper i used https://github.com/OpenIsraeliSupermarkets/israeli-supermarket-scarpers

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages