Skip to content

BalkyBoy/Finapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Owopor

A comprehensive financial investment platform enabling users to invest in various packages, manage multiple wallets, and track investment returns with seamless onboarding, KYC verification, and multi-provider authentication.


Table of Contents

  1. Overview
  2. Features
  3. Tech Stack
  4. Prerequisites
  5. Installation
  6. Configuration
  7. Project Structure
  8. Usage
  9. Backend API
  10. Running Tests & Linting
  11. Deployment
  12. Contributing
  13. License

Overview

Owopor is a full-stack investment platform that combines a mobile-first React Native frontend with a robust Go backend. The platform handles the complete user journey from authentication through KYC verification to investment management, with built-in support for risk assessment, multi-wallet systems, and real-time investment tracking.

Core Functionality

  • User Management & Authentication β€” Multi-provider OAuth, JWT-based auth, OTP verification
  • KYC Verification β€” Document capture, submission, and verification workflows
  • Investment Management β€” Package selection, portfolio tracking, returns calculation
  • Wallet System β€” Multi-wallet support (main, investment, savings) with balance tracking
  • Bank Account Linking β€” Secure bank account linking with verification
  • Risk Assessment β€” User profiling questionnaire for investment recommendations
  • Notifications β€” Push notifications, email, and SMS alerts for user updates

Features

  • βœ… Multi-Platform Support β€” iOS, Android, and Web via React Native & Expo
  • βœ… Secure Authentication β€” JWT tokens, OAuth2 (Google & GitHub), session management
  • βœ… KYC Workflow β€” Document capture via device camera with verification pipeline
  • βœ… Bank Integration β€” Account linking with OTP verification
  • βœ… Investment Packages β€” Tiered investment options with transparent returns tracking
  • βœ… Multi-Wallet Architecture β€” Segregated wallets with inter-wallet transfers
  • βœ… Risk Assessment β€” Questionnaire-based user profiling and recommendations
  • βœ… Responsive UI β€” Native mobile experience with adaptive layouts
  • βœ… Real-time Updates β€” Live balance and investment return tracking
  • βœ… Code Quality β€” ESLint for frontend, TypeScript strict mode, Prettier formatting

Tech Stack

Frontend

Layer Technology
Framework React Native 19.1.1 with Expo 54.0.27
Routing Expo Router 6.0.17 with file-based routing
Language TypeScript 5.9
State Management React Hook Form 7.67.0, AsyncStorage
Authentication Firebase Auth, Expo Auth Session
Navigation React Navigation 7.1.6 + Bottom Tabs
UI Components Expo Vector Icons, Expo Blur, Expo Linear Gradient
Media Expo Camera, Expo Image
Code Quality ESLint, Prettier, Husky, Commitlint

Backend

Layer Technology
Language Go 1.25.4
Server net/http (standard library)
Database PostgreSQL with pgx/v5 driver
Authentication JWT (golang-jwt), OAuth2, Session cookies
Security golang.org/x/crypto, gorilla/sessions
API RESTful HTTP endpoints

Infrastructure

  • Firebase β€” User authentication, storage, messaging
  • PostgreSQL β€” Primary data store
  • OAuth Providers β€” Google, GitHub

Prerequisites

System Requirements

  • macOS/Linux/Windows with Bash or PowerShell terminal
  • Node.js 18+ and npm/yarn
  • Go 1.25.4 or later
  • PostgreSQL 13+ (local or cloud instance)
  • Git 2.0+

Additional Tools

For mobile development:

  • Xcode (macOS only, for iOS development)
  • Android Studio (for Android development)
  • Expo CLI (optional; npm install -g expo-cli)

Installation and Setup

1. Clone the Repository

git clone https://github.com/BalkyBoy/Owopor.git
cd Owopor

2. Setup Frontend (Client)

cd client
npm install
# or
yarn install

3. Setup Backend (Server)

cd ../server
go mod download
go mod tidy

4. Configure Database

Create a PostgreSQL database and update the connection string:

psql -U postgres
CREATE DATABASE owopor;

Configuration

Frontend Environment

Create a .env.local file in the client/ directory with Firebase configuration (already included in firebaseConfig.js):

