Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ThriftX

India's first verified student thrift marketplace powered by AI pricing agents.

ThriftX is a modern, responsive, and real-time thrift marketplace built exclusively for students. It leverages the power of AI to provide dynamic pricing recommendations and an intelligent chatbot assistant, alongside real-time buyer-seller communication.


Key Features

  • AI-Powered Pricing: Get real-time price recommendations for your listings powered by Gemini AI.
  • Real-Time Chat: Negotiate and connect instantly with buyers/sellers using Socket.io.
  • Student Verified: A trusted ecosystem exclusively for verified college students.
  • Stories & Blogs: Share thrifting experiences, hauls, and sustainable fashion tips.
  • Modern UI/UX: Smooth animations (Framer Motion) and 3D elements (Three.js) for an immersive experience.
  • Secure Payments: Integrated payment gateways (Razorpay).

Tech Stack

Frontend

  • Framework: React 19 + Vite
  • Styling: Tailwind CSS v4
  • Animations: Framer Motion
  • 3D Graphics: Three.js & React Three Fiber
  • Charts: Recharts
  • Icons: Lucide React

Backend

  • Runtime: Node.js
  • Framework: Express.js
  • Database: MongoDB & Mongoose
  • Real-Time: Socket.io
  • AI Integration: Google Generative AI (Gemini)
  • Auth & Security: JWT, bcryptjs, Helmet
  • Emails: Nodemailer

Architecture Overview

graph TD;
    Client[React Frontend] -->|REST API| API[Express API Server]
    Client <-->|WebSocket| Socket[Socket.io Server]
    API <--> DB[(MongoDB)]
    API <--> AI[Gemini AI Engine]
    API <--> Mail[Nodemailer]
    
    subgraph Backend
        API
        Socket
    end
    
    subgraph External Services
        AI
        Mail
    end
Loading

Database Schema

erDiagram
    USER ||--o{ PRODUCT : lists
    USER ||--o{ ORDER : places
    USER ||--o{ STORY : creates
    USER ||--o{ BLOG : writes
    PRODUCT ||--o{ ORDER : "is part of"
    ORDER ||--o{ CHAT : "has messages"
    USER ||--o{ CHAT : sends
    
    USER {
        ObjectId _id
        String name
        String email
        String password
        Boolean isVerified
    }
    
    PRODUCT {
        ObjectId _id
        ObjectId sellerId
        String title
        String description
        Number price
        String status
    }
    
    ORDER {
        ObjectId _id
        ObjectId buyerId
        ObjectId productId
        String status
    }
    
    CHAT {
        ObjectId _id
        ObjectId orderId
        ObjectId senderId
        String message
        Date timestamp
    }
Loading

AI Pricing Flow

sequenceDiagram
    participant User
    participant Frontend
    participant Backend
    participant Gemini as Gemini AI
    
    User->>Frontend: Fills product details (Title, Condition, Brand)
    User->>Frontend: Clicks "Get Price Recommendation"
    Frontend->>Backend: POST /api/ai/price-check
    Backend->>Gemini: Send product context & market data
    Gemini-->>Backend: Return suggested price & reasoning
    Backend-->>Frontend: Send recommendation JSON
    Frontend-->>User: Display suggested price
Loading

Getting Started

Prerequisites

  • Node.js (v18+ recommended)
  • MongoDB running locally or a MongoDB Atlas URI
  • Google Gemini API Key

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/thriftx.git
    cd thriftx
  2. Backend Setup

    cd backend
    npm install

    Create a .env file in the root of the project with the following:

    PORT=5000
    MONGO_URI=your_mongodb_uri
    JWT_SECRET=your_jwt_secret
    GEMINI_API_KEY=your_gemini_api_key
    CLIENT_URL=http://localhost:5173
  3. Frontend Setup

    cd frontend
    npm install

Running Locally

  1. Start the Backend

    cd backend
    npm run dev
  2. Start the Frontend

    cd frontend
    npm run dev
  3. Open http://localhost:5173 in your browser.


Deployment

The project includes a vercel.json configuration for easy deployment on Vercel. The configuration routes /api/* to the backend serverless functions and serves the React static build for other routes.


License

This project is licensed under the MIT License - see the LICENSE file for details.

About

India's first verified student thrift marketplace powered by AI pricing agents, Aadhar authentication, and 3D product visualizations.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages