Revolutionizing quick commerce with real-time ordering and intelligent delivery
Features β’ Architecture β’ Getting Started β’ API Documentation β’ Contributing
- Overview
- Key Features
- System Architecture
- Technology Stack
- Phase 1 Scope
- Data Model
- Authentication & Security
- Core Workflows
- API Reference
- Installation & Setup
- Environment Configuration
- Deployment
- Contributing
- License
- Support
Welcome to QuickPlate's GSSoC'26 program! π§‘
π GSSoC'26 Contribution Guide
π If you're a contributor, please start from the guide above before raising issues or PRs.
QuickPlate is a next-generation quick commerce food delivery platform engineered for speed, scalability, and seamless user experience. Built on a modern tech stack combining React's responsive frontend with Salesforce's enterprise-grade CRM backend, QuickPlate delivers meals in record time while maintaining robust business logic and data integrity.
To create the fastest, most reliable food delivery experience by leveraging cutting-edge frontend technologies and enterprise CRM capabilities, enabling real-time order processing, intelligent delivery routing, and exceptional customer service.
- β‘ Quick Commerce Model: Optimized for ultra-fast delivery (15-30 minutes)
- π§ CRM-Powered Backend: Enterprise-grade business logic and data management
- π€ Intelligent Automation: Smart delivery assignment and workflow automation
- π Enterprise Security: Multi-layered authentication and authorization
- π Real-Time Operations: Live order tracking and status updates
|
|
QuickPlate follows a modern frontend-first architecture with a centralized enterprise backend:
graph TB
subgraph "Client Layer"
A[React SPA]
B[Firebase Auth]
end
subgraph "API Gateway"
C[Apex REST APIs]
D[Webhook Endpoints]
end
subgraph "Business Logic Layer"
E[Salesforce CRM]
F[Process Automation]
G[Workflow Rules]
end
subgraph "External Services"
H[Stripe Payment Gateway]
I[Google OAuth]
end
subgraph "Data Layer"
J[(Customer Data)]
K[(Order Management)]
L[(Restaurant Catalog)]
M[(Delivery Ops)]
end
A --> B
A --> C
B --> I
C --> E
H --> D
D --> E
E --> F
E --> G
E --> J
E --> K
E --> L
E --> M
style A fill:#61DAFB,stroke:#333,stroke-width:2px
style E fill:#00A1E0,stroke:#333,stroke-width:2px
style H fill:#008CDD,stroke:#333,stroke-width:2px
| Layer | Responsibility | Technology |
|---|---|---|
| Presentation | UI/UX, User Interactions | React 18.x, TailwindCSS |
| Authentication | Identity & Access Management | Firebase Authentication |
| API Gateway | Request Routing, Validation | Salesforce Apex REST |
| Business Logic | Order Processing, Rules Engine | Salesforce CRM, Process Builder |
| Data Persistence | Data Storage & Integrity | Salesforce Database |
| Payment Processing | Transaction Management | Stripe API, Webhooks |
Phase 1 establishes the core customer journey and essential platform capabilities:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β PHASE 1 IMPLEMENTATION β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π± User Experience π§ Platform Operations
ββ Google OAuth Login ββ Restaurant Management
ββ Customer Onboarding ββ Order Processing Engine
ββ Restaurant Discovery ββ Payment Integration
ββ Shopping Cart ββ Delivery Assignment
ββ Checkout & Payment ββ Status Tracking System
ββ Order Tracking ββ Support Ticketing
ββ Refund Requests
- Secure authentication system with Firebase
- Complete customer onboarding flow
- Restaurant catalog with search & filters
- End-to-end order placement
- Stripe payment integration
- Automated delivery agent assignment
- Real-time order status tracking
- Basic support and refund workflow
The platform uses a normalized relational model within Salesforce CRM:
ββββββββββββββββββββ ββββββββββββββββββββ ββββββββββββββββββββ
β Customer__c β β Restaurant__c β β DeliveryAgent__c β
ββββββββββββββββββββ€ ββββββββββββββββββββ€ ββββββββββββββββββββ€
β Firebase_UID__c β β Name β β Name β
β Name β β City__c β β City__c β
β Phone__c β β Prep_Time__c β β Available__c β
β Address__c β β Is_Active__c β β Workload__c β
β Onboarded__c β β Cuisine_Type__c β β Max_Orders__c β
ββββββββββ¬ββββββββββ ββββββββββ¬ββββββββββ ββββββββββ¬ββββββββββ
β β β
β β β
β ββββββββββββββββββ΄βββββββββββββββ β
β β β β
β β Order__c β β
βββββββββββ€ ββββββββββββ
ββββββββββββββββββββββββββββββββββ€
β Customer__c (Lookup) β
β Restaurant__c (Lookup) β
β Delivery_Agent__c (Lookup) β
β Order_Status__c β
β Payment_Status__c β
β Total_Amount__c β
β Order_Time__c β
ββββββββββ¬ββββββββββββββββββββββββ
β
βββββββββββββ΄ββββββββββββ
β β
βββββββββββββΌβββββββββββ βββββββββββΌβββββββββββ
β PaymentTransaction__cβ β SupportTicket__c β
ββββββββββββββββββββββββ€ ββββββββββββββββββββββ€
β Order__c (Lookup) β β Order__c (Lookup) β
β Amount__c β β Customer__c β
β Stripe_ID__c β β Reason__c β
β Status__c β β Status__c β
β Transaction_Time__c β β Refund_Amount__c β
ββββββββββββββββββββββββ ββββββββββββββββββββββ
Customer__c - Customer profiles and authentication
| Field | Type | Description |
|---|---|---|
Firebase_UID__c |
Text(128) | Unique Firebase identifier |
Name |
Text(80) | Customer full name |
Email__c |
Primary email address | |
Phone__c |
Phone | Contact number |
Address__c |
Text Area | Delivery address |
City__c |
Picklist | Service city |
Onboarded__c |
Checkbox | Profile completion status |
Restaurant__c - Restaurant catalog and metadata
| Field | Type | Description |
|---|---|---|
Name |
Text(80) | Restaurant name |
City__c |
Picklist | Operating city |
Prep_Time__c |
Number | Average preparation time (minutes) |
Is_Active__c |
Checkbox | Operational status |
Cuisine_Type__c |
Multi-Picklist | Cuisine categories |
Rating__c |
Number(3,2) | Average customer rating |
Order__c - Order lifecycle management
| Field | Type | Description |
|---|---|---|
Customer__c |
Lookup(Customer__c) | Order owner |
Restaurant__c |
Lookup(Restaurant__c) | Restaurant reference |
Delivery_Agent__c |
Lookup(DeliveryAgent__c) | Assigned agent |
Order_Status__c |
Picklist | PAYMENT_PENDING, CONFIRMED, ASSIGNED, DELIVERED |
Payment_Status__c |
Picklist | UNPAID, PAID, REFUNDED |
Total_Amount__c |
Currency | Order total |
Order_Time__c |
DateTime | Order placement timestamp |
PaymentTransaction__c - Payment records and reconciliation
| Field | Type | Description |
|---|---|---|
Order__c |
Lookup(Order__c) | Associated order |
Amount__c |
Currency | Transaction amount |
Stripe_ID__c |
Text(255) | Stripe transaction ID |
Status__c |
Picklist | PENDING, SUCCESS, FAILED, REFUNDED |
Transaction_Time__c |
DateTime | Payment timestamp |
QuickPlate implements a multi-layered security architecture:
sequenceDiagram
participant U as User
participant R as React App
participant F as Firebase
participant A as Apex API
participant S as Salesforce CRM
U->>R: Click "Sign in with Google"
R->>F: Initiate OAuth
F->>U: Google Login Page
U->>F: Enter Credentials
F->>R: Return ID Token
R->>A: API Call + ID Token
A->>F: Verify Token
F->>A: Token Valid + UID
A->>S: Query Customer by UID
alt Customer Exists
S->>A: Customer Record
A->>R: Login Success + Profile
else New Customer
A->>S: Create Customer Record
S->>A: New Customer Created
A->>R: Account Created + Onboarding Required
end
R->>U: Redirect to Dashboard/Onboarding
| Layer | Implementation | Purpose |
|---|---|---|
| Client Authentication | Firebase ID Tokens | Verify user identity |
| API Authorization | Token validation in Apex | Prevent unauthorized access |
| Data Access Control | Salesforce Sharing Rules | Row-level security |
| Field-Level Security | Profile & Permission Sets | Column-level protection |
| Guest User Isolation | Site Guest User + Permissions | Public API security |
| Cross-User Prevention | UID to Customer mapping | Data segregation |
// Example: Secure API endpoint with token validation
@RestResource(urlMapping='/api/v1/orders/*')
global class OrderAPI {
@HttpPost
global static Response createOrder() {
// 1. Extract Firebase ID token from header
String idToken = RestContext.request.headers.get('Authorization');
// 2. Validate token and get Firebase UID
String firebaseUID = FirebaseAuthService.validateToken(idToken);
if (String.isBlank(firebaseUID)) {
return new Response(401, 'Unauthorized');
}
// 3. Query customer by UID (prevents cross-user access)
Customer__c customer = [
SELECT Id, Name, Onboarded__c
FROM Customer__c
WHERE Firebase_UID__c = :firebaseUID
LIMIT 1
];
// 4. Process order for authenticated customer only
Order__c order = createOrderForCustomer(customer.Id);
return new Response(200, order);
}
}βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ONBOARDING WORKFLOW β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
[Google Login] β [Token Verified] β [Customer Created]
β
[Check Profile]
β
βββββββββββββββββ΄ββββββββββββββββ
β β
[Complete Profile] [Incomplete]
β β
[Access Platform] [Redirect to Form]
β
[Collect: Name, Phone, Address]
β
[Update Customer]
β
[Set Onboarded = TRUE]
β
[Access Platform]
API Endpoint: POST /api/v1/customer/onboard
Required Fields:
- Name (Text, max 80 characters)
- Phone (E.164 format)
- Address (Complete street address)
- City (From supported cities list)
stateDiagram-v2
[*] --> BrowseRestaurants: User Authenticated
BrowseRestaurants --> SelectRestaurant: Choose Restaurant
SelectRestaurant --> CreateOrder: Initiate Order
CreateOrder --> PaymentPending: Order Created
PaymentPending --> StripeCheckout: Redirect to Stripe
StripeCheckout --> PaymentProcessing: User Completes Payment
PaymentProcessing --> PaymentSuccess: Payment Successful
PaymentProcessing --> PaymentFailed: Payment Failed
PaymentSuccess --> WebhookReceived: Stripe Webhook
WebhookReceived --> UpdateOrder: Update Transaction
UpdateOrder --> OrderConfirmed: Status: CONFIRMED
OrderConfirmed --> AssignAgent: Trigger Assignment
AssignAgent --> OrderAssigned: Agent Assigned
OrderAssigned --> InDelivery: Out for Delivery
InDelivery --> Delivered: Order Delivered
Delivered --> [*]
PaymentFailed --> PaymentPending: Retry Payment
Order States:
| Status | Description | Payment Status |
|---|---|---|
PAYMENT_PENDING |
Order created, awaiting payment | UNPAID |
CONFIRMED |
Payment successful, order confirmed | PAID |
ASSIGNED |
Delivery agent assigned | PAID |
IN_DELIVERY |
Order out for delivery | PAID |
DELIVERED |
Order completed | PAID |
CANCELLED |
Order cancelled | UNPAID or REFUNDED |
Algorithm: Intelligent agent matching based on availability and workload
// Simplified assignment logic
public static DeliveryAgent__c assignDeliveryAgent(Order__c order) {
// Query available agents in order's city
List<DeliveryAgent__c> availableAgents = [
SELECT Id, Name, Workload__c, Max_Orders__c
FROM DeliveryAgent__c
WHERE City__c = :order.Restaurant__r.City__c
AND Available__c = true
AND Workload__c < Max_Orders__c
ORDER BY Workload__c ASC
LIMIT 1
];
if (availableAgents.isEmpty()) {
throw new NoAgentAvailableException();
}
DeliveryAgent__c agent = availableAgents[0];
// Update order and agent
order.Delivery_Agent__c = agent.Id;
order.Order_Status__c = 'ASSIGNED';
update order;
agent.Workload__c += 1;
update agent;
return agent;
}Assignment Criteria:
- β Same city as restaurant
- β Currently available
- β Below maximum order capacity
- β Lowest current workload
Customer Request β Support Ticket Created β Agent Review
β
[Approve/Reject]
β
βββββββββββββββββββ΄ββββββββββββββββββ
β β
[Approved] [Rejected]
β β
Finance Team Notified Notify Customer
β β
Process Refund via Stripe Close Ticket
β
Update Payment Status β REFUNDED
β
Update Order Status β CANCELLED
β
Notify Customer
API Endpoints:
POST /api/v1/support/ticket- Create support ticketPUT /api/v1/support/ticket/{id}/approve- Approve refundPUT /api/v1/support/ticket/{id}/reject- Reject refund
Production: https://quickplate.my.salesforce-sites.com/services/apexrest
Development: https://quickplate--dev.sandbox.my.salesforce-sites.com/services/apexrest
Authorization: Bearer <FIREBASE_ID_TOKEN>
Content-Type: application/jsonPOST /api/v1/customer/onboard
Description: Complete customer onboarding
Request Body:
{
"name": "John Doe",
"phone": "+911234567890",
"address": "123 MG Road, Bangalore",
"city": "Bangalore"
}Response (200):
{
"success": true,
"message": "Onboarding completed successfully",
"customer": {
"id": "a015g000001AbCdEFG",
"name": "John Doe",
"email": "john@example.com",
"onboarded": true
}
}GET /api/v1/restaurants
Description: Fetch active restaurants
Query Parameters:
city(optional): Filter by citycuisine(optional): Filter by cuisine type
Response (200):
{
"success": true,
"restaurants": [
{
"id": "a025g000001XyZwXYZ",
"name": "Tasty Bites",
"city": "Bangalore",
"prepTime": 20,
"cuisineType": "Indian, Chinese",
"rating": 4.5,
"isActive": true
}
]
}POST /api/v1/orders
Description: Create new order
Request Body:
{
"restaurantId": "a025g000001XyZwXYZ",
"items": [
{
"name": "Margherita Pizza",
"quantity": 2,
"price": 299
}
],
"totalAmount": 598
}Response (201):
{
"success": true,
"order": {
"id": "a035g000002PqRsTUV",
"orderStatus": "PAYMENT_PENDING",
"paymentStatus": "UNPAID",
"totalAmount": 598,
"orderTime": "2024-01-15T10:30:00Z"
},
"paymentUrl": "https://checkout.stripe.com/pay/cs_test_..."
}GET /api/v1/orders/{orderId}
Description: Get order details and status
Response (200):
{
"success": true,
"order": {
"id": "a035g000002PqRsTUV",
"orderStatus": "IN_DELIVERY",
"paymentStatus": "PAID",
"restaurant": {
"name": "Tasty Bites",
"city": "Bangalore"
},
"deliveryAgent": {
"name": "Ravi Kumar",
"phone": "+919876543210"
},
"totalAmount": 598,
"orderTime": "2024-01-15T10:30:00Z",
"estimatedDelivery": "2024-01-15T11:00:00Z"
}
}POST /api/v1/support/ticket
Description: Create support ticket for refund
Request Body:
{
"orderId": "a035g000002PqRsTUV",
"reason": "Order not delivered",
"description": "Waited for over 1 hour, no delivery agent contacted"
}Response (201):
{
"success": true,
"ticket": {
"id": "a045g000003WxYzXYZ",
"status": "OPEN",
"reason": "Order not delivered",
"createdTime": "2024-01-15T12:00:00Z"
}
}Node.js >= 18.x
npm >= 9.x
Salesforce Developer Account
Firebase Project
Stripe Account- Clone the repository
git clone https://github.com/yourusername/quickplate.git
cd quickplate- Install dependencies
npm install- Configure environment variables
cp .env.example .envEdit .env with your credentials:
# Firebase Configuration
REACT_APP_FIREBASE_API_KEY=your_api_key
REACT_APP_FIREBASE_AUTH_DOMAIN=your_domain
REACT_APP_FIREBASE_PROJECT_ID=your_project_id
# Salesforce API
REACT_APP_SF_API_BASE_URL=https://your-instance.salesforce.com
# Stripe
REACT_APP_STRIPE_PUBLIC_KEY=pk_test_your_key- Deploy Salesforce Metadata
# Login to Salesforce
sfdx auth:web:login -a QuickPlate
# Deploy custom objects and Apex classes
sfdx force:source:deploy -p force-app/main/default- Start development server
npm startVisit http://localhost:3000 π
# Firebase
REACT_APP_FIREBASE_API_KEY=
REACT_APP_FIREBASE_AUTH_DOMAIN=
REACT_APP_FIREBASE_PROJECT_ID=
REACT_APP_FIREBASE_STORAGE_BUCKET=
REACT_APP_FIREBASE_MESSAGING_SENDER_ID=
REACT_APP_FIREBASE_APP_ID=
# Salesforce
REACT_APP_SF_API_BASE_URL=
REACT_APP_SF_SITE_URL=
# Stripe
REACT_APP_STRIPE_PUBLIC_KEY=
# Environment
REACT_APP_ENV=developmentConfigure Custom Settings:
- Navigate to Setup β Custom Settings
- Create QuickPlate_Config__c
- Add fields:
Stripe_Secret_Key__cStripe_Webhook_Secret__cFirebase_Project_ID__cMax_Delivery_Agent_Workload__c
# Build production bundle
npm run build
# Deploy to Vercel
vercel --prod
# Or deploy to Netlify
netlify deploy --prod --dir=build# Deploy to production
sfdx force:source:deploy -p force-app/main/default -u production
# Assign permission sets
sfdx force:user:permset:assign -n QuickPlate_Customer_Access -u user@email.com- Go to Stripe Dashboard β Webhooks
- Add endpoint:
https://your-salesforce-site.com/services/apexrest/webhook/stripe - Select events:
checkout.session.completedpayment_intent.succeededpayment_intent.payment_failed
- β‘ React Code Splitting: Lazy loading for routes
- π API Response Caching: 5-minute TTL for restaurant lists
- π Database Indexing: Indexed fields on Customer, Order, Restaurant
- π Salesforce Bulk Processing: Batch Apex for high-volume operations
- πΎ State Management: Redux for client-side caching
| Metric | Target | Current |
|---|---|---|
| API Response Time | < 200ms | 150ms avg |
| Order Processing | < 2s | 1.8s avg |
| Concurrent Users | 10,000+ | Tested to 15,000 |
| Orders/Hour | 5,000+ | Supports 7,500 |
| Database Growth | Linear | Optimized indexes |
# Run unit tests
npm test
# Run integration tests
npm run test:integration
# Run E2E tests
npm run test:e2e
# Coverage report
npm run test:coverage# Run Apex tests
sfdx force:apex:test:run -n OrderAPITest,PaymentServiceTest -r humanWe welcome contributions! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow Airbnb JavaScript Style Guide
- Use ESLint and Prettier
- Write meaningful commit messages
- Add tests for new features
This project is licensed under the MIT License - see the LICENSE file for details.
Need Help?
π§ Email Support β’ π¬ Discord Community β’ π Documentation
- Firebase Team for authentication services
- Stripe for payment infrastructure
- Salesforce for enterprise CRM platform
- React community for amazing tools and libraries