// client/firebaseConfig.js
const firebaseConfig = {
  apiKey: "YOUR_API_KEY",
  authDomain: "YOUR_AUTH_DOMAIN",
  projectId: "YOUR_PROJECT_ID",
  storageBucket: "YOUR_STORAGE_BUCKET",
  messagingSenderId: "YOUR_MESSAGING_ID",
  appId: "YOUR_APP_ID",
};

Backend Configuration

Set environment variables before running the server:

export DATABASE_URL="postgres://user:password@localhost:5432/owopor"
export JWT_SECRET="your-jwt-secret-key-change-in-production"
export REFRESH_SECRET="your-refresh-secret-key-change-in-production"
export SESSION_KEY="your-session-key-change-in-production"
export GOOGLE_CLIENT_ID="your-google-oauth-client-id"
export GOOGLE_CLIENT_SECRET="your-google-oauth-client-secret"
export GITHUB_CLIENT_ID="your-github-oauth-client-id"
export GITHUB_CLIENT_SECRET="your-github-oauth-client-secret"

Alternatively, update hardcoded values in server/internal/config/config.go and server/internal/auth/models.go.

OAuth Setup

Google OAuth

  1. Go to Google Cloud Console
  2. Create a new project
  3. Enable Google+ API
  4. Create OAuth 2.0 credentials (Web application)
  5. Add redirect URI: http://localhost:8080/auth/google/callback
  6. Copy Client ID and Secret to environment variables

GitHub OAuth

  1. Go to GitHub Settings β†’ Developer settings β†’ OAuth Apps
  2. Create a new OAuth App
  3. Set Authorization callback URL: http://localhost:8080/auth/github/callback
  4. Copy Client ID and Secret to environment variables

Project Structure

