Skip to content

ASP.NET Core 9.0 REST API for event booking and catering management. Features JWT auth, AWS S3 image storage, PostgreSQL, Brevo transactional emails, and role-based access control. Built for food cart and catering businesses.

License

Notifications You must be signed in to change notification settings

Jomar77/SEBS-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SEBS API 🍽️

A robust ASP.NET Core 9.0 REST API backend for SEBS (Special Event Booking System) - a comprehensive event booking and catering management platform designed for food cart and catering businesses.

.NET PostgreSQL AWS S3 Docker License: MIT

πŸ“‹ Overview

SEBS API powers an event booking system that allows customers to request catering services for various events (weddings, birthdays, corporate events, etc.) while providing administrators with tools to manage bookings, services, and gallery content.

Key Features

  • πŸ“… Event Booking System - Complete booking workflow from request to completion
  • πŸ‘₯ Role-Based Access Control - Admin and customer-specific endpoints with JWT authentication
  • πŸ–ΌοΈ Gallery Management - AWS S3-integrated image storage for service showcases and event highlights
  • πŸ“§ Transactional Emails - Automated notifications via Brevo (SendinBlue) for booking confirmations, approvals, and rejections
  • πŸ”” Real-time Notifications - In-database notification system for admin alerts
  • πŸ“Š Analytics Integration - Visit logging and analytics tracking

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        Client Apps                          β”‚
β”‚              (React Dashboard / Customer Website)           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚ HTTPS
                           β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      SEBS API (.NET 9)                      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Controllers    β”‚  Services      β”‚  Data Access            β”‚
β”‚  β”œβ”€ Auth        β”‚  β”œβ”€ JWT Auth   β”‚  β”œβ”€ EF Core             β”‚
β”‚  β”œβ”€ Booking     β”‚  β”œβ”€ Email      β”‚  β”œβ”€ PostgreSQL          β”‚
β”‚  β”œβ”€ Gallery     β”‚  β”œβ”€ S3 Storage β”‚  └─ Migrations          β”‚
β”‚  β”œβ”€ Services    β”‚  └─ Analytics  β”‚                         β”‚
β”‚  └─ Public      β”‚                β”‚                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚                    β”‚
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”           β”‚
              β–Ό                     β–Ό           β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚  AWS S3  β”‚         β”‚  Brevo   β”‚  β”‚PostgreSQLβ”‚
        β”‚ (Images) β”‚         β”‚ (Email)  β”‚  β”‚   (DB)   β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Getting Started

Prerequisites

Installation

  1. Clone the repository

    git clone https://github.com/Jomar77/SEBS-API.git
    cd SEBS-API/SEBS-API
  2. Configure environment variables

    Create a .env file in the SEBS-API directory:

    # Database
    ConnectionStrings__SEBSDbContext=Host=localhost;Database=sebs;Username=your_user;Password=your_password
    
    # JWT Authentication
    JWT_KEY=your-super-secret-jwt-key-minimum-32-characters
    JWT_ISSUER=https://your-api-domain.com
    JWT_AUDIENCES=https://your-frontend-domain.com
    
    # AWS S3
    AWS_ACCESS_KEY_ID=your-aws-access-key
    AWS_SECRET_ACCESS_KEY=your-aws-secret-key
    
    # Brevo Email
    BREVO_API_KEY=your-brevo-api-key
  3. Update appsettings.json for AWS bucket configuration:

    {
      "AWS": {
        "BucketName": "your-bucket-name",
        "Region": "us-east-1"
      }
    }
  4. Apply database migrations

    dotnet ef database update
  5. Run the application

    dotnet run

    The API will be available at http://localhost:5139 (or configured port).

Docker Deployment

# Build the image
docker build -t sebs-api .

# Run the container
docker run -d -p 8080:8080 \
  -e ConnectionStrings__SEBSDbContext="your-connection-string" \
  -e JWT_KEY="your-jwt-key" \
  -e AWS_ACCESS_KEY_ID="your-aws-key" \
  -e AWS_SECRET_ACCESS_KEY="your-aws-secret" \
  sebs-api

πŸ“‘ API Endpoints

Authentication

Method Endpoint Description
POST /api/auth/login Admin login with JWT token response

Customer Booking

