Overview
Finding someone to do a quick cash-to-bank exchange on campus usually means asking around or posting in a Discord server. Exchange 13 automates the process: you post what you have and what you need, and the matching engine finds compatible orders for you.
Built as a full-stack project using Node.js, Express, and PostgreSQL.
How it works
- Log in with your 42 Intra account (OAuth).
- Post an order — specify the type (Cash → CIH, or CIH → Cash) and the amount.
- The matching engine automatically pairs your order with a compatible one from a student on the same campus.
- Get notified in your dashboard, then the exchange details will be revealed to both students.
Key Technical Details
- Smart Matching Engine: A two-pass greedy matching algorithm backed by PostgreSQL transactions and
SELECT FOR UPDATE SKIP LOCKEDto safely handle concurrent requests. - Partial Fulfillment: A large order can be automatically fulfilled by multiple smaller ones.
- OAuth 2.0: Secure login flow via the 42 Intra API, with JWT session management using httpOnly cookies.
- Live Dashboard: A clean vanilla JS dashboard with real-time browser notifications for new matches.
- Security: Row-level ownership verification, cascading order cancellation, and protection against resurrecting cancelled or fulfilled orders.