Skip to content

Investec-Developer-Community/ai-sandbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🚧 This is a work in progress/ for funsies repo - not for prod 🚧

Investec AI-Friendly Developer Sandbox

A complete developer toolkit for building with Investec APIs using AI assistants like Claude, ChatGPT, and Copilot

License: MIT Node.js Version Docker AI Ready

Quick Start β€’ Documentation β€’ AI Prompts β€’ Examples β€’ Community


🎯 What This Sandbox Provides

Get from idea to working Investec integration in minutes, not hours. This sandbox includes everything you need to build production-ready banking applications using AI assistants:

πŸ€– AI-Ready Prompts

14 comprehensive prompts for real banking scenarios - copy-paste into ChatGPT, Claude, or Copilot for instant working code

πŸ–₯️ Complete Mock Server

Local Investec API server with realistic South African banking data, proper OAuth, and chaos testing

πŸ” Interactive OAuth Playground

Visual web interface + CLI tool demonstrating the correct Investec client_credentials authentication flow

πŸŒͺ️ Chaos Testing

Simulate latency, errors, and rate limits to build robust applications


πŸš€ Quick Start (5 Minutes)

Prerequisites

1. Clone the Repository

git clone https://github.com/investec-developer-community/ai-sandbox.git
cd ai-sandbox

2. Start the Mock Server

cd mock-server
npm install
npm start

πŸŽ‰ Your mock Investec API is now running at http://localhost:3000 with:

  • Realistic account and transaction data
  • OAuth client_credentials endpoint
  • Swagger UI docs at /docs
  • Health monitoring at /health

3. Try the OAuth Playground

# In a new terminal
cd ../token-playground
npm install
npm run web

πŸŽ‰ Open http://localhost:3001 for an interactive OAuth flow walkthrough

4. Use AI Prompts

  1. Open prompt-pack/prompts.md
  2. Copy any prompt into ChatGPT, Claude, or Copilot
  3. Get instant, working Investec integration code!

πŸ“¦ What's Included

πŸ€– AI Prompt Pack

14 production-ready prompts covering:

  • Programmable Banking cards
  • Real-world banking scenarios
  • OAuth setup and testing
  • Error handling and debugging
  • Advanced integration patterns

πŸ“ Browse all prompts

πŸ–₯️ Mock Server

Local Investec API featuring:

  • Realistic banking data
  • Proper OAuth client_credentials flow
  • Swagger UI documentation
  • Chaos testing capabilities
  • Docker support

πŸ“ View mock server docs

πŸ” Token Playground

Master OAuth 2.0 with:

  • Interactive web interface
  • Step-by-step flow visualization
  • CLI tool for automation
  • Educational explanations

πŸ“ Explore OAuth playground

πŸŒͺ️ Chaos Toggles

Test resilience using:

  • Configurable latency simulation
  • Random error injection
  • Environment-based controls
  • Production-ready patterns

πŸ“ Learn about chaos testing


πŸŽ“ Perfect For

Developers
Fintech Developers
Building Investec integrations
Hackathon
Hackathon Teams
Rapid banking app prototyping
AI
AI Enthusiasts
Using ChatGPT/Claude for coding
Students
Banking API Learners
Understanding financial APIs

πŸ’‘ Example Use Cases

🎯 Instant AI-Generated Code

Prompt: "Build a Python spending tracker using Investec API that monitors card transactions and sends alerts when monthly budget is exceeded"

Result: Complete working Python application with proper authentication, error handling, and webhooks

πŸ’³ Programmable Banking Cards

  • Spending Trackers - Monitor transactions by category
  • Budget Alerts - WhatsApp notifications for overspending
  • Spare Change - Round up purchases, save the difference
  • Family Allowances - Manage spending limits for family members

🏦 Real Banking Applications

  • Bill Automation - Smart payment scheduling with balance checks
  • Merchant Analysis - Dashboard for spending patterns and trends
  • Multi-Account - Portfolio tracking across different account types
  • Fraud Detection - Alert systems for unusual spending patterns

πŸ”§ Technical Details

Supported Investec APIs

  • Personal Banking: Account information, transactions, balances
  • Programmable Banking: Card controls, transaction monitoring
  • Foreign Exchange: Multi-currency operations
  • Business Banking: Commercial account management

Authentication

  • OAuth 2.0 Client Credentials flow (correct for Investec APIs)
  • Basic Authentication with client_id:client_secret
  • API Key validation via x-api-key header
  • Token refresh handling and error recovery

API Endpoints

