CUHK Secondhand Marketplace — a Rails 8 web app for buying and selling second-hand items within the CUHK community.
- Ruby 3.3.8 (see
.ruby-version) - PostgreSQL (hosted on Supabase)
- Node.js (for assets)
- Bundler (
gem install bundler)
git clone https://github.com/Iriscsl/CSCI3100-Group16-Secondhand-Marketplace.git
cd CSCI3100-Group16-Secondhand-Marketplace
bundle install-
Copy the environment template:
cp .env.example .env.development
-
Fill in the Supabase database credentials (from Supabase Dashboard → Project Settings → Database → Connection string, use the Session/Transaction mode pooler):
DATABASE_HOST— pooler host, e.g.aws-0-ap-southeast-1.pooler.supabase.comDATABASE_PORT—6543DATABASE_NAME—postgresDATABASE_USERNAME—postgres.YOUR_PROJECT_REFDATABASE_PASSWORD— your Supabase database passwordDATABASE_SSLMODE—requireDATABASE_PREPARED_STATEMENTS—false
-
Set Gmail SMTP credentials (optional — if omitted, emails open in-browser via
letter_opener):GMAIL_USERNAME— your Gmail addressGMAIL_APP_PASSWORD— a Gmail App Password
-
Set Stripe API keys (optional — required for payment checkout):
STRIPE_SECRET_KEYSTRIPE_PUBLISHABLE_KEY
bin/devThen visit http://localhost:3000.
bin/rails testbundle exec rspecbundle exec cucumberSimpleCov is configured to generate a coverage report. After running the test suite, open coverage/index.html in your browser.
| Feature Name | Primary Developer | Secondary Developer | Notes |
|---|---|---|---|
| User Authentication, CUHK-only access | @shanli030 | Sign up, login, logout with Devise; restricted to CUHK email (@link.cuhk.edu.hk), college-aware browsing instead of strict multi-tenant isolation |
|
| Item CRUD, lifestyle UI | @Iriscsl | listings, Available/Reserved/Sold | |
| Search, filters | @sheenachann | Fuzzy search: Autocomplete showing suggestions as user type | |
| Real-time chat | @leungvanice | Web-socket based messaging between buyer and seller | |
| Payments, background jobs, email | @dizzyryan | Daily digest on new items in user’s community |
In the original proposal we planned a strict multi‑tenant design where each CUHK college would be fully isolated.
During implementation we decided to relax this constraint to give users more flexibility:
- The app is still restricted to CUHK members only via CUHK email sign‑up.
- Users can browse and trade across all colleges, which better matches real buying/selling behavior.
- The item list page includes filters by college, so users who prefer to see items from a specific college can still do so.
This “college‑aware, CUHK‑only” approach keeps the spirit of the original idea (college context) while avoiding the usability and complexity issues of hard multi‑tenant isolation.
To generate: run all three test suites (
bundle exec rspec,bin/rails test, andbundle exec cucumber) so that SimpleCov merges their coverage, then opencoverage/index.htmland save a screenshot asdocs/simplecov.png.
