Enterprise Open-Source Source-to-Pay Platform
Quick Start β’ Architecture β’ API Docs β’ Development β’ Deployment
OpenS2P v0.7 Enterprise MVP is a modern, open-source Source-to-Pay (S2P) platform built for the enterprise. It covers the complete procurement lifecycle β from supplier onboarding through invoice payment β with AI-powered intelligence embedded at every step.
OpenS2P was built with OpenAI GPT-5.6 and Codex.
GPT-5.6 was used to design and implement AI-assisted procurement features, while Codex accelerated development by assisting with architecture, FastAPI endpoints, SQLAlchemy models, database migrations, debugging, documentation, and testing.
Setup and testing instructions are included in the Quick Start section below, including Docker startup, database seeding, local service URLs, and demo credentials.
| Domain | Status |
|---|---|
| Supplier Management β Onboard, approve, block, risk-score | β |
| Contract Management β Lifecycle, renewals, compliance | β |
| Procurement β Purchase Requisitions β Approvals β Purchase Orders | β |
| Invoice Matching β 2-way/3-way matching with exception handling | β |
| Receiving β Goods receipt against POs with quantity validation | β |
| Workflow Engine β Configurable approval workflows | β |
| Analytics β Spend analysis, supplier scorecards, dashboards | β |
| Integration Framework β Pluggable connectors (REST, SFTP, etc.) | β |
| AI Intelligence β Risk scoring, contract review, anomaly detection | β |
| Audit Trail β Immutable change history with activity timeline | β |
| RBAC β Role-based access control (7 roles, 29 permissions) | β |
| Multi-Tenant β SaaS-ready tenant isolation | β |
- Supplier Management β Onboard, approve, block, and risk-score suppliers
- Sourcing β RFQ/RFP events with supplier bidding and award
- Contract Management β Full contract lifecycle with AI clause review
- Procurement β Purchase Requisitions β Approvals β Purchase Orders
- Receiving β Goods receipt against POs with quantity validation
- Invoice Matching β 2-way and 3-way matching with exception handling
- Workflow Engine β Configurable approval workflows with delegation
- AI Intelligence β Risk scoring, contract review, anomaly detection
- Audit Trail β Immutable change history with activity timeline
- Multi-Tenant β SaaS-ready tenant isolation
- RBAC β Role-based access control with 7 roles and 29 permissions
- Docker & Docker Compose
docker compose up --buildNote: Database migrations run automatically on startup. Seed data is loaded separately β see below.
| Service | URL |
|---|---|
| Frontend | http://localhost:80 |
| Backend API | http://localhost:8000 |
| API Docs | http://localhost:8000/docs |
| PostgreSQL | localhost:5432 |
docker compose exec backend python -m app.db.seedOr locally:
cd backend
python -m app.db.seed| Username | Password | Role |
|---|---|---|
admin |
Admin@12345 |
System Admin |
buyer |
Buyer@12345 |
Buyer |
approver |
Approver@12345 |
Approver |
requester |
Requester@12345 |
Requester |
finance |
Finance@12345 |
Finance |
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend β
β React 19 Β· TypeScript Β· Tailwind β
β TanStack Query Β· React Router β
ββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββ
β HTTP / JSON
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Backend API β
β FastAPI Β· Python 3.12 Β· Pydantic V2 β
β β
β ββββββββββββ βββββββββββ βββββββββββ ββββββββββββββ β
β β Service β βWorkflow β β Audit β β AI β β
β β Layer β β Engine β β Trail β βIntelligenceβ β
β ββββββ¬ββββββ βββββββββββ βββββββββββ ββββββββββββββ β
β β β
β ββββββΌββββββ β
β βRepositoryβ β
β β Layer β β
β ββββββ¬ββββββ β
βββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββ
β asyncpg
βΌ
ββββββββββββββββββ
β PostgreSQL β
β 16 β
ββββββββββββββββββ
HTTP Request β FastAPI Endpoint β Service Layer β Repository Layer β SQLAlchemy β PostgreSQL
With the server running, visit http://localhost:8000/docs (Swagger UI).
| Domain | Key Endpoints |
|---|---|
| Auth | POST /auth/login, GET /auth/me |
| Suppliers | CRUD + POST /approve, /block |
| Contracts | CRUD + POST /activate, /renew |
| Sourcing | Events CRUD + bids + award |
| PR | CRUD + POST /approve, /reject |
| PO | CRUD + POST /send, /close |
| Invoices | CRUD + POST /match, /approve |
| Audit | GET /audit/{type}/{id}, /recent, /user/{id} |
| AI | GET /ai/supplier/{id}/analyze, /contract/{id}/review, /invoice/{id}/analyze |
cd backend
pip install -r requirements.txt
alembic upgrade head
python -m app.db.seed
uvicorn app.main:app --reload --port 8000cd frontend
npm install
npm run dev # β http://localhost:5173cd backend
pytest ../tests/ -vdocker compose up --build -dConfigure via environment variables (see .env.example):
| Variable | Description |
|---|---|
DATABASE_URL |
PostgreSQL connection string |
JWT_SECRET_KEY |
Token signing key |
OPENAI_API_KEY |
Required for AI features |
| Layer | Technology |
|---|---|
| Backend | Python 3.12, FastAPI, SQLAlchemy 2.x, Pydantic v2 |
| Database | PostgreSQL 16, Alembic |
| Frontend | React 19, TypeScript, Tailwind, TanStack Query |
| Auth | JWT (HS256), bcrypt, RBAC |
| AI | Pluggable (local / OpenAI) |
| Infrastructure | Docker, Docker Compose |
OpenS2P/
βββ backend/
β βββ app/
β β βββ ai/ # AI intelligence services
β β βββ api/v1/ # REST endpoints
β β βββ core/ # Config, exceptions
β β βββ db/ # Session, seed data
β β βββ models/ # SQLAlchemy ORM (27 tables)
β β βββ repositories/ # Data access layer
β β βββ schemas/ # Pydantic DTOs
β β βββ security/ # JWT, passwords, RBAC
β β βββ services/ # Business logic
β βββ alembic/ # Migrations
β βββ Dockerfile
βββ frontend/
β βββ src/
β β βββ api/ # API client & types
β β βββ components/ # Reusable UI
β β βββ pages/ # 12 route pages
β β βββ layouts/ # Dashboard shell
β βββ Dockerfile
βββ tests/ # Backend tests
βββ docker-compose.yml
βββ README.md
- Supplier lifecycle management
- Sourcing events & bidding
- Contract management
- Purchase requisitions & approvals
- Purchase orders
- Goods receiving
- Invoice matching
- Audit trail & activity timeline
- AI-powered risk analysis
- Multi-tenant SaaS isolation
- OAuth 2.0 / SSO
- Supplier portal
- E-procurement catalog
- Advanced AI: LLM clause extraction
- Budget management
- Analytics dashboard
We welcome contributors β engineers, architects, security researchers, technical writers, and procurement domain experts. See CONTRIBUTING.md to get started, and look for issues labeled good first issue. Please also read our Code of Conduct.
OpenS2P is free and open source. Sponsorship funds infrastructure, security audits, and the AI evaluation program: github.com/sponsors/opens2p
Apache 2.0 β see LICENSE. Procura AI and ContractEdge are commercial applications built on the OpenS2P platform; the platform itself is fully open source.
- Website: opens2p.org
- Email: opens2p@gmail.com
- LinkedIn: linkedin.com/company/opens2p
Built for the open-source procurement community