Skip to content

KristinaBorisova/SaveTheBeeBulgaria

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

290 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Save The Bee Bulgaria - Honey Web Platform

A comprehensive e-commerce web platform for Bulgarian honey products, built with ASP.NET Core 6.0. The platform connects beekeepers with customers, offering a marketplace for honey, propolis, bee pollen, and related products.

πŸ—οΈ Project Architecture

This project follows a Clean Architecture pattern with clear separation of concerns:

SaveTheBeeBulgaria/
β”œβ”€β”€ HoneyWebPlatform.Web/                    # Presentation Layer (MVC)
β”œβ”€β”€ HoneyWebPlatform.Data/                   # Data Access Layer
β”œβ”€β”€ HoneyWebPlatform.Data.Models/            # Domain Models
β”œβ”€β”€ HoneyWebPlatform.Services.Data/          # Business Logic Layer
β”œβ”€β”€ HoneyWebPlatform.Services.Data.Models/   # Service Models
β”œβ”€β”€ HoneyWebPlatform.Services.Mapping/       # AutoMapper Configuration
β”œβ”€β”€ HoneyWebPlatform.Web.Infrastructure/     # Infrastructure Services
β”œβ”€β”€ HoneyWebPlatform.Web.ViewModels/         # View Models
β”œβ”€β”€ HoneyWebPlatform.Common/                 # Shared Constants
└── HoneyWebPlatform.Services.Tests/         # Unit Tests

πŸ› οΈ Technologies Used

Backend Technologies

  • .NET 6.0 - Core framework
  • ASP.NET Core MVC - Web application framework
  • Entity Framework Core 6.0 - ORM for data access
  • SQL Server - Primary database
  • SQLite - Development database
  • AutoMapper - Object-to-object mapping
  • SignalR - Real-time communication

Frontend Technologies

  • Razor Views - Server-side rendering
  • Bootstrap - CSS framework
  • jQuery - JavaScript library
  • HTML5/CSS3 - Markup and styling
  • JavaScript - Client-side functionality

Authentication & Security

  • ASP.NET Core Identity - User management
  • Google OAuth - Social authentication
  • Facebook OAuth - Social authentication
  • reCAPTCHA - Bot protection
  • Anti-forgery tokens - CSRF protection

Additional Features

  • Email Services - SMTP integration
  • File Upload - Image handling
  • Caching - Memory caching
  • Real-time Chat - SignalR hubs
  • Shopping Cart - Session management
  • Order Management - E-commerce functionality

πŸ“Š Core Entities

User Management

  • ApplicationUser - Extended Identity user with profile information
  • Beekeeper - Specialized user role for product sellers
  • Admin - Administrative role

Product Catalog

  • Honey - Main product entity with categories, pricing, and beekeeper info
  • Propolis - Secondary product type
  • BeePollen - Additional product offering
  • Category - Product categorization
  • Flavour - Product flavor profiles

E-commerce

  • Cart - Shopping cart functionality
  • CartItem - Individual cart items
  • Order - Customer orders with status tracking
  • OrderItem - Individual order line items

Content Management

  • Post - Blog posts and articles
  • Comment - User comments on posts
  • SubscribedEmail - Newsletter subscriptions

🎯 Key Features

For Customers

  • Product Browsing - Browse honey, propolis, and bee pollen
  • Advanced Filtering - Filter by category, price, origin
  • Shopping Cart - Add/remove items with real-time updates
  • User Registration - Account creation and management
  • Order Tracking - Track order status
  • Blog Reading - Educational content about beekeeping

For Beekeepers

  • Product Management - Add, edit, and manage products
  • Profile Management - Manage beekeeper profile and farm images
  • Order Management - View and process customer orders
  • Analytics - View sales statistics

For Administrators

  • User Management - Manage all users and beekeepers
  • Content Management - Manage blog posts and comments
  • Order Oversight - Monitor all orders across the platform
  • Statistics - Platform-wide analytics

πŸš€ Getting Started

Prerequisites

  • .NET 6.0 SDK
  • SQL Server (or SQLite for development)
  • Visual Studio 2022 or VS Code

Installation

  1. Clone the repository

    git clone <repository-url>
    cd SaveTheBeeBulgaria
  2. Restore dependencies

    dotnet restore
  3. Update connection strings

    • Edit appsettings.json or appsettings.Development.json
    • Configure your database connection string
  4. Run database migrations

    dotnet ef database update --project HoneyWebPlatform.Data --startup-project HoneyWebPlatform.Web
  5. Run the application

    dotnet run --project HoneyWebPlatform.Web

Configuration

Database Setup

  • Development: Uses SQLite (LocalDB)
  • Production: Uses SQL Server with Azure connection

Email Configuration

Configure SMTP settings in appsettings.json:

{
  "EmailSettings": {
    "SmtpServer": "smtp.gmail.com",
    "SmtpPort": 587,
    "SmtpUsername": "your-email@gmail.com",
    "SmtpPassword": "your-app-password"
  }
}

OAuth Configuration

Set up Google and Facebook OAuth in Program.cs:

.AddGoogle(options => {
    options.ClientId = "YOUR_GOOGLE_CLIENT_ID";
    options.ClientSecret = "YOUR_GOOGLE_CLIENT_SECRET";
})
.AddFacebook(options => {
    options.AppId = "YOUR_FACEBOOK_APP_ID";
    options.AppSecret = "YOUR_FACEBOOK_APP_SECRET";
})

🏒 Business Logic

Service Layer Architecture

The application uses a service-oriented architecture with interfaces for:

  • IHoneyService - Honey product management
  • IPropolisService - Propolis product management
  • IBeekeeperService - Beekeeper management
  • ICategoryService - Category management
  • IOrderService - Order processing
  • ICartService - Shopping cart operations
  • IPostService - Blog post management
  • IEmailSender - Email notifications

Real-time Features

  • ChatHub - Real-time customer support chat
  • CartHub - Real-time cart updates
  • OrderHub - Real-time order notifications for admins

πŸ§ͺ Testing

The project includes unit tests in the HoneyWebPlatform.Services.Tests project:

  • Service layer testing
  • Database seeder for test data
  • XUnit test framework

Run tests with:

dotnet test

πŸš€ Deployment

Railway Deployment (Production)

The project is configured for deployment to Railway using a Modified Git Flow strategy:

  1. Production Deployment

    • Railway automatically deploys from the master branch
    • Only production-ready code reaches the live site
    • Uses semantic versioning with Git tags (v1.0.0, v1.1.0, etc.)
  2. Branching Strategy

    • master: Production branch (auto-deployed to Railway)
    • dev: Development branch (safe for testing)
    • release/*: Release preparation branches
    • hotfix/*: Emergency production fixes
    • feature/*: Optional feature development branches
  3. Release Process

    • Monthly releases: dev β†’ release/v1.1.0 β†’ master
    • Hotfixes: master β†’ hotfix/fix-name β†’ master
    • See BRANCHING_WORKFLOW.md for detailed workflows
  4. Environment Setup

    • Configure Railway environment variables
    • Set up connection strings for PostgreSQL
    • Configure OAuth providers (Google, Facebook)
    • Set up email settings (Resend/SMTP)

Docker Support

The project includes Docker configuration:

  • Dockerfile for containerization
  • docker-compose.yml for local development
  • Multi-stage build for optimized production images
  • Dockerfile.railway for Railway deployment

πŸ“ Project Structure Details

Data Layer (HoneyWebPlatform.Data)

  • DbContext - Entity Framework context
  • Configurations - Entity configurations
  • Migrations - Database migration files

Services Layer (HoneyWebPlatform.Services.Data)

  • Interfaces - Service contracts
  • Implementations - Business logic implementation
  • Models - Service-specific models

Web Layer (HoneyWebPlatform.Web)

  • Controllers - MVC controllers
  • Views - Razor view templates
  • Areas - Admin and Identity areas
  • Hubs - SignalR hubs for real-time features
  • wwwroot - Static files (CSS, JS, images)

Infrastructure (HoneyWebPlatform.Web.Infrastructure)

  • Extensions - Custom extension methods
  • Middlewares - Custom middleware components
  • ModelBinders - Custom model binding

πŸ”§ Development Guidelines

Code Organization

  • Follow Clean Architecture principles
  • Use dependency injection throughout
  • Implement proper error handling
  • Use async/await for I/O operations

Database Design

  • Use Entity Framework Code First approach
  • Implement proper relationships between entities
  • Use data annotations for validation
  • Follow naming conventions

Security Best Practices

  • Use HTTPS in production
  • Implement proper authentication and authorization
  • Validate all user inputs
  • Use anti-forgery tokens
  • Implement rate limiting

πŸ“ž Support

For support and questions:

πŸ“„ License

This project is proprietary software developed for Save The Bee Bulgaria initiative.


Built with ❀️ for Bulgarian beekeepers and honey lovers

Packages

 
 
 

Contributors

Languages

  • HTML 39.3%
  • C# 23.6%
  • CSS 16.4%
  • TypeScript 8.4%
  • JavaScript 6.2%
  • SCSS 5.9%
  • Other 0.2%