ModestWear API

Getting Started

  • Quickstart Guide
    • Base URL
    • Authentication
    • Quick Example
      • 1. Register a New User
      • 2. Browse Products
      • 3. Filter by Coverage Level
      • 4. Add to Cart
    • Interactive Documentation
    • Next Steps
  • Authentication Guide
    • Authentication Methods
      • 1. Email/Password Registration
      • 2. Email Verification
      • 3. Login
      • 4. Google OAuth Login
    • Token Management
      • Access Token
      • Refresh Token
      • Token Refresh
    • Using Tokens
    • Logout
    • Security Features
    • Error Responses
      • Invalid Credentials
      • Account Locked
      • Token Expired
    • Best Practices
    • Next Steps
  • Installation Guide
    • Prerequisites
    • Quick Setup
      • 1. Clone Repository
      • 2. Create Virtual Environment
      • 3. Install Dependencies
      • 4. Configure Environment Variables
      • 5. Setup Database
      • 6. Run Migrations
      • 7. Create Superuser
      • 8. Load Sample Data (Optional)
      • 9. Run Development Server
    • Detailed Setup
      • PostgreSQL Setup
        • Windows
        • macOS
        • Linux (Ubuntu/Debian)
      • Redis Setup (Optional)
        • Windows
        • macOS
        • Linux
      • Cloudinary Setup (Optional)
      • Google OAuth Setup
    • Project Structure
    • Running Tests
    • Development Tools
      • Django Admin
      • API Documentation
      • Django Shell
      • Database Shell
    • Common Issues
      • Issue: ModuleNotFoundError
      • Issue: Database connection error
      • Issue: Redis connection error
      • Issue: Email not sending
      • Issue: Static files not loading
    • Development Workflow
      • 1. Create Feature Branch
      • 2. Make Changes
      • 3. Run Tests
      • 4. Check Code Quality
      • 5. Commit Changes
      • 6. Push and Create PR
    • Environment-Specific Settings
      • Development
      • Staging
      • Production
    • Next Steps

API Reference

  • Authentication API
    • Overview
    • Endpoints Summary
    • Registration
      • POST /api/users/register/
    • Email Verification
      • POST /api/users/verify-email/
    • Login
      • POST /api/users/login/
    • Token Refresh
      • POST /api/users/token/refresh/
    • Token Validation
      • GET /api/users/token/validate/
    • Logout
      • POST /api/users/logout/
    • Google OAuth
      • POST /api/users/social/google/
    • User Profile
      • GET /api/users/profile/
      • PUT/PATCH /api/users/profile/
    • JWT Token Structure
      • Access Token Payload
      • Refresh Token Payload
    • Security Best Practices
    • Next Steps
  • Catalog API
    • List Products
      • Query Parameters
      • Example Request
      • Example Response
    • Get Product Details
      • Example Request
      • Example Response
    • List Categories
      • Example Request
      • Example Response
    • Get Available Filters
      • Example Request
      • Example Response
    • Coverage Levels
    • Size Chart
    • Error Responses
      • Product Not Found
      • Invalid Filter Parameters
    • Best Practices
    • Next Steps
  • Orders API
    • Overview
    • Endpoints Summary
    • Shopping Cart
      • GET /api/orders/cart/
      • POST /api/orders/cart/add/
      • PATCH /api/orders/cart/update/{id}/
      • DELETE /api/orders/cart/remove/{id}/
      • POST /api/orders/cart/clear/
    • Wishlist
      • GET /api/orders/wishlist/
      • POST /api/orders/wishlist/add/
      • DELETE /api/orders/wishlist/remove/{id}/
    • Order Management
      • POST /api/orders/create/
      • GET /api/orders/
      • GET /api/orders/{id}/
      • POST /api/orders/{id}/cancel/
    • Order Status Lifecycle
    • Guest Cart Migration
    • Stock Management
      • Stock Reservation
      • Stock Release
      • Low Stock Alerts
    • Payment Integration
      • Stripe
      • Paystack
    • Best Practices
    • Next Steps
  • Outfits API
    • Overview
    • Endpoints Summary
    • List Outfits
      • GET /api/outfits/
    • Create Outfit
      • POST /api/outfits/
    • Get Outfit Details
      • GET /api/outfits/{id}/
    • Update Outfit
      • PUT/PATCH /api/outfits/{id}/
    • Delete Outfit
      • DELETE /api/outfits/{id}/
    • Public Outfits
      • GET /api/outfits/public/
    • My Outfits
      • GET /api/outfits/my-outfits/
    • Use Cases
      • 1. Personal Styling
      • 2. Community Inspiration
      • 3. Cross-Selling
      • 4. Personalized Recommendations (Future)
    • Future Enhancements
      • AI-Powered Recommendations
      • Social Features
      • Outfit Collections
    • Best Practices
    • Next Steps
  • Error Handling
    • Overview
    • Response Format
      • Success Response
      • Error Response
    • HTTP Status Codes
      • 2xx Success
      • 4xx Client Errors
      • 5xx Server Errors
    • Authentication Errors
      • 401 Unauthorized
      • 403 Forbidden
    • Validation Errors
      • 400 Bad Request
    • Resource Errors
      • 404 Not Found
      • 409 Conflict
    • Business Logic Errors
      • Insufficient Stock
      • Empty Cart
      • Order Cannot Be Cancelled
      • Invalid Order Status Transition
      • Payment Failed
    • Rate Limiting Errors
      • 429 Too Many Requests
    • Server Errors
      • 500 Internal Server Error
      • 502 Bad Gateway
      • 503 Service Unavailable
    • Error Handling Best Practices
      • Client-Side Handling
      • Server-Side Handling
    • Error Logging
      • Log Levels
      • Logging Examples
      • What to Log
    • Debugging Tips
      • 1. Check Swagger/ReDoc
      • 2. Use Django Debug Toolbar (Development)
      • 3. Enable Verbose Logging
      • 4. Test with cURL
      • 5. Check Render Logs
    • Common Issues & Solutions
      • Issue: Token Expired
      • Issue: CORS Error
      • Issue: 502 Bad Gateway
      • Issue: Database Connection Error
    • Error Response Examples
      • Complete Error Response
      • Minimal Error Response
    • Next Steps

