A community-based waste exchange network that connects people who have items they no longer need with those who can use them. The system uses AI-powered matching and gamification to encourage local reuse and reduce waste.
Re:UseNet features a comprehensive, fully-visible Auth0 integration showcasing enterprise-grade authentication:
- โ 4 Social Login Buttons: Google, Facebook, GitHub, LinkedIn (with brand logos!)
- โ Passwordless Magic Link: One-click email authentication
- โ MFA Security Badge: Visual indicator of multi-factor protection
- โ Beautiful UI: Professional, responsive design
- โ Auth0 Management API: Full user management integration
- โ Passwordless API: Magic link implementation
- โ Secure JWT: RS256 signing with JWKS key rotation
- โ MFA Support: SMS, Authenticator apps, Email, Push
- โ 7,000 Free Users: No credit card required
๐ Complete Auth0 Setup Guide | ๐จ Frontend Features | ๐ MLH Submission
- ๐ Item Exchange: Post and discover items for reuse
- ๐ค AI-Powered Matching: Intelligent categorization and user matching
- ๐ฎ Gamification: Eco-points and achievements for sustainable behavior
- ๐ Location-Based: Find items and users nearby
- ๐ Enterprise Security: Auth0-powered authentication with MFA
- ๐ข Organization Support: Bulk donations and community impact tracking
Re:UseNet follows a modular monolith architecture with:
- Domain-Driven Design: Clear separation of business logic
- Dependency Injection: Swappable service providers
- Pluggable Adapters: Easy technology stack changes
- Docker Deployment: Containerized for easy deployment
- Backend: Node.js + Express + TypeScript
- Database: PostgreSQL with PostGIS
- Cache: Redis
- Container: Docker + Docker Compose
- Storage: AWS S3 | Google Cloud Storage | Local
- Authentication: Auth0 | Okta | Firebase | Custom JWT
- AI/ML: OpenAI | Google AI | Azure Cognitive Services
- Maps: Google Maps | Mapbox | OpenStreetMap
- Email: SendGrid | AWS SES | Mailgun
- Docker and Docker Compose
- Node.js 18+ (for local development)
- Git
-
Clone the repository
git clone <repository-url> cd reuse-net
-
Set up environment variables
cp .env.example .env # Edit .env with your configuration -
Start development environment
# Using Docker (recommended) chmod +x scripts/start-dev.sh ./scripts/start-dev.sh # Or manually docker-compose -f docker-compose.dev.yml up --build
-
Access the application
- API: http://localhost:3000
- Health Check: http://localhost:3000/health
- Database: localhost:5432
- Redis: localhost:6379
-
Install dependencies
npm install
-
Set up local database
# Install PostgreSQL and create database createdb reusenet -
Start development server
npm run dev
See DEPLOYMENT.md for comprehensive deployment guide.
Quick Production Setup:
-
Set up production environment
cp .env.production.example .env.production # Configure production values in .env.production -
Deploy using deployment script
# Linux/Mac chmod +x scripts/deploy.sh ./scripts/deploy.sh prod # Windows .\scripts\deploy.ps1 prod
-
Or deploy manually
docker-compose -f docker-compose.prod.yml --env-file .env.production up -d
Deployment Script Commands:
# Deploy development
./scripts/deploy.sh dev
# Deploy production
./scripts/deploy.sh prod
# Stop environment
./scripts/deploy.sh stop prod
# View logs
./scripts/deploy.sh logs prod
# Backup database
./scripts/deploy.sh backup prod
# Check health
./scripts/deploy.sh health prodThe application uses environment-based configuration with swappable providers:
postgresql(default)mysqlfirestore
local(default for development)aws-s3gcs(Google Cloud Storage)
custom(JWT-based, default)auth0oktafirebase
openai(default) - GPT-4 and GPT-4 Visiongoogle- Google Gemini (Flash: 75x cheaper than GPT-4, Pro: high quality)azure- Azure Cognitive Services (planned)
๐ก Tip: Use AI_PROVIDER=google with Gemini Flash for 99% cost savings!
google(default)mapboxosm(OpenStreetMap)
sendgrid(default)ses(AWS Simple Email Service)mailgun
# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run build
# Start production server
npm start
# Run tests
npm test
# Run tests in watch mode
npm run test:watch
# Lint code
npm run lint
# Fix linting issues
npm run lint:fix# Start development environment
docker-compose -f docker-compose.dev.yml up --build
# Start production environment
docker-compose up -d --build
# Stop all services
docker-compose down
# View logs
docker-compose logs -f app
# Rebuild and restart specific service
docker-compose up --build appGET /health- Application health status
API endpoints will be available at /api/* once controllers are implemented.
src/
โโโ config/ # Configuration management
โโโ container/ # Dependency injection
โโโ domain/ # Domain models (to be implemented)
โโโ application/ # Application services (to be implemented)
โโโ infrastructure/ # Infrastructure services (to be implemented)
โโโ presentation/ # Controllers and routes (to be implemented)
โโโ app.ts # Express application setup
โโโ index.ts # Application entry point
scripts/ # Utility scripts
docker-compose.yml # Production Docker configuration
docker-compose.dev.yml # Development Docker configuration
Dockerfile # Production Docker image
Dockerfile.dev # Development Docker image
See .env.example for all available configuration options.
Key variables:
NODE_ENV: Application environmentPORT: Server portDATABASE_TYPE: Database providerSTORAGE_PROVIDER: File storage providerAUTH_PROVIDER: Authentication providerAI_PROVIDER: AI service providerMAPS_PROVIDER: Maps service providerNOTIFICATION_PROVIDER: Email service provider
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License - see LICENSE file for details.
For questions and support, please open an issue in the repository.