CRM & Billing Platform

PayFlow

A CRM and billing platform for freelancers and small businesses: customers, products and smart invoices, Stripe payments, pay-per-use billing and an AI assistant, in Arabic and English.

Visit live site Oct 2025 — Dec 2025· 2 views
Role
Team lead & full-stack developer
Team
5 developers
Timeline
3 months
Type
CRM & Billing Platform

Highlights

  • Led a 5-developer team from architecture to deployment on the MERN stack.
  • Usage-based billing: usage is tracked per resource and charged daily through Stripe.
  • AI assistant that answers questions about the business's own customers, invoices and revenue.
  • Bilingual Arabic and English interface with full right-to-left layout, plus dark mode.
On this page

The problem

A freelancer or a small business usually runs on a spreadsheet of customers, invoices made by hand, and a separate tool for payments. Nothing is connected, so nobody can quickly answer simple questions like who still owes money or which product sold best this month.

PayFlow puts customers, products, invoices, payments and reports in one place, and adds an assistant that can answer those questions in plain language. It was built as a team project in the Digital Egypt Pioneers Initiative (DEPI).

What it does

  • Customers and products: profiles, activity and revenue per customer; products with images, stock, SKUs and prices.

  • Invoices: multiple line items, automatic numbering, tax and discount, status from draft to paid or overdue, and PDF output.

  • Reports: sales, revenue, customer and product reports over any date range, with charts and export to PDF, Excel and CSV.

  • Admin panel: user management, roles and activity monitoring.

  • Arabic and English: the whole interface switches language and direction, and products and users store Arabic fields in the database.

Pay-per-use billing

Instead of subscription plans, PayFlow charges for what a business actually creates. The free tier covers 5 invoices, 3 products and 5 customers; beyond that each invoice, product and customer has a small unit price.

  1. The user saves a payment card through Stripe.

  2. Every invoice, product and customer created is recorded as usage.

  3. Once a day a scheduled job totals the usage for every account.

  4. Stripe charges the default card and the billing record is updated.

This keeps the product free for someone just starting out and makes the cost grow only as the business does.

The AI assistant

The assistant is a single chat endpoint that receives the question together with the business's own data as context. A user can ask for the top-selling products this month, the overdue invoices, or a suggested price for a new product. It works with either OpenAI or Gemini, switched by configuration, so the product is not tied to one provider.

Architecture

PayFlow is a three-tier application: a React and Vite frontend, an Express API, and MongoDB with Mongoose. Both the frontend and the API are deployed on Vercel, with the API running as serverless functions.

Going serverless shaped two decisions:

  • Scheduled work runs from outside. Serverless functions do not stay alive to run a timer, so the daily billing job is an endpoint protected by a secret and called by an external scheduler.

  • Files go to the cloud. There is no local disk to keep uploads on, so logos and product images are stored in Cloudinary.

Redis handles caching, and state on the client is split between Redux Toolkit for the session and TanStack Query for server data.

Security

  • Token-based sign-in with hashed passwords, plus Google sign-in.

  • Role-based access control on protected and admin-only routes.

  • Rate limiting, security headers and a restricted CORS origin on the API.

  • Each company's data is isolated from every other company's.

My role

I led the team of five from the first architecture sketch to the production deployment, splitting the work and keeping the backend and frontend moving together. I also built backend services and parts of the frontend myself.

Built with

  • React 18
  • Vite
  • TanStack Query
  • Tailwind CSS
  • Node.js
  • Express 5
  • MongoDB
  • Cloudinary
  • Vercel
Share:𝕏in

Building something similar?

I can help you plan it, build it, or lead the team that does.

Let's talk