🏗️ Building Bivy Restaurant Microservices: My Role in the ERD Design & User/Menu Services

In today’s fast-paced digital restaurant ecosystem, scalability and modularity are non-negotiable. That’s why our team is engineering Bivy Restaurant Microservices — a backend system powered by FastAPI (Python) and NestJS (TypeScript) to streamline res…


This content originally appeared on DEV Community and was authored by EMMANUEL UDODIRIM

In today’s fast-paced digital restaurant ecosystem, scalability and modularity are non-negotiable. That’s why our team is engineering Bivy Restaurant Microservices — a backend system powered by FastAPI (Python) and NestJS (TypeScript) to streamline restaurant operations.

As a core backend contributor, I took ownership of:

✅ Designing critical parts of the Entity-Relationship Diagram (ERD)
✅ Leading the User Service (authentication + RBAC)
✅ Architecting the Menu Service (dynamic categorization + inventory sync)

In this article, I’ll walk you through:

  1. 📐 My ERD design process

  2. 🛠 The microservices I own

  3. 🧭 Key technical decisions & what’s coming next

  1. 🧩 Designing the Database: My ERD Contributions

A well-designed database is the heartbeat of any microservice architecture. Here’s how I approached Bivy’s schema design.

👤 A. User Service Schema

The Challenge:
We needed secure authentication + flexible role management for admins, staff, and customers.

My Solution:

Built a normalized schema with USER and USER_ROLE tables

Designed it to be JWT-ready and role-extensible

erDiagram
USER {
int id PK
string email
string password_hash
string name
int role_id FK
}
USER_ROLE {
int id PK
string name
}
USER ||--o{ USER_ROLE : "has"

Why It Works:
✔ Passwords are stored using bcrypt hashing
✔ Roles are decoupled, enabling easy future expansions (like moderators or vendors)

🍽 B. Menu Service Schema

The Challenge:
Restaurants need menus that evolve — with categories, pricing, and availability — all while syncing with inventory without tight coupling.

My Solution:

Designed MENU_ITEM and CATEGORY tables

Introduced available flag for toggling visibility without touching inventory directly

erDiagram
MENU_ITEM {
int id PK
string name
float price
int category_id FK
bool available
}
CATEGORY {
int id PK
string name
}
MENU_ITEM }|--|| CATEGORY : "belongs_to"

Benefits:
✔ Fully decoupled from inventory DB
✔ Filtering is index-optimized for better performance

🔗 C. Cross-Service Collaboration

To maintain modularity, we ensured services communicate via event-driven architecture instead of direct DB joins.

Examples:

Orders reference both user_id and menu_item_id

Inventory syncs availability via Apache Kafka events

  1. 🚀 Microservices I Lead

🔐 A. User Service – FastAPI + JWT

Stack: Python, FastAPI, PostgreSQL, JWT

Core Features:

Secure Login/Registration

Role-Based Access Control (RBAC)

User profile endpoints

🍔 B. Menu Service – Dynamic & Real-Time

Stack: Python, FastAPI, Redis, PostgreSQL,

Core Features:

Dynamic menu categories

Real-time item availability toggling

Image upload support (S3 integration)

Workflow Example:

  1. Admin adds a new item via /menu/items

  2. Menu service emits Kafka event to inventory

  3. If stock is available, item is flagged available=True and shown on the customer app

  1. 📍 Roadmap Ahead

🧭 User Service

[ ] OAuth 2.0 integration (Google / Facebook)

[ ] Passwordless login via magic links

🧭 Menu Service

[ ] Redis caching for fast menu queries

[ ] Seasonal menu activation (based on time or promo windows)

🧭 DevOps Goals

[ ] Kubernetes Helm Charts for scalable deployment

[ ] Monitoring via Prometheus + Grafana

🧠 Final Thoughts

By prioritizing clean ERD design, modular services, and event-driven architecture, Bivy is built to scale. This system will power:

💡 10,000+ concurrent users
⚙️ Zero-downtime deployments
🔄 Real-time menu updates across all customer touchpoints

What I Learned:

The power of database-first thinking

The value of loose coupling between services

The necessity of security-by-default principles

💬 Let’s Talk!

Have you ever built or contributed to a restaurant backend system?
How did you handle user roles, menu changes, or inventory sync?
Let’s discuss in the comments — I’d love to learn from your experience too.

📡 Connect with Bivy Tech

🟦 Follow us on X (Twitter)

🟦 Connect on LinkedIn


This content originally appeared on DEV Community and was authored by EMMANUEL UDODIRIM


Print Share Comment Cite Upload Translate Updates
APA

EMMANUEL UDODIRIM | Sciencx (2025-07-30T19:17:45+00:00) 🏗️ Building Bivy Restaurant Microservices: My Role in the ERD Design & User/Menu Services. Retrieved from https://www.scien.cx/2025/07/30/%f0%9f%8f%97%ef%b8%8f-building-bivy-restaurant-microservices-my-role-in-the-erd-design-user-menu-services/

MLA
" » 🏗️ Building Bivy Restaurant Microservices: My Role in the ERD Design & User/Menu Services." EMMANUEL UDODIRIM | Sciencx - Wednesday July 30, 2025, https://www.scien.cx/2025/07/30/%f0%9f%8f%97%ef%b8%8f-building-bivy-restaurant-microservices-my-role-in-the-erd-design-user-menu-services/
HARVARD
EMMANUEL UDODIRIM | Sciencx Wednesday July 30, 2025 » 🏗️ Building Bivy Restaurant Microservices: My Role in the ERD Design & User/Menu Services., viewed ,<https://www.scien.cx/2025/07/30/%f0%9f%8f%97%ef%b8%8f-building-bivy-restaurant-microservices-my-role-in-the-erd-design-user-menu-services/>
VANCOUVER
EMMANUEL UDODIRIM | Sciencx - » 🏗️ Building Bivy Restaurant Microservices: My Role in the ERD Design & User/Menu Services. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/07/30/%f0%9f%8f%97%ef%b8%8f-building-bivy-restaurant-microservices-my-role-in-the-erd-design-user-menu-services/
CHICAGO
" » 🏗️ Building Bivy Restaurant Microservices: My Role in the ERD Design & User/Menu Services." EMMANUEL UDODIRIM | Sciencx - Accessed . https://www.scien.cx/2025/07/30/%f0%9f%8f%97%ef%b8%8f-building-bivy-restaurant-microservices-my-role-in-the-erd-design-user-menu-services/
IEEE
" » 🏗️ Building Bivy Restaurant Microservices: My Role in the ERD Design & User/Menu Services." EMMANUEL UDODIRIM | Sciencx [Online]. Available: https://www.scien.cx/2025/07/30/%f0%9f%8f%97%ef%b8%8f-building-bivy-restaurant-microservices-my-role-in-the-erd-design-user-menu-services/. [Accessed: ]
rf:citation
» 🏗️ Building Bivy Restaurant Microservices: My Role in the ERD Design & User/Menu Services | EMMANUEL UDODIRIM | Sciencx | https://www.scien.cx/2025/07/30/%f0%9f%8f%97%ef%b8%8f-building-bivy-restaurant-microservices-my-role-in-the-erd-design-user-menu-services/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.