This repository contains the final project for the Database Laboratory course at Iran University of Science and Technology (IUST) in Spring 1404 (Persian calendar, 2025), taught by Professor Dr. Hossein Rahmani.
RBay is an online auction platform where users can bid on items, view details, like items, and chat about them. It implements both a database schema and a full-stack web application.
- ⚙️ Backend: Node.js, Express, Sequelize, Redis
- 🎨 Frontend: React, Chakra UI, Redux, TanStack Query, Axios
- 🗄️ Database: MySQL (with an ER schema design)
- User authentication (signup, login, logout)
- Create, view, update, and bid on items
- Chat system per item
- Like and 👀 view count tracking
- Redis caching for performance boost
- React SPA with modern UX
- Styled with Chakra UI
- Form handling with
react-hook-form+ Zod validation - State management using Redux
- Data fetching and caching with TanStack Query + Axios
- Routing with
react-router-dom
The platform was designed around a relational database schema to support auctions, user interactions, and transaction management.
- Users: Buyers and sellers with profile info, wallet, followers.
- Items: Auctioned products with price, duration, views, likes, and category.
- Bids: Price offers per item (history preserved).
- Comments: Chat/messages about items.
- Likes: Track user interests in items.
- Views: Store visits per item.
- Follows: Social feature for following sellers or users.
- ItemIssueReport: Reports for defective or problematic items.
- DeliveryPersonnel: Couriers responsible for delivering purchased items.
- Purchases 🧾: Invoice/receipt and payment tracking after auctions close.
- 🛒 Provide an auction-based sales platform.
- 💰 Allow bidding (Bid) on items.
- 🔔 Enable following users and seeing their items.
- 💬 Support interactions like messages, likes, and views.
- 💳 Provide an internal wallet for transactions.
- 📊 Offer analytics on user behavior and sales.
⚠️ Allow reporting defective items and tracking deliveries.
The final project queries are implemented in the file:
bk/src/DB/sql/final_project_tasks.sql
The following diagram represents the Entity–Relationship (ER) model of RBay’s database:
-
Clone the repository:
git clone https://github.com/farzaddm/Auction-Site-RBay.git cd Auction-Site-RBay -
Install backend dependencies:
npm install
-
Install frontend dependencies:
cd fr npm install
-
Set environment variables (see .env section).
-
Start Redis server:
redis-server
-
Run the backend server:
npm start
-
Navigate to frontend:
cd fr -
Start dev server:
npm run dev
POST /api/auth/signup– Sign upPOST /api/auth/login– Log inPOST /api/auth/signout– Log out
GET /api/users/:id– Get user detailsPUT /api/users/:id– Update user
POST /api/items– Create itemGET /api/items/:id– View itemPOST /api/items/like– Like an itemPOST /api/items/view– Register a viewPOST /api/items/bid– Submit a bidGET /api/items/:itemId/bids– Bid historyGET /api/items/sort/price– Sort by priceGET /api/items/sort/duration– Sort by durationGET /api/items/sort/views– Sort by recent views
GET /api/chats/:itemId– Get item messagesPOST /api/chats/:itemId– Post a message
Create a .env in the project root:
DB_HOST=your_database_host
DB_PORT=your_database_port
DB_USERNAME=your_database_username
DB_PASSWORD=your_database_password
JWT_SECRET=your_jwt_secret