Architecture

  • Database Architecture
    • Overview
    • Entity Relationship Diagram
    • Module Breakdown
      • 1. Users Module
        • users_user
      • 2. Catalog Module
        • catalog_category
        • catalog_coveragelevel
        • catalog_product
        • catalog_productvariant
        • catalog_productimage
      • 3. Orders Module
        • orders_wishlist
        • orders_cartitem
        • orders_order
        • orders_orderitem
      • 4. Outfits Module
        • outfits_outfit
        • outfits_outfititem
    • Key Relationships
      • One-to-Many (1:N)
      • Many-to-One (N:1)
      • Self-Referencing
    • Performance Optimizations
      • Indexes
      • Connection Pooling
      • Query Optimization
    • Scalability Considerations
    • Future Enhancements
    • Next Steps
  • Deployment Architecture
    • Overview
    • Architecture Diagram
    • Backend Deployment (Render)
      • Service Configuration
      • deploy.sh Script
      • Gunicorn Configuration
      • Environment Variables
      • Free Tier Limitations
      • Preventing Sleep
    • Database (Neon PostgreSQL)
      • Configuration
      • Connection String
      • Django Settings
      • Free Tier Limits
      • Optimization
    • Redis (Upstash)
      • Configuration
      • Connection String
      • Django Settings
      • Free Tier Limits
      • Celery Configuration
    • Media Storage (Cloudinary)
      • Configuration
      • Django Settings
      • Free Tier Limits
      • Features Used
    • Frontend (Vercel)
      • Configuration
      • Environment Variables
      • Free Tier Limits
    • CI/CD Pipeline
      • Automatic Deployment
      • Manual Deployment
    • Monitoring & Logging
      • Render Logs
      • Django Logging
      • Health Monitoring
    • Security
      • HTTPS/TLS
      • Django Security Settings
      • CORS Configuration
    • Scaling Strategy
      • Current (Free Tier)
      • Scaling Path
    • Backup & Recovery
      • Database Backups
      • Media Backups
    • Troubleshooting
      • Service Won’t Start
      • Database Connection Errors
      • Redis Connection Errors
      • Out of Memory
    • Cost Optimization
      • Current Setup (Free)
      • Paid Upgrade Path
    • Next Steps
  • Security Architecture
    • Overview
    • Authentication Security
      • JWT Token Management
      • Password Security
      • Account Lockout
      • Email Verification
      • Social OAuth Security
    • Authorization & Access Control
      • Permission Levels
      • Endpoint Protection
      • CORS Configuration
      • CSRF Protection
    • Data Protection
      • Encryption in Transit
      • Encryption at Rest
      • PII Protection
    • Input Validation & Sanitization
      • Request Validation
      • SQL Injection Prevention
      • XSS Prevention
      • File Upload Security
    • Rate Limiting
      • Throttling Configuration
      • Implementation
    • Security Monitoring
      • Logging
      • Audit Trail
    • Vulnerability Prevention
      • Common Vulnerabilities
      • Security Headers
    • Secrets Management
      • Environment Variables
      • Sensitive Data
    • Compliance & Best Practices
      • GDPR Compliance
      • Security Best Practices
    • Security Checklist
      • Development
      • Pre-Production
      • Production
    • Incident Response
      • Security Breach Protocol
      • Contact
    • Next Steps

Additional Resources

  • Testing Guide
    • Overview
    • Running Tests
      • All Tests
      • Specific App
      • Specific Test Class
      • Specific Test Method
      • With Coverage
    • Test Structure
      • Directory Layout
    • Unit Tests
      • Model Tests
      • Serializer Tests
    • Integration Tests
      • API Endpoint Tests
      • Authenticated Endpoint Tests
    • Workflow Tests
      • Complete E-Commerce Flow
    • Manual Testing
      • Using Swagger UI
      • Using cURL
      • Using Postman
    • Load Testing
      • Using Locust
    • Test Data
      • Fixtures
      • Factory Pattern
    • Continuous Integration
      • GitHub Actions
    • Test Coverage Goals
      • Target Coverage
      • Check Coverage
    • Best Practices
    • Next Steps
ModestWear API
  • Search


© Copyright 2024, ModestWear.

Built with Sphinx using a theme provided by Read the Docs.