Reference architecture for AI-augmented full-stack delivery with BDD acceptance gates. A working monorepo that demonstrates how a modern product team would actually wire planning, development, and acceptance testing together when AI is in the loop.
Most monorepo starters show you the layout. This one shows you the delivery flow:
- Specs as the source of truth — Concise Declarative Gherkin scenarios that double as acceptance gates and as prompts for AI-assisted feature implementation
- Functional-programming patterns — arrow functions, factory patterns, no classes — chosen because they read cleanly under AI-assisted refactoring
- Cross-platform from day one — Web + mobile-ready, single API
- Production hygiene baked in — health checks, graceful DB fallbacks, error handling, typed everywhere
The point isn't that any of these techniques is novel. The point is that they compose into a delivery substrate where AI agents can do real work without breaking the build.
This Hello World app demonstrates:
- Cross-Platform Architecture: Web app with mobile-ready responsive design
- Database Integration: PostgreSQL with graceful fallback to mock data
- Modern Tech Stack: React, Express.js, TypeScript, Nx monorepo
- Functional Programming: Arrow functions, factory patterns, no classes
- Enterprise Patterns: Health checks, error handling, monitoring
- BDD Testing: Concise Declarative Gherkin scenarios
- Quality Gates: Comprehensive linting, formatting, and type checking
Product-Outcomes/
├── api/ # Express.js API server
│ ├── src/
│ │ ├── main.ts # Server entry point
│ │ ├── routes/ # API routes (messages)
│ │ └── db/ # Database connection & schema
├── web/ # React web application
│ ├── src/
│ │ ├── app/ # Main app component
│ │ └── main.tsx # Web entry point
├── ui/ # Shared UI component library
│ └── src/lib/ # HelloWorld component
├── features/ # BDD test scenarios
│ ├── hello-world.feature
│ ├── step-definitions/
│ ├── page-objects/
│ └── data/ # Test data (personas)
└── docs/ # Implementation documentation
- Node.js 24+ (LTS)
- npm 9+
- Git
- Optional: PostgreSQL (uses mock data fallback)
- Optional: Docker
# Clone the repository
git clone https://github.com/bailejl/Product-Outcomes.git
cd Product-Outcomes
# Install dependencies and build all projects
npm run setup
# Start both API and web app
npm run dev# Check API health
npm run check:health
# Test Hello World endpoint
npm run check:hello| Script | Description |
|---|---|
npm start |
Start API server only |
npm run start:api |
Start Express.js API on port 3333 |
npm run start:web |
Start React web app on port 4200 |
npm run start:both |
Start both API and web app concurrently |
npm run dev |
Alias for start:both |
| Script | Description |
|---|---|
npm run build |
Build all projects (api, web, ui) |
npm run build:api |
Build API server only |
npm run build:web |
Build web application only |
npm run build:ui |
Build UI library only |
| Script | Description |
|---|---|
npm test |
Run all unit tests |
npm run test:api |
Run API tests |
npm run test:web |
Run web app tests |
npm run test:e2e |
Run end-to-end tests with Playwright |
| Script | Description |
|---|---|
npm run lint |
Lint all projects |
npm run lint:fix |
Fix auto-fixable linting issues |
npm run lint:mega |
Run comprehensive MegaLinter scan |
npm run format |
Format code with Prettier |
npm run typecheck |
TypeScript type checking |
npm run quality |
Run all quality checks (format, lint, typecheck, build) |
| Script | Description |
|---|---|
npm run clean |
Clean build cache and dependencies |
npm run setup |
Full setup (install + build) |
npm run check:health |
Check API health endpoint |
npm run check:hello |
Test Hello World endpoint |
| Script | Description |
|---|---|
npm run docker:build |
Build Docker image |
npm run docker:run |
Run application in Docker |
API Server (http://localhost:3333)
- GET
/api- API status - GET
/api/health- Health check with database status - GET
/api/messages/hello-world- Hello World message from database
Web Application (http://localhost:4200)
- Interactive Hello World interface with loading states
- Error handling and retry functionality
- Responsive design for mobile and desktop
# Run all tests
npm test
# Run specific test suites
npm run test:api # API unit tests
npm run test:web # React component tests
npm run test:e2e # End-to-end testsThe project uses Concise Declarative Gherkin for BDD scenarios:
Feature: Hello World Display
Scenario: User sees Hello World message on web
When They go to the hello world page
Then They see "Hello World from the Database!"
And They see the headerTest data uses personas and data chunks pattern in features/data/data.json.
All code must pass these checks:
npm run quality # Runs all quality checks- ✅ TypeScript compilation
- ✅ ESLint (zero warnings)
- ✅ Prettier formatting
- ✅ Successful build
- ✅ 90%+ test coverage (when tests are implemented)
# Build Docker image
npm run docker:build
# Run in container
npm run docker:run
# Manual Docker commands
docker build -t product-outcomes .
docker run -p 3333:3333 product-outcomesThe Docker image includes built-in health monitoring:
docker ps # Check container health status- Frontend: React 19, TypeScript, Vite, CSS Modules
- Backend: Express.js, Node.js 24, TypeScript
- Database: PostgreSQL (with mock fallback)
- Monorepo: Nx with Webpack, Rollup, Vite
- Testing: Playwright, Playwright-BDD, Jest
- Quality: ESLint, Prettier, MegaLinter
- Container: Docker with Alpine Linux
This project follows functional programming patterns:
- ✅ Arrow functions exclusively
- ✅ Factory functions instead of classes
- ✅ Immutable patterns
- ✅ Pure functions where possible
- ❌ No classes (except in test utilities)
- ❌ No semicolons (Prettier enforced)
// ✅ Good: Factory function pattern
export const createMessagesRouter = () => {
const router = express.Router()
const getHelloWorldMessage = async (req, res) => {
// Implementation
}
router.get('/hello-world', getHelloWorldMessage)
return router
}
// ✅ Good: Arrow function component
export const HelloWorld = () => {
const { message, error, loading } = createHelloWorldState()
return <div>{message}</div>
}This is an Nx monorepo with the following projects:
- api - Express.js API server
- web - React web application
- ui - Shared UI component library
nx.json- Nx workspace configurationtsconfig.base.json- TypeScript configurationpackage.json- Dependencies and scriptsDockerfile- Container configurationfeatures/- BDD test scenariosdocs/hello-world-implementation-plan.md- Detailed implementation plan
- Fork the repository
- Clone your fork locally
- Install dependencies:
npm run setup - Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes following the coding standards
- Test your changes:
npm run quality - Commit your changes:
git commit -m 'Add amazing feature' - Push to your branch:
git push origin feature/amazing-feature - Open a Pull Request
Before submitting any PR, ensure:
# All quality checks pass
npm run quality
# All tests pass
npm test
# Build succeeds
npm run build- Functional Programming: Use arrow functions and factory patterns
- TypeScript: Strong typing required
- Testing: Write tests for new features
- BDD: Add Gherkin scenarios for user-facing features
- Documentation: Update README for new scripts or features
- Code follows functional programming patterns
- All tests pass (
npm test) - Quality checks pass (
npm run quality) - Build succeeds (
npm run build) - Documentation updated if needed
- BDD scenarios added for new features
- Implementation Plan: docs/hello-world-implementation-plan.md
- Implementation Status: IMPLEMENTATION_STATUS.md
- Wiki: Product Outcomes Wiki
- Technology Stack: wiki/technology-stack.md
- Development Practices: wiki/practices/practices.md
API not starting:
# Check if port is in use
lsof -i :3333
# Kill existing process
pkill -f "node.*api"
# Restart API
npm run start:apiWeb app not loading:
# Check if port is in use
lsof -i :4200
# Clear cache and restart
npm run clean
npm run setup
npm run start:webDatabase errors: The app gracefully falls back to mock data if PostgreSQL is not available. This is expected behavior for development.
Build failures:
# Clear all caches
npm run clean
# Reinstall dependencies
rm -rf node_modules package-lock.json
npm install
# Try building again
npm run buildThis project is licensed under the MIT License - see the LICENSE file for details.
- Repository: https://github.com/bailejl/Product-Outcomes
- Issues: https://github.com/bailejl/Product-Outcomes/issues
- Wiki: https://github.com/bailejl/Product-Outcomes/wiki
🎉 Happy coding! This Hello World app demonstrates enterprise-grade full-stack development patterns. Explore the code, run the tests, and build amazing products! 🚀