Owopor/
β”œβ”€β”€ client/                         # React Native Expo frontend
β”‚   β”œβ”€β”€ app/                        # Expo Router application root (file-based routing)
β”‚   β”‚   β”œβ”€β”€ _layout.tsx            # Root layout with theme & font initialization
β”‚   β”‚   β”œβ”€β”€ index.tsx              # Landing/home screen
β”‚   β”‚   β”œβ”€β”€ (auth)/                # Authentication flow screens
β”‚   β”‚   β”‚   β”œβ”€β”€ _layout.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ login.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ sign-up.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ otp.tsx
β”‚   β”‚   β”‚   └── verification.tsx
β”‚   β”‚   β”œβ”€β”€ (onboarding)/          # Onboarding flow
β”‚   β”‚   β”‚   β”œβ”€β”€ _layout.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ onboarding.tsx     # Intro screen
β”‚   β”‚   β”‚   β”œβ”€β”€ onboarding1.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ onboarding2.tsx
β”‚   β”‚   β”‚   └── onboarding3.tsx
β”‚   β”‚   β”œβ”€β”€ (kyc)/                 # KYC verification flow
β”‚   β”‚   β”‚   β”œβ”€β”€ Capture.tsx        # Document capture via camera
β”‚   β”‚   β”‚   β”œβ”€β”€ Flow.tsx           # KYC workflow orchestrator
β”‚   β”‚   β”‚   β”œβ”€β”€ Success.tsx        # Verification success screen
β”‚   β”‚   β”‚   └── Verify.tsx         # Document verification
β”‚   β”‚   β”œβ”€β”€ (bank)/                # Bank account linking
β”‚   β”‚   β”‚   β”œβ”€β”€ acount.tsx         # Account details
β”‚   β”‚   β”‚   β”œβ”€β”€ card.tsx           # Card linking
β”‚   β”‚   β”‚   β”œβ”€β”€ link.tsx           # Linking workflow
β”‚   β”‚   β”‚   └── OTPVerificationScreen.tsx
β”‚   β”‚   β”œβ”€β”€ (assesment)/           # Risk assessment questionnaire
β”‚   β”‚   β”‚   β”œβ”€β”€ stepThree.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ stepFour.tsx
β”‚   β”‚   β”‚   └── components/
β”‚   β”‚   β”œβ”€β”€ (profile)/             # User profile management
β”‚   β”‚   β”‚   β”œβ”€β”€ profilePhoto.tsx
β”‚   β”‚   β”‚   └── Upload.tsx
β”‚   β”‚   β”œβ”€β”€ (tabs)/                # Main app tab-based navigation
β”‚   β”‚   β”‚   β”œβ”€β”€ _layout.tsx        # BottomTabNavigator
β”‚   β”‚   β”‚   β”œβ”€β”€ Dashboard.tsx      # Main dashboard/home
β”‚   β”‚   β”‚   β”œβ”€β”€ Assets.tsx         # Investment assets & holdings
β”‚   β”‚   β”‚   β”œβ”€β”€ Wallets.tsx        # Multi-wallet view
β”‚   β”‚   β”‚   └── Profile.tsx        # User profile tab
β”‚   β”‚   β”œβ”€β”€ (screens)/             # Additional screens
β”‚   β”‚   β”‚   β”œβ”€β”€ Menu.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Notifications.tsx
β”‚   β”‚   β”‚   └── Packages.tsx       # Investment packages
β”‚   β”‚   └── (terms)/               # Terms & conditions
β”‚   β”‚       β”œβ”€β”€ _layout.tsx
β”‚   β”‚       └── terms.tsx
β”‚   β”œβ”€β”€ components/                # Reusable React components
β”‚   β”‚   β”œβ”€β”€ AmountInput.tsx
β”‚   β”‚   β”œβ”€β”€ Checkbox.tsx
β”‚   β”‚   β”œβ”€β”€ Line.tsx
β”‚   β”‚   β”œβ”€β”€ ProgressBar.tsx
β”‚   β”‚   β”œβ”€β”€ QuestionHeader.tsx
β”‚   β”‚   └── ... (other shared components)
β”‚   β”œβ”€β”€ assets/
β”‚   β”‚   β”œβ”€β”€ fonts/                 # Custom fonts (ReadexPro)
β”‚   β”‚   └── images/                # App icons, splash screens, adaptive icons
β”‚   β”œβ”€β”€ firebaseConfig.js          # Firebase initialization
β”‚   β”œβ”€β”€ package.json               # Frontend dependencies
β”‚   β”œβ”€β”€ tsconfig.json              # TypeScript configuration
β”‚   β”œβ”€β”€ eslint.config.js           # ESLint configuration
β”‚   β”œβ”€β”€ prettier.config.js         # Code formatting rules
β”‚   β”œβ”€β”€ app.json                   # Expo app configuration
β”‚   β”œβ”€β”€ eas.json                   # EAS (Expo Application Services) build config
β”‚   └── commitlint.config.js       # Commit message linting
β”‚
β”œβ”€β”€ server/                        # Go backend server
β”‚   β”œβ”€β”€ cmd/
β”‚   β”‚   └── main.go               # Server entry point, route definitions
β”‚   β”œβ”€β”€ internal/
β”‚   β”‚   β”œβ”€β”€ auth/                 # Authentication handlers & middleware
β”‚   β”‚   β”‚   β”œβ”€β”€ handler_jwt.go    # JWT login, registration, refresh
β”‚   β”‚   β”‚   β”œβ”€β”€ handler_oauth.go  # OAuth2 handlers (Google, GitHub)
β”‚   β”‚   β”‚   β”œβ”€β”€ handler_session.go # Session-based auth
β”‚   β”‚   β”‚   β”œβ”€β”€ middleware.go     # JWT verification middleware
β”‚   β”‚   β”‚   β”œβ”€β”€ models.go         # Auth data models
β”‚   β”‚   β”‚   β”œβ”€β”€ store.go          # User storage/database logic
β”‚   β”‚   β”‚   └── utils.go          # Auth utilities (token generation, validation)
β”‚   β”‚   β”œβ”€β”€ config/               # Configuration & constants
β”‚   β”‚   β”‚   └── config.go         # OAuth credentials, JWT secrets
β”‚   β”‚   └── database/             # Database connection
β”‚   β”‚       └── postgres.go       # PostgreSQL pool management
β”‚   β”œβ”€β”€ go.mod                    # Go module definition
β”‚   └── go.sum                    # Go dependency checksums
β”‚
β”œβ”€β”€ BACKEND_ARCHITECTURE.md       # Detailed backend architecture documentation
└── README.md                      # This file

Usage

Running the Frontend

From the client/ directory:

# Start the Expo development server (opens menu for platform selection)
npm start

# Run on iOS (macOS only)
npm run ios

# Run on Android
npm run android

