Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
276f31d
chore(infra): initialize pnpm monorepo structure
rafamiziara Jul 31, 2025
9f93e87
setup(infra): configure firebase project and services
rafamiziara Aug 8, 2025
1f5e4fc
setup(mobile): initialize expo mobile app
rafamiziara Aug 8, 2025
697933e
setup(infra): configure environment variables
rafamiziara Aug 8, 2025
c6dc120
feat(backend): implement generateAuthMessage cloud function
rafamiziara Aug 8, 2025
87eb344
feat(backend): implement verifySignatureAndLogin cloud function
rafamiziara Aug 8, 2025
9442664
feat(backend): Implement user profile management and improve error ha…
rafamiziara Aug 11, 2025
d018a61
feat(config): centralize monorepo tsconfig and ESLint configuration
rafamiziara Aug 11, 2025
c7238d7
feat(multi): Implement custom App Check provider
rafamiziara Aug 11, 2025
a373964
refactor(backend): reorganize directory structure for scalability
rafamiziara Aug 12, 2025
9fee3f5
test(backend): add unit tests for all backend functions
rafamiziara Aug 13, 2025
b82f4eb
feat(mobile): implement wallet connection and Reown AppKit integration
rafamiziara Aug 14, 2025
f02c4be
feat(mobile): integrate full client-side authentication flow
rafamiziara Aug 14, 2025
ee81bd6
Merge remote-tracking branch 'origin/add-claude-github-actions-175534…
rafamiziara Aug 16, 2025
b66402b
feat(mobile): implement auth-based routing with Expo Router
rafamiziara Aug 16, 2025
4bacfce
feat(mobile): complete user onboarding error handling and automation …
rafamiziara Aug 17, 2025
fde01e2
feat(mobile): enhance authentication flow with improved error handlin…
rafamiziara Aug 18, 2025
8c480d2
Update Claude Code Review prompt to be more focused on bugs and security
rafamiziara Aug 18, 2025
6a98634
chore(infra): initialize pnpm monorepo structure
rafamiziara Jul 31, 2025
cf044d3
setup(infra): configure firebase project and services
rafamiziara Aug 8, 2025
6017203
setup(mobile): initialize expo mobile app
rafamiziara Aug 8, 2025
f041c2e
setup(infra): configure environment variables
rafamiziara Aug 8, 2025
dcfd988
feat(backend): implement generateAuthMessage cloud function
rafamiziara Aug 8, 2025
1533e32
feat(backend): implement verifySignatureAndLogin cloud function
rafamiziara Aug 8, 2025
2a49498
feat(backend): Implement user profile management and improve error ha…
rafamiziara Aug 11, 2025
6c09c40
feat(config): centralize monorepo tsconfig and ESLint configuration
rafamiziara Aug 11, 2025
dc63f51
feat(multi): Implement custom App Check provider
rafamiziara Aug 11, 2025
fdc3842
refactor(backend): reorganize directory structure for scalability
rafamiziara Aug 12, 2025
8309bbd
test(backend): add unit tests for all backend functions
rafamiziara Aug 13, 2025
8903ec3
feat(mobile): implement wallet connection and Reown AppKit integration
rafamiziara Aug 14, 2025
d6a26ad
feat(mobile): integrate full client-side authentication flow
rafamiziara Aug 14, 2025
91cc7dc
feat(mobile): implement auth-based routing with Expo Router
rafamiziara Aug 16, 2025
eafed38
feat(mobile): complete user onboarding error handling and automation …
rafamiziara Aug 17, 2025
eb2596b
feat(mobile): enhance authentication flow with improved error handlin…
rafamiziara Aug 18, 2025
f9609e2
Merge branch 'feat/wallet-connection' of https://github.com/rafamizia…
rafamiziara Aug 18, 2025
1063027
fix(backend): add nonce expiration to prevent authentication replay a…
rafamiziara Aug 18, 2025
aabe970
fix(backend): implement hybrid device verification for App Check secu…
rafamiziara Aug 18, 2025
dfe989b
fix(mobile): resolve multiple security vulnerabilities and memory leaks
rafamiziara Aug 18, 2025
15b0ed1
fix(mobile): integrate authentication hook into wallet connection screen
rafamiziara Aug 18, 2025
61108e8
fix(multi): resolve Safe wallet authentication failures with Firebase
rafamiziara Aug 18, 2025
698a077
feat(mobile): implement modular authentication architecture with comp…
rafamiziara Aug 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
env: {
node: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
],
ignorePatterns: ['dist', 'node_modules', 'lib', 'dev-start.js'],
rules: {
'quotes': ['error', 'single'],
'indent': ['error', 2, { 'SwitchCase': 1 }],
},
};
5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "genesis-super-pool"
}
}
9 changes: 1 addition & 8 deletions .github/workflows/claude-code-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,7 @@ jobs:

# Direct prompt for automated review (no @claude mention needed)
direct_prompt: |
Please review this pull request and provide feedback on:
- Code quality and best practices
- Potential bugs or issues
- Performance considerations
- Security concerns
- Test coverage

Be constructive and helpful in your feedback.
Please review this pull request and look specifically for bugs and security issues. Only provide feedback on potential bugs and vulnerabilities. Be concise and to the point.

# Optional: Use sticky comments to make Claude reuse the same comment on subsequent pushes to the same PR
# use_sticky_comment: true
Expand Down
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Dependencies
node_modules

# IDE
.vscode/

# Debug
firebase-debug.log
firestore-debug.log

# Env Variables
.env
.env.*

# Ngrok config (contains personal authtoken)
ngrok.yml

# Claude Code files
CLAUDE.md
**/CLAUDE.md
.claude/
228 changes: 204 additions & 24 deletions README.md

Large diffs are not rendered by default.

172 changes: 172 additions & 0 deletions SPRINT_1_IMPLEMENTATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
# 🏃‍♀️ Sprint 1 Implementation Tracker
## Create a New Lending Pool Feature

This document tracks the GitHub issues and implementation progress for Sprint 1's "Create a New Lending Pool" feature from the [SPRINT_PLAN.md](./SPRINT_PLAN.md).

---

## 🎯 Sprint 1 Goal
Enable designated pool creators/admins to successfully deploy new lending pools on Polygon Amoy via the dApp, with verified contracts owned by multi-sig Safe.

---

## ✅ User Onboarding & Wallet Connection (COMPLETED)

### Infrastructure & Setup
- **[#1 ✅ CLOSED]** chore: PNPM Monorepo Initialization
- **[#2 ✅ CLOSED]** setup: Configure Firebase project and services
- **[#3 ✅ CLOSED]** setup: Configure environment variables across workspaces
- **[#18 ✅ CLOSED]** setup: Initialize the Expo mobile app
- **[#19 ✅ CLOSED]** chore: Configure Monorepo tsconfig and ESLint
- **[#20 ✅ CLOSED]** refactor: Backend Directory Refactoring

### Backend Authentication System
- **[#4 ✅ CLOSED]** feat: Implement 'generateAuthMessage' Cloud Function
- **[#5 ✅ CLOSED]** feat: Implement 'verifySignatureAndLogin' Cloud Function
- **[#6 ✅ CLOSED]** feat: Implement Firestore user profile creation/update
- **[#7 ✅ CLOSED]** feat: Implement Custom App Check Provider
- **[#8 ✅ CLOSED]** test: Add unit tests for backend auth functions

### Mobile App Wallet Integration
- **[#9 ✅ CLOSED]** feat: Install wallet connection libraries (wagmi/viem)
- **[#10 ✅ CLOSED]** feat: Implement 'Connect Wallet' UI component
- **[#11 ✅ CLOSED]** feat: Integrate wallet connection and state management logic
- **[#12 ✅ CLOSED]** feat: Integrate Firebase SDK and authentication logic
- **[#13 ✅ CLOSED]** feat: Implement basic routing based on auth status

### Quality Assurance & Refinement
- **[#14 ✅ CLOSED]** feat: Add error handling and user feedback to the flow
- **[#15 ✅ CLOSED]** test: Conduct manual end-to-end testing of the onboarding flow
- **[#16 ✅ CLOSED]** refactor: Refine user feedback and error messages

**Completed Features Summary:**
- ✅ Multi-wallet connection (MetaMask, WalletConnect, etc.) via Reown AppKit
- ✅ Multi-chain support (Mainnet, Polygon, Arbitrum, Base, BSC, Polygon Amoy)
- ✅ Firebase Authentication with wallet-based signature login
- ✅ Comprehensive error handling and user feedback systems
- ✅ Auth-based routing and session management
- ✅ Toast notifications and connection state tracking
- ✅ WalletConnect session management with automatic error recovery
- ✅ Development automation with Firebase emulators and ngrok integration
- ✅ Enhanced user feedback with context-aware error messages
- ✅ One-command development environment setup (pnpm dev)

---

## 🏗️ Smart Contracts (packages/contracts/)

### [#22 - Set up Hardhat development environment for contracts](https://github.com/rafamiziara/superpool/issues/22)
**Status**: 🔄 Open
**Scope**: Infrastructure setup for contract development
**Priority**: High (Prerequisite for all contract work)

### [#23 - Develop PoolFactory.sol smart contract](https://github.com/rafamiziara/superpool/issues/23)
**Status**: 🔄 Open
**Scope**: Core factory contract for pool creation
**Dependencies**: #22

### [#24 - Develop LendingPool.sol implementation contract](https://github.com/rafamiziara/superpool/issues/24)
**Status**: 🔄 Open
**Scope**: Upgradeable pool implementation template
**Dependencies**: #22

### [#25 - Create deployment scripts for Polygon Amoy](https://github.com/rafamiziara/superpool/issues/25)
**Status**: 🔄 Open
**Scope**: Automated deployment to testnet
**Dependencies**: #23, #24

### [#26 - Add contract verification automation](https://github.com/rafamiziara/superpool/issues/26)
**Status**: 🔄 Open
**Scope**: Polygonscan verification integration
**Dependencies**: #25

### [#27 - Transfer PoolFactory ownership to multi-sig Safe](https://github.com/rafamiziara/superpool/issues/27)
**Status**: 🔄 Open
**Scope**: Security handover to multi-sig governance
**Dependencies**: #25, #26

---

## ⚡ Backend (packages/backend/)

### [#28 - Create Cloud Function for pool creation via PoolFactory](https://github.com/rafamiziara/superpool/issues/28)
**Status**: 🔄 Open
**Scope**: API endpoint for pool creation requests
**Dependencies**: #23, #27

### [#29 - Add contract interaction service for Safe integration](https://github.com/rafamiziara/superpool/issues/29)
**Status**: 🔄 Open
**Scope**: Service layer for multi-sig transactions
**Dependencies**: #27

### [#30 - Set up event listeners for pool creation events](https://github.com/rafamiziara/superpool/issues/30)
**Status**: 🔄 Open
**Scope**: Blockchain event monitoring and Firestore sync
**Dependencies**: #23, #28

---

## 📱 Mobile App (apps/mobile/)

### [#31 - Design and implement pool creation UI](https://github.com/rafamiziara/superpool/issues/31)
**Status**: 🔄 Open
**Scope**: User interface for pool creation form
**Dependencies**: None (can start in parallel)

### [#32 - Integrate pool creation with backend API](https://github.com/rafamiziara/superpool/issues/32)
**Status**: 🔄 Open
**Scope**: Connect UI to backend services
**Dependencies**: #28, #31

### [#33 - Add form validation for pool parameters](https://github.com/rafamiziara/superpool/issues/33)
**Status**: 🔄 Open
**Scope**: Client/server-side validation
**Dependencies**: #31

---

## 📊 Progress Tracking

### Overall Sprint 1 Progress: 17/26 issues completed (65%)

**By Feature:**
- ✅ **User Onboarding & Wallet Connection**: 14/14 issues (100%) ✅ COMPLETED
- Infrastructure & Setup: 6/6 issues ✅
- Backend Authentication: 5/5 issues ✅
- Mobile App Integration: 5/5 issues ✅
- Quality Assurance: 3/3 issues ✅ COMPLETED
- 🔄 **Create a New Lending Pool**: 0/12 issues (0%)
- 🏗️ Smart Contracts: 0/6 issues (0%)
- ⚡ Backend: 0/3 issues (0%)
- 📱 Mobile App: 0/3 issues (0%)

### Critical Path
1. **#22** (Hardhat setup) → **#23, #24** (Contracts) → **#25** (Deployment) → **#27** (Safe transfer)
2. **#28** (Cloud Function) depends on completed contracts
3. **#31** (UI) can start immediately in parallel
4. **#32** (Integration) brings everything together

---

## 🎯 Sprint 1 Expected Deliverables

- [x] **User can successfully connect wallet and log in** ✅ COMPLETED
- Multi-wallet support (MetaMask, WalletConnect, etc.)
- Firebase authentication with signature verification
- Multi-chain support and proper session management
- [ ] **Pool creator can deploy new lending pool via dApp** 🔄 IN PROGRESS
- [ ] **PoolFactory contract verified on Polygonscan** ⏳ PENDING
- [ ] **PoolFactory ownership transferred to multi-sig Safe** ⏳ PENDING
- [ ] **End-to-end pool creation flow functional** ⏳ PENDING

---

## 📝 Notes

- All issues include comprehensive acceptance criteria and technical requirements
- Dependencies are clearly mapped to enable parallel work where possible
- Critical path focuses on smart contract foundation first
- Mobile UI work can start immediately while contracts are being developed
- Integration phase (#32) will bring all components together

**Last Updated**: 2025-08-17
54 changes: 54 additions & 0 deletions apps/mobile/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
module.exports = {
env: {
node: true,
es6: true,
},
extends: ['eslint:recommended'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
ignorePatterns: ['dist', 'node_modules', 'lib', '.expo', 'coverage'],
globals: {
__DEV__: 'readonly',
React: 'readonly',
NodeJS: 'readonly',
},
rules: {
'quotes': ['error', 'single'],
'indent': ['error', 2, { 'SwitchCase': 1 }],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error', { 'argsIgnorePattern': '^_', 'varsIgnorePattern': '^_' }],
'@typescript-eslint/no-explicit-any': 'warn',
},
overrides: [
{
// Jest configuration for test files and mocks
files: ['**/__tests__/**/*', '**/*.test.*', '**/*.spec.*', '**/__mocks__/**/*', '**/setupTests.*'],
env: {
jest: true,
node: true,
},
globals: {
jest: 'readonly',
},
},
{
// TypeScript files
files: ['**/*.ts', '**/*.tsx'],
rules: {
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': ['error', { 'argsIgnorePattern': '^_', 'varsIgnorePattern': '^_' }],
},
},
{
// Enum values are exported for external use
files: ['**/errorHandling.ts'],
rules: {
'@typescript-eslint/no-unused-vars': 'off',
},
},
],
};
40 changes: 40 additions & 0 deletions apps/mobile/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files

# dependencies
node_modules/

# Expo
.expo/
dist/
web-build/
expo-env.d.ts

# Native
.kotlin/
*.orig.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision

# Metro
.metro-health-check*

# debug
npm-debug.*
yarn-debug.*
yarn-error.*

# macOS
.DS_Store
*.pem

# local env files
.env*.local

# typescript
*.tsbuildinfo

# Test coverage reports
/coverage
10 changes: 10 additions & 0 deletions apps/mobile/__mocks__/asyncStorage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export default {
getItem: jest.fn(() => Promise.resolve(null)),
setItem: jest.fn(() => Promise.resolve()),
removeItem: jest.fn(() => Promise.resolve()),
clear: jest.fn(() => Promise.resolve()),
getAllKeys: jest.fn(() => Promise.resolve([])),
multiGet: jest.fn(() => Promise.resolve([])),
multiSet: jest.fn(() => Promise.resolve()),
multiRemove: jest.fn(() => Promise.resolve()),
};
4 changes: 4 additions & 0 deletions apps/mobile/__mocks__/expoApplication.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
getAndroidId: jest.fn(() => Promise.resolve('mock-android-id')),
getIosIdForVendorAsync: jest.fn(() => Promise.resolve('mock-ios-id')),
};
5 changes: 5 additions & 0 deletions apps/mobile/__mocks__/expoSecureStore.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
getItemAsync: jest.fn(() => Promise.resolve(null)),
setItemAsync: jest.fn(() => Promise.resolve()),
deleteItemAsync: jest.fn(() => Promise.resolve()),
};
Loading