← Back to projects

Project brief

Planet Inc. — E-commerce Backend

Production-ready Django marketplace backend with semantic search and an AI shopping assistant.

Overview

Planet Inc. is a comprehensive e-commerce backend built with Django for an online marketplace for collectibles and consumer goods. It combines traditional e-commerce (users, catalog, cart, orders, payments) with an AI-powered chat assistant for product recommendations and support. The system uses vector embeddings for complex product queries and real-time conversational help so customers can discover products that fit their interests.

Problem

Large catalogs make product discovery hard—especially in niches like collectibles where shoppers need personalized guidance. Many stores lack intelligent support, which hurts UX and raises support costs. Scaling backends for concurrency, inventory, and real-time AI adds more pressure. The work had to support complex search across big inventories, personalized experiences via AI, growth in users and transactions, and secure integration with third-party services.

Solution

I built a production-ready Django backend for the full e-commerce lifecycle with AI woven in. PostgreSQL with pgvector powers semantic product search; Redis backs caching and sessions; Celery runs async work. The assistant uses OpenAI for contextual recommendations and support-style conversations. The design keeps clear boundaries, documented APIs, and solid error handling, with containerization, automated tests, and a database layout meant to scale.

Key Features

  • RESTful API: Django REST Framework with JWT auth, pagination, and documented endpoints
  • AI shopping assistant: pgvector + OpenAI for contextual conversations and product discovery
  • Product catalog: multi-variant listings with automatic embedding generation for semantic search
  • Cart and checkout: inventory-aware totals and Paystack payment integration
  • User management: secure auth, roles, and profiles
  • Background jobs: Celery for email, payments follow-up, and AI-related tasks
  • Caching: Redis for sessions, selective API caching, and performance tuning
  • Testing: 90+ automated tests across models, APIs, auth, and business rules
  • Docker: docker-compose based local and deploy-style orchestration
  • Database work: PostgreSQL + vectors, indexing, and query optimization

Technical Decisions

  • Django 6.0 for a mature, security-conscious stack aligned with current Python practice
  • PostgreSQL + pgvector instead of a separate vector DB for ACID behavior and tight Django integration
  • JWT over session-only auth for an API-first, scalable client model
  • Celery + Redis so AI and email work never block web requests
  • Docker Compose for repeatable dev and deployment environments
  • TDD-style workflow with pytest, fast SQLite in tests, and mocks for external APIs
  • REST-first design so multiple frontends can share the same backend

Challenges & Tradeoffs

  • AI integration: balancing responsive chat with rate limits—graceful degradation when AI or upstream calls fail so the core shop still works.
  • Vector search: tuning pgvector indexes and when to generate embeddings on product writes without slowing common reads.
  • Checkout concurrency: keeping inventory correct under load using DB constraints and optimistic locking rather than fragile app-only locks.
  • External APIs: Paystack and OpenAI failures handled with retries, clear errors, and safe fallbacks.
  • Testing integrations: mocking AI and payments for stable CI while staying close to production behavior.
  • Ops tradeoff: Docker adds moving parts but pays back in consistency and onboarding for collaborators.

Contact

Whether you have a project in mind or just want to chat about tech, feel free to reach out via the form or connect through my socials.