Skip to content

Full-stack sustainable e-commerce platform with AI-powered product recommendations. Built with Next.js, .NET 8, deployed on Azure with Terraform IaC.

Notifications You must be signed in to change notification settings

saraabraham/Sustainable-Retail-Assistant

Repository files navigation

Sustainable Retail Shopping Assistant

An AI-powered shopping assistant that recommends products based on sustainability preferences, lifestyle needs, and circular economy options for retail businesses.

🌟 Overview

This application provides intelligent product recommendations using natural language processing, helping customers make sustainable purchasing decisions while considering total cost of ownership, repair options, and environmental impact.

πŸ› οΈ Tech Stack

Frontend

  • Framework: Next.js 14+ with TypeScript
  • UI Library: React 18+
  • Styling: Tailwind CSS
  • State Management: React Context + Custom Hooks
  • Testing: Jest + Playwright

Backend

  • Language: C# .NET 8
  • Architecture: Microservices
  • API: RESTful APIs with ASP.NET Core

Cloud & Infrastructure

  • Cloud Provider: Microsoft Azure
  • AI Services: Azure Cognitive Services (NLP)
  • Search: Azure Cognitive Search
  • Storage: Azure Cosmos DB
  • CI/CD: GitHub Actions
  • IaC: Terraform

Databases

  • Product Catalog: MongoDB (rich metadata, flexible schema)
  • User Interactions: PostgreSQL (relational data, analytics)
  • User Profiles: Azure Cosmos DB (global distribution)

πŸš€ Key Features

  1. Conversational AI Interface

    • Natural language product queries
    • Context-aware recommendations
    • Multi-turn conversations
  2. Sustainability Focus

    • "Most sustainable alternative" suggestions
    • Environmental impact scoring
    • Circular economy options (repair, refurbish, recycle)
  3. Smart Recommendations

    • Lifestyle-based personalization
    • Machine learning-powered suggestions
    • Collaborative filtering algorithms
  4. Financial Intelligence

    • Total cost of ownership calculator
    • Long-term value analysis
    • Price vs. sustainability comparisons
  5. Product Discovery

    • Interactive product carousels
    • Advanced filtering (sustainability, price, features)
    • Comparison matrices
    • Personalized collections

πŸ“ Project Structure

sustainable-retail-assistant/
β”œβ”€β”€ frontend/                 # Next.js application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/      # React components
β”‚   β”‚   β”œβ”€β”€ pages/          # Next.js pages
β”‚   β”‚   β”œβ”€β”€ services/       # API services
β”‚   β”‚   β”œβ”€β”€ hooks/          # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ utils/          # Utility functions
β”‚   β”‚   └── types/          # TypeScript definitions
β”‚   └── tests/              # Jest & Playwright tests
β”œβ”€β”€ backend/                 # .NET microservices
β”‚   β”œβ”€β”€ RecommendationService/
β”‚   β”œβ”€β”€ UserProfileService/
β”‚   β”œβ”€β”€ ProductService/
β”‚   └── Common/
β”œβ”€β”€ infrastructure/          # IaC and CI/CD
β”‚   β”œβ”€β”€ terraform/
β”‚   └── github-workflows/
└── docs/                   # Documentation

πŸ—οΈ Architecture

Microservices Architecture

  1. Recommendation Service: ML-powered product recommendations
  2. User Profile Service: User preferences and behavior tracking
  3. Product Service: Product catalog management and search

Data Flow

User Input β†’ Azure NLP β†’ Recommendation Engine β†’ Product Search β†’ UI
     ↓
User Profile Service β†’ Learning Algorithm β†’ Improved Recommendations

πŸ”§ Setup & Installation

Prerequisites

  • Node.js 18+
  • .NET 8 SDK
  • Docker & Docker Compose
  • Azure CLI
  • Terraform

Frontend Setup

cd frontend
npm install
npm run dev

Backend Setup

cd backend/RecommendationService
dotnet restore
dotnet run

Database Setup

# MongoDB
docker run -d -p 27017:27017 --name mongo mongo:latest

# PostgreSQL
docker run -d -p 5432:5432 --name postgres \
  -e POSTGRES_PASSWORD=password postgres:latest

πŸ§ͺ Testing

Frontend Tests

# Unit tests with Jest
npm run test

# E2E tests with Playwright
npm run test:e2e

# Recommendation accuracy tests
npm run test:recommendations

Backend Tests

cd backend/RecommendationService.Tests
dotnet test

🚒 Deployment

CI/CD Pipeline

  • Canary deployments via GitHub Actions
  • A/B testing infrastructure
  • Automated rollback on failure
  • Performance monitoring

Infrastructure as Code

cd infrastructure/terraform
terraform init
terraform plan
terraform apply

πŸ“Š Key Metrics

  • Recommendation accuracy: 85%+
  • Average response time: <500ms
  • User satisfaction: 4.5/5
  • Sustainability awareness increase: 60%

πŸ” Security

  • Azure Active Directory integration
  • API key management via Azure Key Vault
  • HTTPS/TLS encryption
  • GDPR compliant data handling

πŸ“ˆ Monitoring

  • Application Insights for performance
  • Custom dashboards for business metrics
  • Automated alerting for anomalies
  • User behavior analytics

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a Pull Request

πŸ“„ License

MIT License

πŸ‘₯ Contact

For questions or support, please open an issue or contact the development team.


Built with ♻️ for a more sustainable future

About

Full-stack sustainable e-commerce platform with AI-powered product recommendations. Built with Next.js, .NET 8, deployed on Azure with Terraform IaC.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published