# Run on Web
npm run web

Development Server:

  • Press i for iOS simulator
  • Press a for Android emulator
  • Press w for web browser
  • Scan QR code with Expo Go app on physical device

Running the Backend

From the server/ directory:

# Run the server
go run ./cmd/main.go

The server will start on http://localhost:8080

πŸš€ Complete Auth System running on :8080

Running Code Quality Tools

From the client/ directory:

# Lint the code
npm run lint

# Auto-fix linting issues
npm run lint -- --fix

# Format code with Prettier
npm run format

# Prepare Git hooks (pre-commit linting)
npm run prepare

Backend API

Authentication Endpoints

Method Endpoint Description Body
POST /auth/register Register new user { email, password, name }
POST /login JWT login { email, password }
POST /refresh Refresh JWT token { refresh_token }
POST /forgot-password Initiate password reset { email }
POST /reset-password Complete password reset { token, new_password }
GET /protected Verify JWT (middleware test) Headers: Authorization: Bearer <token>
GET /me Get current user info Headers: Authorization: Bearer <token>

Session-Based Auth Endpoints

Method Endpoint Description
POST /session/login Login with session cookie
POST /session/logout Logout and clear session
GET /session/protected Protected endpoint (session required)

OAuth Endpoints

Method Endpoint Description
GET /auth/google Initiate Google OAuth flow
GET /auth/google/callback Google OAuth redirect URI
GET /auth/github Initiate GitHub OAuth flow
GET /auth/github/callback GitHub OAuth redirect URI

Authentication

JWT Bearer Token:

curl -H "Authorization: Bearer <your-jwt-token>" http://localhost:8080/protected

Request Example:

curl -X POST http://localhost:8080/auth/register \
  -H "Content-Type: application/json" \
  -d '{"email":"user@example.com","password":"secure123","name":"John Doe"}'

Running Tests & Linting

Frontend

# Run ESLint
npm run lint

# Format code
npm run format

# Check TypeScript types
npx tsc --noEmit

Backend

cd ../server

# Run tests (if test suite exists)
go test ./...

# Run with verbose output
go test -v ./...

# Format code
go fmt ./...

# Lint with golangci-lint (if installed)
golangci-lint run ./...

# Check for security vulnerabilities
go list -json ./... | nancy sleuth

Deployment

Frontend Deployment

EAS CLI (Recommended for Expo)

npm install -g eas-cli

# Log in to Expo
eas login

# Build for iOS
eas build --platform ios

# Build for Android
eas build --platform android

# Submit to app stores
eas submit --platform ios
eas submit --platform android

Manual Build

# Create a web build
npm run web

# Deploy the `web-build/` directory to hosting (Vercel, Netlify, etc.)

Backend Deployment

Docker (Recommended)

Create a Dockerfile in the server/ directory:

FROM golang:1.25

WORKDIR /app

COPY go.mod go.sum ./
RUN go mod download

COPY . .

RUN go build -o server ./cmd/main.go

EXPOSE 8080

CMD ["./server"]

Build and run:

docker build -t owopor-server .
docker run -e DATABASE_URL="..." -p 8080:8080 owopor-server

Heroku / Railway / Cloud Run

# Heroku example
git push heroku main

# Set environment variables
heroku config:set DATABASE_URL="postgres://..."
heroku config:set JWT_SECRET="your-secret"

Environment Variables for Production

Always set these in your hosting platform:

  • DATABASE_URL β€” PostgreSQL connection string
  • JWT_SECRET β€” Strong random string (use openssl rand -hex 32)
  • REFRESH_SECRET β€” Refresh token secret
  • SESSION_KEY β€” Session encryption key
  • GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET
  • GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit with conventional commits: git commit -m "feat: add amazing feature"
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

Code Standards

  • Frontend: Use TypeScript strict mode, ESLint, Prettier
  • Backend: Format with go fmt, pass go vet, use meaningful naming
  • Commits: Follow Conventional Commits

Setup Pre-Commit Hooks

cd client
npm run prepare
# This installs Husky & Commitlint to enforce commit standards

License

This project is proprietary. All rights reserved.


Support & Documentation

For detailed backend architecture, see BACKEND_ARCHITECTURE.md.

For issues, feature requests, or questions, please open an issue on GitHub.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages