Skip to content

shadowsilence94/uni-market

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›’ Uni-Market

Peer-to-peer marketplace for the Asian Institute of Technology (AIT) community

A comprehensive web application built with React, Node.js, and Express that enables AIT students, faculty, and staff to buy, sell, and trade items and services within the community.


✨ Features

For Users

  • πŸ” User Authentication - Secure registration and login with JWT
  • πŸ‘€ Profile Management - Edit profile, upload profile picture
  • βœ“ Verification System - Request verification badge with proof of identity
  • πŸ›οΈ Buy & Sell - List products and services with images
  • πŸ’° Thai Baht Currency - All prices in ΰΈΏ (1 USD = 35 THB)
  • πŸ” Search & Filter - Find items by category, search terms
  • πŸ“± Responsive Design - Works on desktop, tablet, and mobile
  • 🎨 Smooth Animations - Framer Motion for polished UX

For Admins

  • πŸ‘₯ User Management - Add, delete, verify users
  • βœ“ Verification Requests - Review and approve identity verification
  • πŸ“¦ Item Management - Monitor and remove listings
  • πŸ“Š Analytics Dashboard - View statistics and insights
  • πŸ“’ Broadcast Notifications - Send announcements to users

Security & Privacy

  • πŸ”’ Contact information hidden until login
  • πŸŽ“ AIT email certification (@ait.asia)
  • πŸ›‘οΈ Admin-only protected routes
  • πŸ”‘ Password hashing with bcrypt

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • npm or yarn

Local Development

  1. Clone the repository
git clone https://github.com/YOUR-USERNAME/uni-market.git
cd uni-market
  1. Install dependencies
# Install server dependencies
cd server
npm install

# Install client dependencies
cd ../client
npm install
  1. Start the backend
cd server
npm start
# Server runs on http://localhost:3001
  1. Start the frontend (in new terminal)
cd client
npm run dev
# Client runs on http://localhost:5173
  1. Open browser
http://localhost:5173

Test Credentials

Admin: st126010@ait.asia / Htutkoko@17
User:  user@ait.asia / password

πŸ“¦ Tech Stack

Frontend

  • React 18 - UI library
  • TypeScript - Type safety
  • Vite - Build tool
  • Framer Motion - Animations
  • Axios - HTTP client
  • React Router - Navigation

Backend

  • Node.js - Runtime
  • Express - Web framework
  • JWT - Authentication
  • bcrypt - Password hashing
  • JSON file - Database (demo)

🌐 Deployment

Quick Deploy (10 minutes)

See detailed instructions in:

  • GITHUB_SETUP.md - Push code to GitHub
  • QUICK_DEPLOY.md - Deploy to Render + Vercel

Or run the setup script:

./setup-github.sh

Recommended Hosting

  • Backend: Render.com (Free tier)
  • Frontend: Vercel.com (Free tier)

πŸ“ Project Structure

uni-market/
β”œβ”€β”€ client/                 # React frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/    # Reusable components
β”‚   β”‚   β”œβ”€β”€ pages/         # Page components
β”‚   β”‚   β”œβ”€β”€ context/       # Auth context
β”‚   β”‚   └── types/         # TypeScript types
β”‚   β”œβ”€β”€ public/            # Static assets
β”‚   └── package.json
β”œβ”€β”€ server/                # Express backend
β”‚   β”œβ”€β”€ index.js          # Main server file
β”‚   β”œβ”€β”€ db.json           # JSON database
β”‚   └── package.json
β”œβ”€β”€ GITHUB_SETUP.md       # GitHub setup guide
β”œβ”€β”€ QUICK_DEPLOY.md       # Deployment guide
└── README.md             # This file

🎯 Key Features Explained

Currency System

  • Prices stored in USD backend
  • Displayed in Thai Baht (ΰΈΏ) frontend
  • Conversion rate: 1 USD = 35 THB

Verification System

  • Users upload proof of identity
  • Admins review in dashboard
  • Approved users get βœ“ badge

Privacy Protection

  • Unregistered users can browse
  • Must login to see seller contact info
  • Protects user privacy

Admin Dashboard

  • User management (add/delete/verify)
  • Item management (view/delete)
  • Verification requests review
  • Analytics and statistics
  • Broadcast notifications

πŸ”§ Configuration

Environment Variables

Backend (server/.env):

PORT=3001
JWT_SECRET=your-secret-key
NODE_ENV=development
FRONTEND_URL=http://localhost:5173

Frontend (client/vite.config.ts):

server: {
  proxy: {
    '/api': {
      target: 'http://localhost:3001',
      changeOrigin: true
    }
  }
}

πŸ“ API Endpoints

Authentication

  • POST /api/auth/register - Register new user
  • POST /api/auth/login - Login user

Users

  • GET /api/users - Get all users
  • PUT /api/users/:id - Update user profile
  • DELETE /api/users/:id - Delete user (admin)
  • POST /api/users - Add user (admin)

Items

  • GET /api/items - Get all items
  • POST /api/items - Create item
  • DELETE /api/items/:id - Delete item

Verification

  • POST /api/verification-requests - Submit request
  • GET /api/verification-requests - Get all (admin)
  • PUT /api/verification-requests/:id/approve - Approve
  • PUT /api/verification-requests/:id/reject - Reject

🀝 Contributing

This is a student project for the AIT community. Contributions are welcome!

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a Pull Request

πŸ“„ License

MIT License - feel free to use for educational purposes


πŸ‘¨β€πŸ’» Developer

HTUT KO KO
Student ID: st126010
Asian Institute of Technology


πŸ“ž Support

For issues or questions:


πŸ™ Acknowledgments

  • Asian Institute of Technology
  • AIT Community
  • Open source libraries used in this project

Made with ❀️ for the AIT Community

About

Peer-to-peer marketplace for AIT community

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors