A complete system for crowdsourcing, processing, and displaying credit card offers and benefits data in the OGWallet app.
data-server/)Files:
main.py - FastAPI server with REST endpointsmodels.py - Pydantic data models for validationforms_processor.py - Microsoft Forms integrationgit_manager.py - Git repository managementprocess_excel.py - Script to process Excel exportsinit_sample_data.py - Initialize with sample datatest_setup.py - Quick setup script (no dependencies)requirements.txt - Python dependencies.env.example - Configuration templateFeatures:
ogwallet-data/)Structure:
ogwallet-data/
├── data.json # Complete dataset
├── offers/ # Individual offer files
│ ├── offer-001.json
│ ├── offer-002.json
│ └── offer-003.json
├── benefits/ # Individual benefit files
├── redemptions/ # Redemption options
└── README.md
Sample Data:
composeApp/)Files:
src/commonMain/kotlin/dev/consumerfinance/ogwallet/data/CreditCardDataLoader.kt
Updated:
src/commonMain/kotlin/dev/consumerfinance/ogwallet/ui/screens/OfferRewardsScreen.kt
CreditCardDataLoaderFiles:
CREDIT_CARD_DATA_SETUP.md - Complete setup guidedata-server/README.md - Server documentationdata-server/MICROSOFT_FORMS_TEMPLATE.md - Form templatedata-server/quickstart.sh - Unix setup scriptdata-server/quickstart.bat - Windows setup scriptcd data-server
python3 test_setup.py
This creates sample data in ogwallet-data/ that the app can use immediately.
cd data-server
./quickstart.sh # or quickstart.bat on Windows
Then:
python process_excel.py responses.xlsxUsers → Microsoft Forms → Excel Export → Python Server → JSON Files → Git Repo → Kotlin App → UI
process_excel.py to update dataOnce server is running (uvicorn main:app --reload):
GET / - Health checkGET /stats - Processing statisticsPOST /process-forms - Process new responsesGET /offers?category=dining - Get offersGET /benefits?card_name=Chase - Get benefitsThe app automatically loads data from CreditCardDataLoader:
val creditCardData = CreditCardDataLoader.loadData()
val offers = creditCardData.offers
val redemptions = creditCardData.redemptionOptions
To use git submodules for automatic updates:
# In ogwallet-data directory
git init
git add .
git commit -m "Initial data"
git remote add origin https://github.com/yourusername/ogwallet-data.git
git push -u origin main
# In OGWallet directory
git submodule add https://github.com/yourusername/ogwallet-data.git composeApp/src/commonMain/resources/data
MICROSOFT_FORMS_TEMPLATE.mdThe OfferRewardsScreen now displays:
Created: 15 new files Modified: 2 existing files Total Lines: ~2,500 lines of code
The system has been tested and verified:
To contribute:
MIT License - Feel free to use and modify!
Status: ✅ Ready to use!
Last Updated: 2024-12-25
Version: 1.0.0