Skip to content

Sebasalazaro/SaSa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

139 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SaSa Logo

SaSa - Save & Share

A sustainable food marketplace connecting businesses with surplus food to conscious consumers

React Node.js AWS Material-UI


🌍 Overview

SaSa is a full-stack web application inspired by TooGoodToGo, designed to combat food waste while making healthy food accessible to everyone. The platform enables restaurants, bakeries, supermarkets, farms, and other food businesses to sell surplus inventory at discounted prices before it goes to waste.

🎯 Key Features

  • πŸͺ Business Dashboard: Complete admin interface for managing products, surprise boxes, and business profiles
  • πŸ“¦ Surprise Boxes: Mystery food packages offering 2x+ value of the purchase price
  • πŸ—ΊοΈ Interactive Map: Real-time geolocation showing nearby businesses with available deals
  • πŸ’š Donation System: Connect businesses with charitable organizations for food donations and certifications
  • πŸ” Authentication System: Secure user and business account management with cookies-based sessions
  • πŸ“± Responsive Design: Mobile-first approach with Material-UI components
  • πŸ–ΌοΈ Image Management: AWS S3 integration for efficient media storage
  • πŸ€– AI Integration: OpenAI-powered features for enhanced user experience

πŸš€ Technology Stack

Frontend

  • React 18.3 with Vite for lightning-fast development
  • Material-UI (MUI) for consistent, professional UI components
  • React Router for seamless navigation
  • Google Maps API for interactive location features
  • Axios for HTTP requests
  • TailwindCSS + Styled Components for styling flexibility
  • React Hot Toast for elegant notifications

Backend

  • Node.js with Express.js
  • AWS DynamoDB with DynamoDB Toolbox for NoSQL data management
  • AWS S3 for scalable image storage with presigned URLs
  • OpenAI API integration for AI-powered features
  • Cookie-based authentication for secure session management
  • CORS enabled for frontend-backend communication

Development Tools

  • ESLint for code quality
  • Nodemon for automatic server restarts
  • Vite for optimized frontend bundling

πŸ“ Project Structure

SaSa/
β”œβ”€β”€ client/                 # React frontend application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/    # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ sections/      # Page-level components
β”‚   β”‚   β”œβ”€β”€ assets/        # Images, icons, and CSS
β”‚   β”‚   └── App.jsx        # Main application component
β”‚   β”œβ”€β”€ vite.config.js
β”‚   └── package.json
β”‚
β”œβ”€β”€ server/                # Node.js backend API
β”‚   β”œβ”€β”€ controllers/       # Business logic handlers
β”‚   β”œβ”€β”€ models/            # DynamoDB data models
β”‚   β”œβ”€β”€ routes/            # API route definitions
β”‚   β”œβ”€β”€ ddbClient.js       # DynamoDB configuration
β”‚   β”œβ”€β”€ s3Client.js        # AWS S3 configuration
β”‚   β”œβ”€β”€ aiApi.js           # OpenAI integration
β”‚   β”œβ”€β”€ index.js           # Express server entry point
β”‚   └── package.json
β”‚
└── README.md

πŸ› οΈ Installation & Setup

Prerequisites

  • Node.js (v16 or higher)
  • AWS Account with DynamoDB and S3 configured
  • Google Maps API key
  • OpenAI API key (optional, for AI features)

1. Clone the Repository

git clone https://github.com/yourusername/sasa.git
cd sasa

2. Backend Setup

cd server
npm install

# Create .env file with the following variables:
# AWS_ACCESS_KEY_ID=your_aws_access_key
# AWS_SECRET_ACCESS_KEY=your_aws_secret_key
# AWS_REGION=your_region
# S3_BUCKET_NAME=your_bucket_name
# OPEN_AI_API_KEY=your_openai_key

npm run dev

3. Frontend Setup

cd client
npm install

# Create .env file with:
# VITE_GOOGLE_MAPS_API_KEY=your_google_maps_key
# VITE_API_URL=http://localhost:5000

npm run dev

4. Access the Application

  • Frontend: http://localhost:5173
  • Backend API: http://localhost:5000

πŸ’‘ Core Functionality

For Businesses

  1. Register & Profile Management: Create business profiles with location, hours, and contact info
  2. Product Management: Add individual food items with pricing, descriptions, and images
  3. Surprise Box Creation: Bundle surplus items into mystery packages
  4. Donation Partnerships: Connect with charitable organizations for tax benefits
  5. Real-time Inventory: Update availability instantly

For Consumers

  1. Browse Nearby Deals: Find discounted food on interactive maps
  2. Search & Filter: Locate specific cuisines, dietary preferences, or business types
  3. Secure Purchases: Cookie-based authentication for safe transactions
  4. Personalized Recommendations: AI-powered suggestions based on preferences
  5. Support Local Businesses: Contribute to sustainability while saving money

πŸ—„οΈ Database Architecture

The application uses AWS DynamoDB with a single-table design pattern for optimal performance:

  • Users Table: Consumer and business account information
  • Businesses: Restaurant/store profiles with geolocation data
  • Products: Individual food items with pricing and inventory
  • Surprise Boxes: Bundled food packages
  • Donations: Records of charitable contributions

All images are stored in AWS S3 with presigned URLs for secure access.


πŸ” Security Features

  • Cookie-based session management with js-cookie
  • CORS configuration for controlled API access
  • Environment variable protection for sensitive credentials
  • AWS IAM roles for service-to-service authentication
  • Input validation and sanitization

🌟 Future Enhancements

  • Payment gateway integration (Stripe/PayPal)
  • Push notifications for new deals
  • Advanced analytics dashboard for businesses
  • Mobile app (React Native)
  • Multi-language support
  • Carbon footprint tracking
  • Loyalty rewards program
  • Social sharing features

🀝 Contributing

This is a portfolio project, but suggestions and feedback are welcome! Feel free to:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ‘¨β€πŸ’» Author

Sebastian Salazar
Full-Stack Developer passionate about building apps that helps communities and people.

Valentina Morales
Software Engineer passionate about designing and building end to end full-stack apps.


πŸ™ Acknowledgments

  • Inspired by TooGoodToGo
  • Built as part of academic coursework at EAFIT University with
  • Special thanks to all contributors and supporters of the project

⭐ If you found this project interesting, please consider giving it a star!

Made with ❀️ and ♻️ for a sustainable future

About

🌱 Fight food waste, save money, help communities β€” A full-stack marketplace connecting businesses with surplus food to conscious consumers and charitable organizations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors