No description
Find a file
2025-09-03 14:37:48 +02:00
prisma feat(database): add description column to urls table 2025-08-19 17:02:31 +03:00
public Initial commit from Create Next App 2025-06-16 18:52:12 +03:00
src fix(route.ts): update GET and PUT functions to use context.params for better clarity 2025-09-03 13:51:25 +03:00
.dockerignore feat(docker): add Docker support with Dockerfile and docker-compose.yml 2025-07-29 17:59:45 +03:00
.gitignore fix(docker-compose.yml): update database volume mapping and command for better deployment 2025-09-03 14:20:35 +02:00
docker-compose.yml feat(docker): add restart policy 2025-09-03 14:37:21 +02:00
dockerfile fix(docker-compose.yml, Dockerfile): update database volume path and streamline file copying process 2025-09-03 13:51:35 +03:00
eslint.config.mjs feat(eslint): update ESLint configuration to ignore Prisma-generated files and adjust unused variable rules 2025-07-29 17:57:44 +03:00
justfile chore(justfile): make justfile for docker commands 2025-09-03 14:37:48 +02:00
next.config.ts Initial commit from Create Next App 2025-06-16 18:52:12 +03:00
package-lock.json build:packages): add dependencies for sortable properties 2025-08-14 16:49:26 +03:00
package.json build:packages): add dependencies for sortable properties 2025-08-14 16:49:26 +03:00
postcss.config.mjs Initial commit from Create Next App 2025-06-16 18:52:12 +03:00
README.md docs(README): add database schema section with key concepts and data flow diagrams 2025-08-27 15:18:06 +03:00
tsconfig.json Initial commit from Create Next App 2025-06-16 18:52:12 +03:00

Compareware

A modern web application for comparing items and their properties, built with Next.js and Prisma.

What is Compareware?

Compareware allows users to compare different items by their properties in a structured, easy-to-use interface. Users can:

  • Add items for comparison via URLs
  • Select relevant properties for comparison
  • View side-by-side comparisons of items
  • Manage and customize comparison criteria

Tech Stack

  • Frontend: Next.js 15 with TypeScript
  • Database: SQLite with Prisma ORM
  • Styling: Tailwind CSS
  • Runtime: Node.js

Quick Start

Prerequisites

  • Node.js 18+
  • npm, yarn, or pnpm

Get the app running:

# 1. Clone and navigate to the project
git clone ssh://git@forge.ftt.gmbh/Progyssey/Compareware_next.js.git
cd compareware-nextjs

# 2. Install dependencies
npm install
# or
yarn install
# or
pnpm install

# 3. Set up the database
npx prisma generate
npx prisma migrate dev

# 4. Start the development server
npm run dev
# or
yarn dev
# or
pnpm dev

Open http://localhost:3000 with your browser to see the application.

Database Schema

Key Concepts

  • PK (Primary Key): Unique identifier for table records (🔑)
  • FK (Foreign Key): Reference linking related tables (➡️)
  • Core Properties: name and description properties that are always present
  • Global Item ID: Shared identifier allowing items to exist across multiple URLs

Tables Overview

Table Columns (PK/FK) Description Example Data
urls id (PK), url, description, created_at Stores comparison URLs with metadata 1, "/laptops", "Gaming laptops comparison", 2024-03-01
items id (PK), url_id (FK), global_item_id, wikidata_id, item_order Items within specific URLs, linked to global items "item1", 1, "global_macbook_pro", "Q214276", 0
properties id (PK), name, global_usage_count All available properties with usage tracking 1, "name", 5
2, "description", 5
3, "screen_size", 3
item_properties global_item_id (PK), property_id (PK/FK), value, is_user_edited, updated_at Property values for global items "global_macbook_pro", 1, "MacBook Pro", false, 2024-03-01
"global_macbook_pro", 3, "16 inches", true, 2024-03-01
selected_properties url_id (PK/FK), property_id (PK/FK), display_order Active properties per URL 1, 3, 0
deleted_properties url_id (PK/FK), global_item_id (PK), property_id (PK/FK) Soft-deleted properties per URL/item 1, "global_macbook_pro", 4

Data Flow

flowchart LR
    User -->|Creates| urls
    User -->|Adds| items
    User -->|Defines| properties
    User -->|Selects| selected_properties
    User -->|Sets Values| item_properties
    User -->|Soft Deletes| deleted_properties
    
    urls -->|url_id| items
    urls -->|url_id| selected_properties
    urls -->|url_id| deleted_properties
    
    items -->|global_item_id| item_properties
    items -->|global_item_id| deleted_properties
    
    properties -->|property_id| selected_properties
    properties -->|property_id| item_properties
    properties -->|property_id| deleted_properties
    
    subgraph "Global Item Concept"
        items -.->|shares global_item_id| item_properties
        item_properties -.->|can exist across multiple URLs| items
    end

Properties Data Flow

sequenceDiagram
    participant User
    participant App as Application
    participant DB as Database
    participant Wikidata
    
    User->>App: Enters search
    App->>Wikidata: fetch_wikidata_suggestions()
    Wikidata-->>App: Return suggestions
    App->>User: Show suggestions
    
    User->>App: Selects item
    App->>Wikidata: fetch_item_properties()
    Wikidata-->>App: Return properties (IDs + values)
    App->>Wikidata: fetch_property_labels()
    Wikidata-->>App: Return labels
    
    App->>DB: Store/update item_properties with global_item_id
    App->>DB: Update property global_usage_count
    App->>DB: Check deleted_properties for soft deletes
    
    App->>User: Show labeled properties (filtered by soft deletes)
    
    Note over App,DB: Items can be reused across URLs via global_item_id
    Note over App,DB: User edits tracked with is_user_edited flag