Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions backend/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This file ensures empty folders are tracked by Git.
# Do not delete unless the directory contains tracked files.
69 changes: 69 additions & 0 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# UniLoot Backend ⚙️
_Secure. Scalable. Real-time._

## 📘 Overview
The **UniLoot Backend** powers all business logic, authentication, and data management for the UniLoot platform. It handles product listings, user management, auctions, payments, and notifications using RESTful APIs or GraphQL.

---

## 🚀 Features
- 🔐 **Authentication & Authorization:** JWT-based auth with college email verification.
- 📦 **Product Listings:** CRUD APIs for sellers.
- 💰 **Auction System:** Real-time bidding via Socket.IO.
- 💳 **Payments:** Razorpay or Stripe integration with escrow logic.
- 📧 **Email Service:** Notifications via Nodemailer or SendGrid.
- 🧠 **Admin Controls:** Manage users, disputes, and analytics.
- 📊 **Logging & Monitoring:** Winston/Morgan integrated.

---

## 🏗️ Tech Stack
| Layer | Technology |
|-------|-------------|
| Backend Framework | Node.js (Express.js) |
| Database | PostgreSQL / MongoDB |
| ORM | Prisma / Mongoose |
| Real-time | Socket.IO |
| Authentication | JWT + Nodemailer verification |
| Payment Gateway | Razorpay / Stripe |
| Deployment | Docker + VPS / Render |
| Testing | Jest / Supertest |

---

## 📁 Folder Structure
backend/
├── src/
│ ├── config/ # Env configs, DB connection
│ ├── controllers/ # Request handlers
│ ├── models/ # DB schemas
│ ├── routes/ # API route definitions
│ ├── middleware/ # Auth, validation, error handling
│ ├── services/ # Business logic and integrations
│ ├── utils/ # Helpers, constants
│ └── app.js # Main Express app
├── tests/ # Unit/integration tests
├── .env.example # Example environment variables
├── package.json
└── README.md


---

## ⚙️ Setup & Installation

### Prerequisites
- Node.js v20+
- PostgreSQL / MongoDB running locally
- Docker (optional)
- Razorpay / Stripe credentials

### Steps
```bash
cd UniLoot/backend
npm install
cp .env.example .env


## Run the server
npm run dev
1 change: 1 addition & 0 deletions backend/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//backend code here
12 changes: 12 additions & 0 deletions backend/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "backend",
"version": "1.0.0",
"description": "",
"license": "ISC",
"author": "",
"type": "commonjs",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
}
}
24 changes: 24 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
2 changes: 2 additions & 0 deletions frontend/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This file ensures empty folders are tracked by Git.
# Do not delete unless the directory contains tracked files.
77 changes: 77 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# UniLoot Frontend 🎓🛒
Your Campus Marketplace. Sell your legacy, find your loot. — Built for Students, by Students._

## 📘 Overview
The **UniLoot Frontend** is the user-facing layer of the UniLoot platform, built with **React.js** (or Next.js). It provides smooth navigation, real-time bidding updates, and secure shopping flows tailored for college students.

This app allows:
- Seniors to list and manage their items.
- Juniors to browse, bid, and buy.
- Admins to manage the platform with dashboards.

---

## 🚀 Features
- 🎯 **Dual Listings:** Buy Now & Auction modes.
- 🧭 **Search & Filter:** Sort by category, price, or sale type.
- 💬 **Real-Time Updates:** Instant outbid and sale notifications (via Socket.IO).
- 🔒 **Secure Authentication:** College email verification integrated with backend API.
- 💸 **Razorpay/Stripe Payment UI:** Simplified checkout experience.
- 🗂️ **User Dashboards:** For both sellers and buyers.

---

## 🏗️ Tech Stack
| Layer | Technology |
|-------|-------------|
| Framework | React.js (with Vite or Next.js SSR) |
| State Management | Redux Toolkit / Context API |
| Styling | TailwindCSS / Shadcn UI |
| API Communication | Axios + REST / GraphQL |
| Real-Time | Socket.IO Client |
| Routing | React Router / Next.js Routing |
| Deployment | Vercel / Netlify |

---

## 📁 Folder Structure

frontend/
├── public/ # Static assets (logos, icons)
├── src/
│ ├── components/ # Reusable UI components
│ ├── pages/ # Page-level components
│ ├── hooks/ # Custom React hooks
│ ├── context/ # Context providers
│ ├── redux/ # Redux store & slices
│ ├── services/ # API service functions
│ ├── utils/ # Helpers & formatters
│ └── styles/ # Tailwind/global styles
├── .env.example # Environment variable template
├── package.json
└── README.md


---

## ⚙️ Setup & Installation

### Prerequisites
- Node.js v20+
- npm or yarn
- Backend server running (`http://localhost:5000` default)

### Steps
```bash
# Clone main repo
git clone https://github.com/OPCODE-Open-Spring-Fest/UniLoot.git
cd UniLoot/frontend

# Install dependencies
npm install

# Create environment file
cp .env.example .env

#Run the frontend
npm run dev
29 changes: 29 additions & 0 deletions frontend/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import { defineConfig, globalIgnores } from 'eslint/config'

export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{js,jsx}'],
extends: [
js.configs.recommended,
reactHooks.configs['recommended-latest'],
reactRefresh.configs.vite,
],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
ecmaVersion: 'latest',
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
},
rules: {
'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }],
},
},
])
13 changes: 13 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>frontend</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
Loading
Loading