Method Endpoint Description
POST /api/booking/request Submit a new booking request
GET /api/booking/lookup Look up booking by reference

Admin Booking Management

Method Endpoint Description
GET /api/admin/booking Get all bookings (with filters)
GET /api/admin/booking/requests Get pending booking requests
GET /api/admin/booking/{id} Get booking details
PATCH /api/admin/booking/{id}/status Update booking status

Services

Method Endpoint Description
GET /api/service Get all services
POST /api/service Create new service
PUT /api/service/{id} Update service
DELETE /api/service/{id} Delete service

Gallery & Highlights

Method Endpoint Description
GET /api/highlights Get all highlights
POST /api/highlights/upload Bulk upload highlight images
DELETE /api/highlights/{id} Delete highlight
GET /api/event-gallery Get event galleries

Public Endpoints

Method Endpoint Description
GET /api/public/services Get services for website display
GET /api/public/highlights Get highlighted images
GET /api/public/images/{s3Key} Serve images from S3

πŸ“Š Data Models

Core Entities

User ─────────┬──────── Role
              β”‚
              β–Ό
          Booking ──────── Event ──────── EventService ──────── Service
              β”‚               β”‚
              β”‚               └──── EventGallery ──── EventImage ──── GalleryImage
              β”‚                                                            β”‚
              └─── Notification                                      Highlight

Event Types

  • Wedding
  • Birthday
  • Corporate
  • Baby Shower
  • Engagement
  • Anniversary
  • Debut
  • Other

Booking Statuses

  • Pending - Awaiting admin approval
  • Confirmed - Approved and scheduled
  • Declined - Request rejected
  • Cancelled - Cancelled by customer/admin
  • Completed - Event finished successfully
  • No Show - Customer unreachable

πŸ” Security

  • JWT Authentication - Stateless token-based auth with configurable expiration
  • BCrypt Password Hashing - Secure password storage
  • Role-Based Authorization - Policy-based access control (Admin, Manager)
  • CORS Configuration - Configurable cross-origin policies
  • Environment Variables - Sensitive data kept out of source code

πŸ› οΈ Tech Stack

Category Technology
Framework ASP.NET Core 9.0
Database PostgreSQL with EF Core
Authentication JWT Bearer Tokens
File Storage AWS S3
Email Service Brevo (SendinBlue)
Image Processing SixLabors.ImageSharp
Documentation Swagger/OpenAPI
Containerization Docker

πŸ“ Project Structure

SEBS-API/
β”œβ”€β”€ Controllers/
β”‚   β”œβ”€β”€ Base/              # Base controllers for inheritance
β”‚   β”œβ”€β”€ Booking/           # Customer and admin booking endpoints
β”‚   └── Gallery/           # Image and gallery management
β”œβ”€β”€ Data/
β”‚   β”œβ”€β”€ SEBSDbContext.cs   # EF Core database context
β”‚   └── DbInitializer.cs   # Database seeding
β”œβ”€β”€ DTOs/                  # Data transfer objects
β”œβ”€β”€ Enum/                  # Enumerations (BookingStatus, EventType)
β”œβ”€β”€ Models/                # Entity models
β”œβ”€β”€ Services/
β”‚   β”œβ”€β”€ Auth/              # JWT authentication
β”‚   β”œβ”€β”€ email/             # Brevo email service
β”‚   β”œβ”€β”€ ImageProcessing/   # S3 integration
β”‚   └── Analytics/         # Analytics services
β”œβ”€β”€ Utils/                 # Utility classes
└── Migrations/            # EF Core migrations

πŸ§ͺ Development

Running Locally

# Restore packages
dotnet restore

# Run in development mode
dotnet run --environment Development

API Documentation

When running locally, access Swagger UI at:

http://localhost:5139/swagger

Database Migrations

# Add a new migration
dotnet ef migrations add MigrationName

# Update database
dotnet ef database update

# Revert migration
dotnet ef database update PreviousMigrationName

🀝 Contributing

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

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ“ž Contact

Jomar - @Jomar77

Project Link: https://github.com/Jomar77/SEBS-API


Made with ❀️ for the food service industry

About

ASP.NET Core 9.0 REST API for event booking and catering management. Features JWT auth, AWS S3 image storage, PostgreSQL, Brevo transactional emails, and role-based access control. Built for food cart and catering businesses.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published