Backend API for YapaGachis - Pan-African anti-food waste marketplace
# YapaGachis Backend API
Backend API for YapaGachis - A pan-African anti-food waste marketplace platform.
## 🎯 Features
- **Multi-user System**: Clients, Food Suppliers, Deal Suppliers, Associations, Advertisers, Admins
- **Anti-Waste Marketplace**: Buy and sell unsold food items at reduced prices
- **Donations System**: Food and financial donations to NGOs
- **Deals Section**: Promotional offers for hotels, leisure, and services
- **Advertising Platform**: Integrated advertising system
- **Subscription Management**: Tiered subscriptions for suppliers (Basic/Pro/Premium)
- **Real-time Features**: WebSocket support for live updates
- **Payment Integration**: Mobile Money (Orange, MTN, Moov, Wave) + Cards (Stripe, Paystack)
- **Geolocation**: Location-based product search
- **Notifications**: Multi-channel (Push, SMS, Email)
## 🏗️ Tech Stack
- **Runtime**: Node.js 18+
- **Framework**: Express.js + TypeScript
- **Database**: PostgreSQL with Prisma ORM
- **Cache**: Redis
- **Queue**: BullMQ
- **Real-time**: Socket.io
- **File Storage**: Cloudinary / AWS S3
- **Monitoring**: Winston, Sentry
- **Containerization**: Docker
## 📋 Prerequisites
- Node.js >= 18.0.0
- npm >= 9.0.0
- Docker & Docker Compose (for local development)
- PostgreSQL 14+ (or use Docker)
- Redis 7+ (or use Docker)
## 🚀 Getting Started
### 1. Clone the repository
```bash
git clone
cd yapasgachis_backend
```
### 2. Install dependencies
```bash
npm install
```
### 3. Environment setup
```bash
cp .env.example .env
```
Edit `.env` file with your configuration:
```env
DATABASE_URL=postgresql://postgres:password@localhost:5432/yapasgachis?schema=public
REDIS_HOST=localhost
REDIS_PORT=6379
JWT_SECRET=your-secret-key
# ... other variables
```
### 4. Start services with Docker
```bash
npm run docker:up
```
This will start:
- PostgreSQL on port 5432
- Redis on port 6379
- pgAdmin on port 5050
- Redis Commander on port 8081
### 5. Generate Prisma Client
```bash
npm run prisma:generate
```
### …