Skip to content

CHEGEBB/decluttr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

41 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DECLUTTR - Web-based Recommerce and Decluttering Platform

🎯 Project Overview

DECLUTTR is a secure, user-friendly web platform that enables users to declutter their spaces by selling or donating used items. Built with modern web technologies, it addresses the challenges of unsafe online marketplaces by providing admin verification, secure transactions, and seamless buyer-seller communication.

Presenter: Mary Ann Wangechi Koome
Institution: Dedan Kimathi University of Technology
Course: BSc. Computer Science
Date: December 2025


πŸš€ Tech Stack

Frontend

  • Next.js 15+ (App Router with TypeScript)
  • TypeScript - Type safety
  • Tailwind CSS - Styling
  • Framer Motion - Smooth animations
  • Lucide React - Beautiful icons

Backend (Separate Repository)

  • Node.js & Express - API server
  • PostgreSQL - Database
  • JWT - Authentication

πŸ“ Project Structure

decluttr/
β”œβ”€β”€ app/                          # Next.js App Router
β”‚   β”œβ”€β”€ (auth)/                   # Auth route group (no navbar)
β”‚   β”‚   β”œβ”€β”€ login/
β”‚   β”‚   β”‚   └── page.tsx         # Login page
β”‚   β”‚   └── signup/
β”‚   β”‚       └── page.tsx         # Signup page
β”‚   β”‚
β”‚   β”œβ”€β”€ (main)/                   # Main app routes (with navbar)
β”‚   β”‚   β”œβ”€β”€ layout.tsx           # Layout with navbar
β”‚   β”‚   β”œβ”€β”€ marketplace/
β”‚   β”‚   β”‚   └── page.tsx         # Main marketplace/landing (after login)
β”‚   β”‚   β”œβ”€β”€ cart/
β”‚   β”‚   β”‚   └── page.tsx         # Shopping cart
β”‚   β”‚   β”œβ”€β”€ messages/
β”‚   β”‚   β”‚   └── page.tsx         # Messaging system
β”‚   β”‚   β”œβ”€β”€ dashboard/
β”‚   β”‚   β”‚   └── page.tsx         # User dashboard (profile)
β”‚   β”‚   β”œβ”€β”€ list-item/
β”‚   β”‚   β”‚   └── page.tsx         # Add/list products
β”‚   β”‚   β”œβ”€β”€ checkout/
β”‚   β”‚   β”‚   └── page.tsx         # Payment page
β”‚   β”‚   └── admin/
β”‚   β”‚       └── page.tsx         # Admin dashboard
β”‚   β”‚
β”‚   β”œβ”€β”€ layout.tsx               # Root layout
β”‚   β”œβ”€β”€ page.tsx                 # Home/landing page (unauthenticated)
β”‚   └── globals.css              # Global styles
β”‚
β”œβ”€β”€ components/                   # Reusable components
β”‚   β”œβ”€β”€ ui/                      # UI primitives
β”‚   β”‚   β”œβ”€β”€ button.tsx
β”‚   β”‚   β”œβ”€β”€ input.tsx
β”‚   β”‚   β”œβ”€β”€ card.tsx
β”‚   β”‚   └── dialog.tsx
β”‚   β”œβ”€β”€ navbar.tsx               # Main navigation
β”‚   β”œβ”€β”€ product-card.tsx         # Product display card
β”‚   β”œβ”€β”€ search-bar.tsx           # Search component
β”‚   β”œβ”€β”€ category-filter.tsx      # Category filtering
β”‚   └── chat-interface.tsx       # Messaging UI
β”‚
β”œβ”€β”€ lib/                         # Utility functions
β”‚   β”œβ”€β”€ api.ts                   # API calls
β”‚   β”œβ”€β”€ utils.ts                 # Helper functions
β”‚   └── validators.ts            # Zod schemas
β”‚
β”œβ”€β”€ types/                       # TypeScript types
β”‚   └── index.ts                 # Type definitions
β”‚
β”œβ”€β”€ public/                      # Static assets
β”‚   β”œβ”€β”€ favicon.ico
β”‚   β”œβ”€β”€ logo.svg
β”‚   └── images/
β”‚
β”œβ”€β”€ hooks/                       # Custom React hooks
β”‚   β”œβ”€β”€ use-auth.ts
β”‚   └── use-cart.ts
β”‚
└── package.json

🎨 Page Flow & Features

1. Home Page (/)

  • Route: app/page.tsx
  • Access: Public (no login required)
  • Features:
    • Hero section with "Get Started" CTA
    • Search bar (redirects to marketplace with search results)
    • Login button β†’ /login
    • Clean, welcoming design with animations

2. Login Page (/login)

  • Route: app/(auth)/login/page.tsx
  • Access: Public
  • Features:
    • Email/Username + Password fields
    • Form validation
    • Redirect to /marketplace on success
    • "Don't have an account?" link β†’ /signup

3. Signup Page (/signup)

  • Route: app/(auth)/signup/page.tsx
  • Access: Public
  • Features:
    • Fields: Name, Username, Email, Password, Confirm Password, Location (dropdown), Phone Number
    • Form validation (passwords must match)
    • Redirect to /login after successful signup
    • "Already have an account?" link β†’ /login

4. Marketplace (/marketplace)

  • Route: app/(main)/marketplace/page.tsx
  • Access: Authenticated users (main hub after login)
  • Features:
    • Navbar: Search, Home, Messages, Cart, My Profile, Logout
    • Category tabs: Books, Electronics, Shoes, Clothes, Furniture, All Products
    • Filter: All, Resale Only, Donation Only
    • Product grid: 2 rows Γ— 3 columns with pagination (Prev/Next)
    • Product Card: Image, Name, Seller Username, Type (Resale/Donation), Price, "Add to Cart" button
    • If accessed via search (without login) β†’ prompt to login

5. Cart Page (/cart)

  • Route: app/(main)/cart/page.tsx
  • Access: Authenticated users
  • Features:
    • List of added items (image, name, seller, type, price)
    • Shipping address (default: signup location, editable dropdown)
    • Shipping fee: KSh 600 (default)
    • Grand Total = Item Total + Shipping
    • "Proceed to Checkout" button β†’ /checkout

6. Checkout/Payment (/checkout)

  • Route: app/(main)/checkout/page.tsx
  • Access: Authenticated users
  • Features:
    • M-Pesa number input (pre-filled with signup phone)
    • Amount (auto-filled from cart)
    • "Proceed to Pay" button triggers M-Pesa STK push

7. Messages (/messages)

  • Route: app/(main)/messages/page.tsx
  • Access: Authenticated users
  • Features:
    • Two-column layout:
      • Left: Recent chats list
      • Right: Active conversation with timestamps
    • Message input at bottom
    • Real-time updates (future: WebSocket)

8. List Item Page (/list-item)

  • Route: app/(main)/list-item/page.tsx
  • Access: Authenticated users
  • Features:
    • Two-column layout:
      • Left sidebar: User info, "Add Products", "Messages", "Logout"
      • Right: Form to list item
    • Form fields:
      • Category (dropdown: 5 categories)
      • Product Name
      • Description
      • Image Upload (multiple images)
      • Listing Type (Resale/Donation)
      • Price (if Resale)
    • "Add Product" button saves item

9. User Dashboard (/profile)

  • Route: app/(main)/profile/page.tsx
  • Access: Authenticated users
  • Features:
    • Two-column layout:
      • Left: User details sidebar (Name, Email, Location, buttons)
      • Right: 3 sections
        1. Stats cards: Total Income (KSh), Total Exchanges, User Ratings
        2. Listed Items table: Name, Photo, Category, Type, Price, Order Status
        3. Recent Orders table: Name, Category, Type, Receiver, Status

10. Admin Dashboard (/admin)

  • Route: app/(main)/admin/page.tsx
  • Access: Admin users only
  • Features:
    • Two-column layout:
      • Left: Admin info sidebar
      • Right: 3 sections
        1. Stats cards: Total Exchanges, Pending Orders, Pending Deliveries
        2. Recent Orders table: Name, Category, Type, Seller, Receiver, Status, Order Details
    • Admin verification and moderation tools

πŸ” Authentication Flow

  1. Unauthenticated users:

    • Can view home page (/)
    • Can search (results show in marketplace, but must login to add to cart)
    • Redirected to /login when accessing protected routes
  2. Authenticated users:

    • Full access to marketplace, cart, messages, dashboard, list-item
    • Navbar persists across all main routes
    • Session managed via JWT tokens
  3. Admin users:

    • All user permissions + access to /admin dashboard

🎯 Key Features

βœ… User Features

  • Secure Registration & Login with validation
  • Product Listing with images, categories, resale/donation options
  • Search & Filter by category and listing type
  • Shopping Cart with dynamic total calculation
  • M-Pesa Integration for secure payments
  • Real-time Messaging between buyers and sellers
  • User Dashboard with sales analytics and order tracking

βœ… Admin Features

  • Admin Dashboard with platform-wide analytics
  • Product Verification before listings go live
  • Order Moderation and status tracking
  • User Management

βœ… Design Features

  • Responsive Design - Works on mobile, tablet, desktop
  • Smooth Animations - Framer Motion page transitions and interactions
  • Modern UI - Clean, intuitive interface with Tailwind CSS
  • Icon System - Lucide React for consistent, beautiful icons
  • Dark/Light Mode - User preference support (optional)

πŸ› οΈ Setup Instructions

Prerequisites

  • Node.js 18+ installed
  • npm/yarn/pnpm package manager
  • Backend API running (separate repository)

Installation

# Clone the repository
git clone <repository-url>
cd decluttr

# Install dependencies
npm install

# Create .env.local file
cp .env.example .env.local

# Add your environment variables
# NEXT_PUBLIC_API_URL=http://localhost:5000
# NEXT_PUBLIC_MPESA_CONSUMER_KEY=your_key
# NEXT_PUBLIC_MPESA_CONSUMER_SECRET=your_secret

# Run development server
npm run dev

# Open http://localhost:3000

Build for Production

npm run build
npm start

πŸ“¦ Dependencies

{
  "dependencies": {
    "next": "^15.0.0",
    "react": "^19.0.0",
    "react-dom": "^19.0.0",
    "typescript": "^5.3.0",
    "tailwindcss": "^3.4.0",
    "framer-motion": "^11.0.0",
    "lucide-react": "^0.460.0",
    "react-hook-form": "^7.49.0",
    "zod": "^3.22.0",
    "@hookform/resolvers": "^3.3.0",
    "axios": "^1.6.0",
    "zustand": "^4.4.0"
  }
}

🎨 Design Principles

Color Scheme (Suggestion)

  • Primary: Emerald/Green (sustainability, fresh start)
  • Secondary: Blue (trust, security)
  • Accent: Orange (call-to-action)
  • Neutral: Gray scale

Typography

  • Headings: Bold, modern sans-serif
  • Body: Clean, readable sans-serif
  • Code/Numbers: Monospace

Components Philosophy

  • Minimal but functional - No over-engineering
  • Reusable UI components - Button, Input, Card, etc.
  • Consistent spacing - Tailwind's spacing scale
  • Accessible - Proper ARIA labels and keyboard navigation

πŸ”„ API Integration Points

Authentication

  • POST /api/auth/signup - User registration
  • POST /api/auth/login - User login
  • POST /api/auth/logout - User logout

Products

  • GET /api/products - Fetch all products (with filters)
  • GET /api/products/:id - Fetch single product
  • POST /api/products - Create product listing
  • PUT /api/products/:id - Update product
  • DELETE /api/products/:id - Delete product

Cart

  • GET /api/cart - Get user's cart
  • POST /api/cart - Add item to cart
  • DELETE /api/cart/:itemId - Remove item from cart

Orders

  • POST /api/orders - Create order
  • GET /api/orders - Get user's orders
  • GET /api/orders/:id - Get order details

Messages

  • GET /api/messages - Get user's conversations
  • POST /api/messages - Send message
  • GET /api/messages/:conversationId - Get specific conversation

Payments

  • POST /api/payments/mpesa - Initiate M-Pesa payment
  • POST /api/payments/callback - M-Pesa callback

πŸ“± Responsive Breakpoints

/* Tailwind CSS breakpoints */
sm: 640px   // Mobile landscape
md: 768px   // Tablet
lg: 1024px  // Desktop
xl: 1280px  // Large desktop
2xl: 1536px // Extra large

🚧 Future Enhancements

  • WebSocket integration for real-time messaging
  • Push notifications for new messages/orders
  • Advanced search with autocomplete
  • Product reviews and ratings
  • Favorites/Wishlist feature
  • Email notifications
  • Multi-language support
  • Progressive Web App (PWA)

πŸ‘₯ User Roles

Regular User

  • Browse products
  • List items
  • Buy items
  • Message sellers
  • Manage orders

Admin

  • All user permissions
  • Verify product listings
  • Moderate content
  • View platform analytics
  • Manage users

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors