|
A specialized e-commerce ecosystem designed for university students to trade safely. Unlike standard shops, UniBazer supports multiple independent sellers (vendors) within a single platform, requiring complex logic for product management and user roles.
|
Student Classifieds is a web application designed to be the central marketplace for university students. It addresses the inefficiency and clutter of using social media groups for buying and selling used goods by providing a dedicated, secure, and easy-to-navigate platform.
Access is restricted to verified students, creating a trusted community. The core features include user authentication, categorized product listings, a My Listings dashboard for sellers, and a flexible, seller-controlled communication model that leverages existing chat apps.
Students currently lack a centralized platform for trading used goods. Existing channels (such as social media groups) are:
- Disorganized: Finding specific items (textbooks, furniture, electronics, etc.) often requires endless scrolling.
- Cluttered: Listings are mixed with announcements, non-commercial posts, and spam.
- Inefficient: Communication is ad-hoc, and sellers have no clean way to manage or mark listings as sold.
- Insecure: Unverified users can join and scam students.
Build a student-exclusive web application that centralizes peer-to-peer commerce and is:
- Centralized: One website for all student marketplace activity.
- Secure: University-email-based sign-up and authentication.
- Organized: Listings categorized with predefined categories.
- Efficient: Seller dashboard plus privacy-first contact options.
- Student Verification: Sign-up allowed only with valid university email addresses (e.g.,
name@university.edu). - Secure Authentication: Password hashing with bcrypt and session management with JWT.
- User Profile: Users can update name and optionally add:
- Phone number (for WhatsApp)
- Messenger username
- My Listings Dashboard: Sellers can view, edit, delete, or mark listings as sold.
- Create Listing: Form with title, description, price, location, and images.
- Categorization: Each listing belongs to one predefined category.
- Image Uploads: Images uploaded to Cloudinary; URL stored in database.
- Homepage Feed: Shows newest listings first.
- Category Browsing: Filter listings by category.
- Search: Keyword-based search on title/description.
No in-app chat is required. Instead, sellers choose which contact methods to expose.
- Profile Contact Methods (optional):
- WhatsApp (phone number)
- Messenger (username)
- Per-listing controls:
[ ] Show my email[ ] Show my WhatsApp(enabled only when phone is set in profile)[ ] Show my Messenger(enabled only when username is set in profile)
- Contact Seller button: Buyers can only see methods enabled for that specific listing, with direct links (
wa.me/...,m.me/...).
- Frontend: Next.js
- Backend: Node.js + Express.js
- Database: MySQL
- ORM (recommended): Prisma
- Image Handling: Cloudinary
- Frontend Hosting: Vercel (Hobby, free)
- Backend Hosting: Koyeb (Free Nano)
- Managed MySQL: Aiven (Hobby/free)
The app uses a decoupled client-server architecture:
- Client (Vercel): Next.js frontend in browser sends API requests.
- Server (Koyeb): Node/Express backend processes logic and queries DB.
- Database (Aiven): MySQL stores users, categories, and listings.
- Image Pipeline (Cloudinary): Frontend uploads image, gets URL, sends URL to backend, backend stores URL in DB.
CREATE TABLE Users (
user_id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL UNIQUE,
password_hash VARCHAR(255) NOT NULL,
phone_number VARCHAR(50) NULL,
messenger_username VARCHAR(100) NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);CREATE TABLE Categories (
category_id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(100) NOT NULL UNIQUE
);CREATE TABLE Products (
product_id INT PRIMARY KEY AUTO_INCREMENT,
user_id INT NOT NULL,
category_id INT NOT NULL,
title VARCHAR(255) NOT NULL,
description TEXT,
price DECIMAL(10, 2) NOT NULL,
location VARCHAR(255),
image_url VARCHAR(255),
is_sold BOOLEAN DEFAULT FALSE,
show_email BOOLEAN DEFAULT TRUE,
show_whatsapp BOOLEAN DEFAULT FALSE,
show_messenger BOOLEAN DEFAULT FALSE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES Users(user_id) ON DELETE CASCADE,
FOREIGN KEY (category_id) REFERENCES Categories(category_id)
);- Create accounts:
- GitHub
- Vercel (with GitHub)
- Koyeb (with GitHub)
- Cloudinary
- Aiven
- Collect secrets:
- Aiven MySQL connection URL
- Cloudinary API key/secret
- Local development:
- Set up backend with
.env - Build and test backend API
- Build frontend and integrate with local API
- Set up backend with
- Deploy backend (Koyeb):
- Push backend repo
- Configure env vars (DB URL, Cloudinary keys)
- Deploy frontend (Vercel):
- Push frontend repo
- Set API base URL env var to Koyeb endpoint
- Test end-to-end:
- Signup/login
- Create/edit/sell listings
- Category/search behavior
- Contact method visibility rules
codex/create-student-classifieds-project-documentation
Use this checklist before merging feature work into main:
- Only university email domains are accepted at sign-up.
- Passwords are hashed with bcrypt (never stored in plain text).
- JWT-based authentication protects private routes.
- Unauthorized users cannot access profile or My Listings endpoints.
- Sellers can create listings with required fields (title, price, category).
- Listings appear on the homepage sorted by newest first.
- Category filtering works and returns only matching listings.
- Search returns items matching title/description keywords.
- Sellers can edit, delete, and mark their own listings as sold.
- Contact method toggles are per listing (not global only).
- WhatsApp toggle is enabled only when phone number exists in profile.
- Messenger toggle is enabled only when username exists in profile.
- Product page reveals only the contact methods enabled for that listing.
- Database schema includes all required tables and constraints.
- Image upload flow stores Cloudinary URLs in the Products record.
- Environment variables are configured on Koyeb/Vercel.
- End-to-end smoke test passes on deployed frontend + backend.
This section converts the MVP into practical development slices so the team can build and validate one feature set at a time.
- Create two apps in one repo (or two repos):
frontend/with Next.jsbackend/with Express + Prisma
- Add a shared
.env.examplefor required variables. - Set up formatting/linting and basic CI (lint + build).
Definition of done
- Frontend runs locally.
- Backend runs locally.
- Both pass lint/build checks.
- Initialize MySQL schema using Prisma models for
User,Category,Product. - Add migration files and seed script for default categories.
- Verify constraints:
- Unique email
- Product belongs to valid user + category
Definition of done
prisma migratecompletes successfully.- Seed inserts category records.
- Implement signup with university-domain email validation.
- Hash passwords with bcrypt.
- Implement login endpoint returning JWT.
- Add auth middleware for protected routes.
Definition of done
- Non-university emails are rejected.
- Private routes fail without valid JWT.
- Build profile read/update endpoints.
- Support optional
phone_numberandmessenger_username. - Build frontend profile page with validation.
Definition of done
- User can save optional contact fields.
- Updated fields are reflected in API and UI.
- Add create-listing API with title, description, price, category, location, image URL.
- Integrate Cloudinary upload from frontend.
- Add per-listing contact visibility toggles.
Definition of done
- Seller can publish listing with image.
- Invalid category or missing required fields are rejected.
- Build homepage feed ordered by newest.
- Add category filter endpoint/query.
- Add keyword search over title/description.
Definition of done
- Feed is sorted by
created_at DESC. - Category and search behavior match acceptance criteria.
- Build seller dashboard endpoints/UI:
- list own products
- edit
- delete
- mark as sold
- Add ownership checks so only creator can mutate listing.
Definition of done
- Seller can fully manage own listings.
- Cross-user edits/deletes are blocked.
- On product detail, show only methods enabled for that listing.
- Enforce prerequisites:
- WhatsApp shown only if toggle is true and phone exists
- Messenger shown only if toggle is true and username exists
- Generate direct links (
mailto:,wa.me,m.me).
Definition of done
- Buyer sees only seller-approved methods.
- Hidden methods are never leaked by API.
- Add API tests for auth, listing permissions, and contact visibility.
- Add frontend smoke flows: signup/login/create listing/filter/search.
- Deploy backend (Koyeb) and frontend (Vercel).
- Configure production environment variables.
Definition of done
- MVP acceptance checklist is fully checked.
- Deployed app passes end-to-end smoke test.