Skip to content
Anjaliavv51Public

Latest commit

Β 

History

680 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ•°οΈ RETRO

Timeless Vintage Collections & AI-Powered Retro Discovery

Live Demo Vercel Deployment GitHub license Python 3.10+ Node.js

⭐ Stars 🍴 Forks πŸ› Issues 🟒 Open PRs 🟣 Closed PRs
Stars Forks Issues Open Pull Requests Closed Pull Requests

🌐 Live Website & Demo

Experience the full platform live at: πŸ‘‰ https://retro-vintage-two.vercel.app


πŸ“– Table of Contents


πŸ“œ About Retro

Retro is an e-commerce and curated catalog platform designed for lovers of antique aesthetics, vintage electronics, analog audio, historical typewriters, and timeless collectibles.

Blending nostalgic charm from bygone eras with modern engineering, Retro brings you:

  • An atmospheric, responsive vintage storefront with dark mode, animations, and interactive shopping cart.
  • A Retrieval-Augmented Generation (RAG)-based AI product search system that understands natural language queries, historical eras, acoustic qualities, and aesthetic moods.
  • Automated serverless deployment and continuous delivery on Vercel with GitHub Actions.

✨ Key Features

  • 🧠 Natural Language AI Search (RAG): Search products using human-like queries (e.g., "warm sound system for jazz records", "gift for an old-school writer").
  • πŸ“» Rich Vintage Catalog: High-fidelity records, phonographs, 1950s rangefinder cameras, mechanical typewriters, rotary phones, and collectibles.
  • πŸ›’ Dynamic Cart System: Local storage persistence, live item counters, quantity management, and toast notifications.
  • πŸŒ“ Dark Mode & Nostalgic Themes: Seamless toggle between warm vintage parchment and elegant dark mode.
  • ⚑ Vercel Serverless Architecture: Fast global CDN distribution, edge API routing, and continuous deployment.
  • πŸ“± Progressive Web App (PWA) Ready: Includes service workers and manifest configuration for offline-first resilience.
  • πŸ—„οΈ AI Database Query Agent (Text-to-MQL): Ask questions in plain English to query the MongoDB product catalog, user registrations, customer feedback, and statistical aggregations with read-only security.

🧠 Retrieval-Augmented Generation (RAG) Search

Retro features an integrated RAG-powered product recommendation & search system. Rather than relying only on rigid keyword lookups, it interprets intent, historical period, and aesthetic tone to retrieve and explain matching artifacts.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     User Natural Language Query β”‚  e.g. "gift for an author who loves mechanical typewriters"
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚
                 β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  1. Intent Extraction & Query Parsing                  β”‚
β”‚     - Detected Era: 1940s-1960s                        β”‚
β”‚     - Detected Category: Writing & Office              β”‚
β”‚     - Mood/Tone: Tactile Mechanical, Author Gift       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚
                 β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  2. Hybrid Semantic Retrieval (Dense + Lexical)        β”‚
β”‚     - TF-IDF Vector Cosine Similarity (scikit-learn)   β”‚
β”‚     - BM25-style Lexical N-Gram Matching               β”‚
β”‚     - Intent & Quality Score Reranking                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚
                 β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  3. Context Augmentation                               β”‚
β”‚     - Assembles top-k candidates with metadata & tags  β”‚
β”‚     - Computes calibrated relevance match % (55%-99%)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚
                 β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  4. Generative AI Curation Synthesis                   β”‚
β”‚     - Synthesizes personalized Curator Note            β”‚
β”‚     - Generates "Why this matches" rationales          β”‚
β”‚     - Provides Vintage Styling & Pairing Advice        β”‚
β”‚     - Generates related exploration query prompts      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

RAG API Endpoints:

  • GET /api/search/rag?q=warm+vinyl+sound
  • POST /api/search/rag with JSON { "query": "1950s street photography camera", "limit": 4 }
  • Also aliased to /api/rag-search for Vercel serverless functions.

Example Response:

{
  "success": true,
  "query": "vintage mechanical typewriter for author",
  "intent": { "detected_era": "1940s", "detected_category": "Writing & Office" },
  "curator_response": {
    "summary": "To inspire your literary journey, our curation pairs historical distraction-free writing instruments...",
    "styling_tip": "Complement your typewriter with heavy cotton stationery, a brass lamp, and a leather notebook."
  },
  "recommendations": [
    {
      "id": "prod-3",
      "title": "Retro Mechanical Typewriter",
      "era": "1940s",
      "price": "$220.00",
      "relevance_percentage": 80,
      "match_reason": "Authentic 1940s design (Featured). Ideal for creative writing with Film Noir Detective charm."
    }
  ]
}

πŸ› οΈ Tech Stack

Domain Technologies
Frontend HTML5, Vanilla CSS3 (Custom Design System), JavaScript (ES6+), Bootstrap 5, FontAwesome 6, AOS Animations
AI & RAG Engine Python 3.10+, scikit-learn (TF-IDF Vectorizer & Cosine Similarity), NumPy, Pandas
Node.js Engines Express.js, Node.js Hybrid Vector & Lexical Matcher (server/ragSearchEngine.js, api/ragSearchEngine.cjs)
Backend & APIs Express.js, Node.js, Vercel Serverless Functions (api/), MongoDB Atlas (User Auth)
Hosting & CI/CD Vercel Global Edge Network, GitHub Actions (.github/workflows/vercel-deploy.yml)

πŸš€ Quick Start & Installation

1. Clone Repository

git clone https://github.com/Anjaliavv51/Retro.git
cd Retro

2. Run Frontend & Express Server

The project includes a built-in Express server that serves both the static frontend and the live RAG search API:

# Install dependencies
npm install

# Start the server
npm start

Open http://localhost:3000 in your browser. Click "AI Search" in the navigation bar to test the RAG search system.


3. Run Python RAG Search Engine

You can test the RAG pipeline directly from the command line:

# Optional: set up python virtual environment
python -m venv venv
venv\Scripts\activate   # On Windows
# source venv/bin/activate # On macOS/Linux

# Install python requirements
pip install -r requirements.txt

# Run natural language query search
python python/rag_search.py "warm vinyl sound for jazz evenings"

# Output as JSON
python python/rag_search.py "gift for an old-school author" --json

4. Run Backend with MongoDB (Optional Auth)

If you wish to test user authentication and session management:

cd backend
npm install

Create a backend/.env file:

PORT=5000
MONGODB_URL=your_mongodb_atlas_connection_string
SECRET=your_jwt_secret_key
CLIENT_URL=http://localhost:3000

Start the auth service:

npm start

☁️ Vercel Deployment & CI/CD

Retro is deployed to Vercel at https://retro-vintage-two.vercel.app.

Continuous Deployment on Every git push:

  1. GitHub <-> Vercel Integration (Recommended):

    • Navigate to Vercel Project Settings > Git.
    • Link the repository Anjaliavv51/Retro to the project.
    • Every push to main will automatically build and deploy the latest version.
  2. GitHub Actions Workflow:

    • The repository includes .github/workflows/vercel-deploy.yml.
    • To trigger deployments from GitHub Actions, add your VERCEL_TOKEN in your GitHub repository secrets (Settings > Secrets and variables > Actions).
  3. Deploy Manually from Terminal:

    npx vercel --prod

πŸ“‚ Project Structure

