Re:UseNet - Project Story
💡 Inspiration
People throw away good stuff while others buy the same things new. Our neighbor threw out a working desk that a student down the street needed. We don't have a waste problem - we have a connection problem.
Re:UseNet makes giving away stuff as easy as posting on social media.
🎓 What We Learned
Auth0 application types matter. We created "Regular Web Application" instead of "Single Page Application". They use different OAuth flows. This caused 401 errors for hours.
Docker caches everything. Code changes didn't show up. Docker used old layers. Fix: use --no-cache flag.
Facebook doesn't always give emails. Users can hide their email. We added fallback logic.
Full page reload works. React Router wasn't remounting auth context. window.location.href fixed it.
🛠️ How We Built It
Stack: React + TypeScript, Node.js + Express, PostgreSQL with PostGIS, Redis, Docker.
Auth0: Added login buttons for Google, Facebook, GitHub, and LinkedIn. Users click a button, log in with Auth0, then get redirected back. We exchange the Auth0 token for our own JWT.
Location Search: PostGIS finds items within \( 5km \) using the haversine formula:
$$ d = 2r \arcsin\left(\sqrt{\sin^2\left(\frac{\phi_2 - \phi_1}{2}\right) + \cos(\phi_1)\cos(\phi_2)\sin^2\left(\frac{\lambda_2 - \lambda_1}{2}\right)}\right) $$
Architecture: Organized code by domain (users, items, exchanges). Used dependency injection to swap services easily.
🚧 Challenges
Auth0 401 errors: Created wrong app type. Can't change it after creation. Made new app and reconfigured everything.
Facebook email issue: User creation broke when email wasn't provided. Added fallback:
const email = user.email || `${user.sub.replace(/[^a-zA-Z0-9]/g, '_')}@auth0.user`;
Docker cache: Code changes didn't appear. Docker used cached layers. Used --no-cache flag.
React Router: Auth context wasn't remounting after login. Fixed with full page reload.
🎯 What's Next
Add real-time chat for negotiations. Push notifications when nearby items are posted.
Add achievements and leaderboards. Local challenges like "donate 10 items this month."
Impact dashboard showing waste diverted and \( CO_2 \) saved:
$$ \text{CO}2\text{ saved} = \sum{i=1}^{n} w_i \times e_i $$
where \( w_i \) is item weight and \( e_i \) is emission factor.
Built during MLH hackathon - Making reuse easier, one exchange at a time.
Built With
- build
- cors-storage:-local-file-storage-adapter-(uploads/)
- docker
- eslint
- express.js
- helmet
- inversify-(ioc)
- javascript
- languages:-typescript
- mailhog-/-mailtrap-for-local-testing-dev-/-ops:-docker-/-docker-compose
- pgadmin-for-db-ui-testing-/-tooling:-jest-(unit-tests)
- pluggable-ifilestorageservice-(s3-adapter-possible)-database:-postgresql-+-postgis-cache-/-queue:-redis-ai-/-extras:-pluggable-iaiservice-(image-analysis
- prettier
- sql-frontend:-react
- tag/category-suggestions)-maps-/-geo:-pluggable-imapsservice-(geocoding-/-proximity-search)-email:-sendgrid-(production)
- tailwind-css-backend:-node.js
- typescript-compiler-ci-/-cd-(recommended):-github-actions-(ci)
- vite
- volumes-for-uploads

Log in or sign up for Devpost to join the conversation.