77 lines
1.9 KiB
Markdown

# Uber Wrapper (Node.js + Express + SQLite)
Generic multi-merchant Uber Eats API wrapper for POS integrations.
## What this gives you
- Multi-merchant model (each restaurant connects its own Uber account)
- OAuth flow support and manual token storage support
- Generic passthrough endpoint to cover all Uber APIs
- Business shortcuts for common menu/order/store flows
- Webhook ingestion endpoint
- SQLite persistence with adapter boundary for future MySQL/Postgres migration
- Swagger UI docs + Postman collection
## Quick Start
1. Install dependencies
```bash
npm install
```
2. Configure env
```bash
copy .env.example .env
```
3. Start server
```bash
npm run dev
```
4. Open docs
- Swagger UI: `http://localhost:8080/docs`
- Health: `http://localhost:8080/health`
## Folder Structure
- `src/` application source
- `src/db/adapter.js` database abstraction boundary
- `docs/developer-portal/` human-friendly docs
- `docs/openapi/` exported OpenAPI artifacts
- `postman/` Postman collection
## Database Migration Strategy
All controllers/services consume repositories through `src/db/adapter.js`.
To switch from SQLite to MySQL/Postgres later:
1. Implement repository methods for new DB backend.
2. Replace exports in `src/db/adapter.js`.
3. Keep controllers/routes unchanged.
## Scope (Current Phase)
Current implementation focus is **Uber Eats Marketplace APIs only**:
- Authentication (OAuth)
- Stores
- Menus
- Orders
- Marketplace webhooks
Uber Direct is intentionally deferred to a later phase.
## Important Note About Endpoint Coverage
This wrapper includes:
- A generic endpoint (`POST /api/v1/uber/request`) for all current/future **Uber Eats** endpoints.
- Pre-built shortcuts for high-frequency flows (menu/orders/store hours).
When you finalize your Uber docs copy, update `src/config/uberEndpoints.js` with exact endpoint paths from your approved Uber docs.