A FastAPI-based Order Management System built as a QA automation portfolio project.
The goal of this project was to gain hands-on experience building and testing a more realistic backend application. Compared to my earlier API projects, this project includes authentication, database relationships, inventory management, order workflows, and a more structured automated testing approach.
The project combines backend development and QA automation by focusing on both application functionality and automated validation of business rules.
This project was designed to move beyond simple CRUD APIs and introduce concepts commonly found in real-world applications.
The application allows users to:
- Create accounts and log in
- Manage products and inventory
- Create and manage orders
- Progress orders through a workflow
- Validate business rules around inventory and order processing
The project also includes an automated test suite that validates API behavior, security, database state changes, and business workflows.
This project provided hands-on experience with:
- Building REST APIs using FastAPI
- Creating relational database models with SQLAlchemy
- Working with SQLite databases
- Implementing JWT authentication
- Writing automated API tests with pytest
- Testing role-based and ownership-based authorization
- Validating business workflows and state transitions
- Using reusable fixtures, factories, and helpers
- Structuring larger automated test suites
- Running automated tests through GitHub Actions
This project also served as my first opportunity to work with frontend development.
While the primary focus of the project was backend API development and QA automation, I created a simple frontend interface to interact with the Order Management System and better understand the full request/response flow between a user interface and a backend API.
Working on the frontend helped me gain experience with:
- Making API requests from a user interface
- Handling authentication flows
- Displaying API responses and errors
- Connecting frontend actions to backend business rules
- Understanding how automated API testing relates to end-user workflows
As someone coming from a Software Support background, this was a valuable introduction to how frontend and backend components work together in a complete application.
- Create user accounts
- Login using JWT authentication
- Protected routes using bearer tokens
- Role-based access control
- User
- Admin
- Create products
- Store product pricing
- Track available stock
- Validate product data
- Prevent invalid inventory operations
Authenticated users can:
- Create orders
- Add products to orders
- View their orders
- Retrieve order details
- Pay for orders
- Cancel eligible orders
Additional behavior includes:
- Automatic order total calculations
- Product quantity merging when the same item is added multiple times
- Inventory updates as items are added
The application includes a stateful order lifecycle.
CREATED
PAID
SHIPPED
DELIVERED
CANCELLED
CREATED → PAID
PAID → SHIPPED
SHIPPED → DELIVERED
CREATED → CANCELLED
PAID → CANCELLED
- Items can only be added while an order is in CREATED status
- Empty orders cannot be paid
- Only PAID orders can be shipped
- Only SHIPPED orders can be delivered
- Delivered orders are considered terminal
- Shipped and delivered orders cannot be cancelled
- Inventory is restored when eligible orders are cancelled
- Duplicate product additions merge into a single order item
The application uses SQLite with SQLAlchemy ORM.
User
└── Order
└── Order Item
└── Product
Relationships include:
- Users own Orders
- Orders contain Order Items
- Order Items reference Products
- Products track inventory levels
The database is used to validate business workflows and inventory changes throughout the order lifecycle.
This project was built with testing as a major focus.
The automated test suite covers:
- Positive API scenarios
- Negative API scenarios
- Authentication testing
- Authorization testing
- Ownership validation
- Inventory validation
- Order workflow testing
- Database state validation
- Business rule validation
- Edge case testing
To help keep tests maintainable, the test suite uses:
- Fixtures
- Factories
- Helpers
- Assertion utilities
- Workflow test scenarios
- Database validation tests
This structure made it easier to reuse setup logic and keep tests readable as the project grew.
- FastAPI
- SQLite
- SQLAlchemy
- JWT (python-jose)
- Passlib
- bcrypt
- pytest
- pytest-cov
- httpx
- Faker
- Black
- GitHub Actions
- Python 3.11+
app/
├── api/
├── core/
├── db/
├── models/
├── schemas/
└── services/
tests/
├── api/
├── workflows/
├── db/
├── fixtures/
├── factories/
├── helpers/
└── assertions/
git clone https://github.com/tnation1392/project3-OMS.git
cd project3-OMSpython -m venv .venv
.venv\Scripts\activatepython3 -m venv .venv
source .venv/bin/activatepip install -r requirements.txtuvicorn app.main:app --reloadSwagger UI:
http://127.0.0.1:8000/docs
pytest -vpytest -v -m smokepytest -v -m workflowpytest -v -m dbpytest -v --cov=app --cov-report=term-missingGitHub Actions is used to automatically:
- Run formatting checks
- Execute automated tests
- Generate coverage reports
- Validate quality before changes are merged
The goal is to mimic a simple CI workflow similar to what is used on development teams.
A simple demo flow for the system:
- Create a user
- Log in and obtain a JWT token
- Create a product
- Create an order
- Add products to the order
- Pay the order
- Ship the order as an admin
- Deliver the order as an admin
- Retrieve order details
Some examples of automated tests in the project include:
- Protected routes require authentication
- Users cannot modify another user's order
- Inventory decreases when products are added
- Inventory is restored when eligible orders are cancelled
- Delivered orders cannot be modified
- Duplicate line items merge correctly
- Business workflow transitions follow defined rules
I built this project to continue developing both backend and QA automation skills.
Compared to my previous projects, this application introduced more realistic business workflows, relational database modeling, authentication, inventory management, and workflow validation.
The project helped me gain experience writing automated tests against a stateful application where actions affect both business logic and database state.
Some of the most valuable lessons from this project included:
- Working with relational databases and ORM models
- Implementing JWT authentication
- Managing application state through workflows
- Validating inventory and business rules
- Writing reusable automated tests
- Testing database-backed applications
- Organizing larger automation projects
- Using CI tools to automate quality checks
Potential future improvements include:
- PostgreSQL support
- Docker support
- Additional API contract testing
- Expanded reporting
- Additional workflow scenarios
- Performance and load testing
Created by Todd Nason as a QA Automation portfolio project.