POST /identity/v2/oauth2/token           # OAuth authentication
GET  /za/pb/v1/accounts                  # List accounts
GET  /za/pb/v1/accounts/{id}/balance     # Account balance
GET  /za/pb/v1/accounts/{id}/transactions # Transaction history

πŸ“š Documentation

Component Description Quick Link
Getting Started Setup instructions and overview Main README
AI Prompts 14 ready-to-use prompts for AI assistants Prompt Pack
Mock Server Local Investec API with realistic data Mock Server Guide
OAuth Playground Interactive authentication learning tool OAuth Guide
Chaos Testing Resilience testing and error simulation Chaos Guide
API Alignment How sandbox matches real Investec APIs API Alignment

πŸ› οΈ Advanced Usage

Docker Deployment

cd mock-server
docker-compose up --build

Chaos Testing

# Simulate 500ms latency and 10% error rate
CHAOS_LATENCY_MS=500 CHAOS_ERROR_RATE=0.1 npm start

Custom Configuration

// Configure for your environment
const config = {
  client_id: 'your-client-id',
  client_secret: 'your-client-secret', 
  api_key: 'your-api-key',
  base_url: 'https://openapisandbox.investec.com'
};

🎯 AI Prompts Quick Reference

Scenario Prompt AI Assistant
Spending Tracker Prompt #1 ChatGPT, Claude, Copilot
Budget Alerts Prompt #2 ChatGPT, Claude, Copilot
OAuth Setup Prompt #5 ChatGPT, Claude, Copilot
Bill Automation Prompt #7 ChatGPT, Claude, Copilot
API Debugging Prompt #9 ChatGPT, Claude, Copilot
Learning Guide Prompt #11 ChatGPT, Claude, Copilot

πŸ“– View All 14 Prompts


🌟 Community Examples

Featured Projects Built with This Sandbox

Want your project featured here? Submit a PR or open an issue!

Coming soon! Share your Investec AI-powered applications with the community.

Community Contributions

  • πŸ€– Additional AI Prompts - Expand the prompt library
  • πŸ”§ Integration Examples - Real-world implementation patterns
  • πŸ“š Tutorials - Step-by-step guides for specific use cases
  • πŸ› Bug Reports - Help improve the sandbox

🀝 Contributing

We welcome contributions from the Investec developer community!

Ways to Contribute

  1. πŸ€– Add AI Prompts - Expand the prompt library
  2. πŸ”§ Improve Mock Data - Enhance realism in mock-server/
  3. πŸ“š Update Documentation - Keep guides current and helpful
  4. πŸ› Report Issues - Help us fix bugs and improve UX
  5. πŸ’‘ Suggest Features - Ideas for new sandbox capabilities

Development Setup

git clone https://github.com/investec-developer-community/ai-sandbox.git
cd ai-sandbox

# Install dependencies for both components
cd mock-server && npm install && cd ..
cd token-playground && npm install && cd ..

# Start mock server (terminal 1)
cd mock-server && npm start

# Start OAuth playground (terminal 2)  
cd ../token-playground && npm run web

Contribution Guidelines

  • Follow the existing code style and patterns
  • Update documentation for any new features
  • Test your changes with the mock server
  • Include examples in AI prompts

πŸ“ž Support & Community

Get Help

Stay Connected


⚠️ Important Notes

Security

  • πŸ”’ Mock Credentials Only - Never use sandbox credentials in production
  • πŸ›‘οΈ Follow Best Practices - See Investec Security Guidelines
  • πŸ” Secure Your Keys - Keep real API credentials safe and private

Environments

  • πŸ§ͺ Sandbox: https://openapisandbox.investec.com (testing)
  • πŸš€ Production: https://openapi.investec.com (live transactions)

Rate Limits


πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

Third Party Licenses

  • Node.js packages: Various licenses (see individual package.json files)
  • Swagger/OpenAPI specifications: Investec API Terms

πŸ™ Acknowledgments

Built with ❀️ by the Investec Developer Community

Special Thanks:

  • Investec API Team for comprehensive documentation
  • Open source community for excellent tooling
  • AI platforms (OpenAI, Anthropic) for making development more accessible
  • All developers who contribute examples and feedback

Ready to build the future of banking with AI?

⭐ Star this repo if it helped you build something awesome!

πŸš€ Get Started β€’ πŸ’¬ Join Discussion β€’ πŸ› Report Issue


Made with πŸ€– AI assistance and ❀️ for the developer community

About

An Investec AI-Friendly Developer Sandbox

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published