Retro/
β”œβ”€β”€ api/                             # Vercel Serverless API Functions
β”‚   β”œβ”€β”€ index.js                     # Dynamic serverless API router
β”‚   β”œβ”€β”€ rag-search.js                # Dedicated RAG search endpoint
β”‚   β”œβ”€β”€ ragSearchEngine.cjs          # High-performance CommonJS hybrid RAG engine
β”‚   β”œβ”€β”€ products.js                  # Product catalog endpoint
β”‚   β”œβ”€β”€ contact.js                   # Contact inquiries handler
β”‚   β”œβ”€β”€ newsletter.js                # Newsletter subscriptions
β”‚   └── reviews.js                   # Dynamic customer reviews
β”œβ”€β”€ css/                             # Stylesheets
β”‚   β”œβ”€β”€ rag-search.css               # AI RAG modal & card aesthetics
β”‚   β”œβ”€β”€ dark-mode.css                # Dark mode styling tokens
β”‚   β”œβ”€β”€ navbarstyles.css             # Responsive navigation bar
β”‚   β”œβ”€β”€ popup.css                    # Promotional popup styles
β”‚   └── style.css                    # Global typography & layout
β”œβ”€β”€ js/                              # Frontend JavaScript
β”‚   β”œβ”€β”€ rag-search.js                # RAG modal manager, natural language handler & cart sync
β”‚   β”œβ”€β”€ cart.js                      # Shopping cart manager & persistence
β”‚   β”œβ”€β”€ dark-mode.js                 # Theme toggler
β”‚   β”œβ”€β”€ menu.js                      # Product interactions & wishlist
β”‚   └── popup.js                     # Newsletter modal trigger
β”œβ”€β”€ html/                            # Web Pages
β”‚   β”œβ”€β”€ menu.html                    # Vintage Collections & Catalog
β”‚   β”œβ”€β”€ cart.html                    # Shopping Cart & Checkout
β”‚   β”œβ”€β”€ about.html                   # About Retro & Heritage
β”‚   β”œβ”€β”€ contact.html                 # Inquiry Form
β”‚   β”œβ”€β”€ services.html                # Services & Delivery Info
β”‚   β”œβ”€β”€ blog.html                    # Retro Stories & Articles
β”‚   └── wishlist.html                # Saved Wishlist Items
β”œβ”€β”€ python/                          # Python AI & Recommendation Services
β”‚   β”œβ”€β”€ rag_search.py                # Retrieval-Augmented Generation core engine
β”‚   β”œβ”€β”€ vintage_products.json        # Annotated semantic product knowledge base
β”‚   β”œβ”€β”€ recommendation.py            # Collaborative filtering + RAG integration
β”‚   β”œβ”€β”€ content_based_filtering.py   # TF-IDF item recommendations
β”‚   └── requirements.txt             # Python ML dependencies
β”œβ”€β”€ server/                          # Local Node.js Express Server
β”‚   β”œβ”€β”€ server.js                    # Dev server with RAG endpoints
β”‚   └── ragSearchEngine.js           # ES Module RAG engine
β”œβ”€β”€ .github/
β”‚   └── workflows/
β”‚       └── vercel-deploy.yml        # Continuous deployment workflow
β”œβ”€β”€ index.html                       # Homepage & Hero Showcase
β”œβ”€β”€ vercel.json                      # Vercel routing & edge configuration
└── package.json                     # Node.js project configuration

🌟 Featured In

Event Logo Event Name Event Description
SWOC Social Winter of Code Season-5 (SWOC) A 2-month open-source program introducing developers to production-grade collaborative projects.
GSSoC 24 GirlScript Summer of Code 2024 A 3-month open-source program fostering beginner and intermediate developer contributions.
Hacktoberfest 2024 Hacktoberfest 2024 Worldwide month-long celebration of open-source software presented by DigitalOcean and partners.

🀝 Contributing

We welcome community contributions! Please read our Contributing Guidelines before submitting pull requests.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ‘₯ Our Contributors


πŸ“œ Code of Conduct

Please follow our Code of Conduct to ensure an inclusive, harassment-free environment for everyone.


πŸ“„ License

Distributed under the MIT License. See LICENSE.txt for more information.

Releases

Packages

Used by

Contributors

Languages