Skip to content

WaterEnterprises/WaterParty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

WaterParty πŸŒŠπŸŽ‰

A cross-platform party-matching app that lets users swipe to discover nearby parties, host their own events, and chat in real-time. Built with React, Bun, Tailwind CSS v4, and Capacitor for native iOS/Android deployment.


πŸ“± Platforms

Platform Distribution
Web waterparty-react-14hr.onrender.com
Android Signed APK + AAB via GitHub Actions CI
iOS Simulator builds via GitHub Actions (device builds require Apple Developer account)

✨ Features

  • Tinder-Style Swiping β€” Discover parties near you with interactive card swiping
  • Rich Profiles β€” Photos, bio, work/education, social links, and trust scores
  • Party Hosting β€” Create events with geo-location, photos, vibe tags, and crowdfunding
  • Real-Time Chat β€” WebSocket-powered party chats and direct messages
  • Photo Editing β€” Built-in crop tool with 9:16 aspect ratio for profile photos
  • Crowdfunding β€” Stripe-powered contributions with 6% platform fee
  • Dark Theme β€” Premium dark UI with cyan/magenta/purple accents

πŸ›  Stack

Layer Technology
Runtime Bun (runtime + package manager + bundler)
Frontend React 19, TypeScript, Tailwind CSS v4
Routing React Router v7
Animation Motion (framer-motion)
Mobile Capacitor (iOS + Android)
Backend Hono (Bun-native web framework), TypeScript
Database Turso (libSQL) β€” edge-hosted SQLite
Auth Session-based (httpOnly cookies + x-session-token header)
WebSocket Hono/Bun WebSocket (createBunWebSocket)
Payments Stripe (payment intents + Connect)
Image Processing sharp (server-side), Canvas API (client-side)
CI/CD GitHub Actions

πŸš€ Getting Started

Prerequisites

  • Bun v1.2+ (install via curl -fsSL https://bun.sh/install | bash)
  • Android Studio (for Android builds)
  • Xcode (for iOS builds, macOS only)

Installation

git clone <your-repo-url>
cd WaterParty-React
bun install

Environment

Copy .env.example to .env and configure:

TURSO_DATABASE_URL=libsql://your-db.turso.io
TURSO_AUTH_TOKEN=your-turso-token
STRIPE_SECRET_KEY=sk_...
STRIPE_PUBLISHABLE_KEY=pk_...
PORT=3000

Development

# Local dev server with hot-reload (http://localhost:3000)
bun run dev:server

# Build web + deploy to Android device via ADB
bun run dev:device

πŸ— Project Structure

WaterParty-React/
β”œβ”€β”€ .github/workflows/   # CI/CD pipelines
β”œβ”€β”€ android/             # Android native project
β”œβ”€β”€ ios/                 # iOS native project
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/      # Reusable UI components
β”‚   β”œβ”€β”€ pages/           # Page-level components
β”‚   β”œβ”€β”€ hooks/           # Custom React hooks
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ Store.tsx    # Global state (React Context + useReducer)
β”‚   β”‚   β”œβ”€β”€ types.ts     # TypeScript interfaces
β”‚   β”‚   β”œβ”€β”€ constants.ts # API URLs, session management
β”‚   β”‚   └── utils.ts     # Helpers (image compression, uploads)
β”‚   β”œβ”€β”€ App.tsx          # Root component with routing
β”‚   β”œβ”€β”€ main.tsx         # Entry point
β”‚   └── index.css        # Global styles + Tailwind
β”œβ”€β”€ scripts/
β”‚   └── run-android-dev.sh  # Android dev deployment script
β”œβ”€β”€ server/
β”‚   β”œβ”€β”€ index.ts         # Hono backend + Bun WebSocket server
β”‚   β”œβ”€β”€ config.ts        # Environment config
β”‚   β”œβ”€β”€ db.ts            # Turso/libSQL database client + migrations
β”‚   β”œβ”€β”€ stripe-init.ts   # Stripe initialization
β”‚   β”œβ”€β”€ telegram.ts      # Telegram bot notifications
β”‚   β”œβ”€β”€ routes/          # API route handlers (Hono context pattern)
β”‚   β”œβ”€β”€ middleware/       # Hono middleware (session, rate-limiter)
β”‚   β”œβ”€β”€ ws/              # WebSocket handler (hono/bun WebSocket)
β”‚   └── scheduler/       # Background jobs (payouts)
β”œβ”€β”€ capacitor.config.ts  # Capacitor configuration
β”œβ”€β”€ bun.lock             # Bun lockfile
β”œβ”€β”€ package.json
└── README.md

πŸ“¦ Build Pipeline

Everything is run through Bun β€” no npm, no Node.js required (except for Gradle/Xcode native builds).

Command What it does
bun run dev:server Local dev server with --hot auto-reload on http://localhost:3000
bun run dev:device Build web β†’ sync Capacitor β†’ deploy to Android device via ADB
bun run build:capacitor CSS + Web bundle + Static copy (for mobile apps, no server)
bun run build:render Full production build: CSS β†’ Web β†’ Assets β†’ Server bundle
bun run build Alias for build:render (used by CI and Render)
bun run start Starts the production server (bun run dist/server.cjs)
bun run clean Removes dist/
bun run lint TypeScript type-check (tsc --noEmit)

πŸ€– CI/CD Pipeline

The GitHub Actions workflow (.github/workflows/ci.yml) runs on every push to main:

Job Output
web-build Production web assets (dist/)
android-build Unsigned debug APK
android-release Signed release APK + AAB (requires keystore secrets)
ios-build iOS simulator .app bundle
release GitHub Release with all artifacts

All CI jobs use oven-sh/setup-bun@v2 β€” no Node.js setup needed.

Android Release Signing

To produce signed release builds, add these secrets to your GitHub repo:

Secret Description
KEYSTORE_BASE64 Base64-encoded keystore file
KEYSTORE_PASSWORD Keystore password
KEY_ALIAS Key alias (e.g. waterparty)
KEY_PASSWORD Key password

πŸ“„ Key API Endpoints

Method Endpoint Description
POST /login User login (rate-limited)
POST /register User registration (rate-limited)
GET /api/feed Party feed (requires session)
GET /api/chats User's chat rooms
POST /api/chats/dm Create or find DM chat
GET /api/users/:id User profile
GET /api/party/:id Party details
POST /api/upload Image upload (multipart)
GET /api/media/:id Serve stored media
POST /api/reports Report a user
POST /api/create-payment-intent Stripe payment intent
POST /api/crowdfund/contribute Record contribution
POST /api/connect/onboarding Stripe Connect onboarding
GET /api/connect/status Stripe Connect status
POST /api/connect/withdraw Withdraw fundraiser balance
POST /api/logout Logout

WebSocket at /ws β€” events: GET_FEED, GET_CHATS, SWIPE, SEND_MESSAGE, CREATE_PARTY, UPDATE_PROFILE, etc.


πŸ”‘ Session & Auth

  • Sessions use httpOnly cookies + a x-session-token header fallback
  • Session token is also stored in localStorage for WebSocket connections
  • Sessions expire after 7 days of inactivity
  • Rate limiting: 20 auth attempts per 15 minutes

πŸ“Έ Image Processing

  • Client-side: Canvas API compresses and center-crops profile photos to 9:16
  • Server-side: sharp validates and crops uploaded images to 9:16, stores in Turso as BLOBs
  • Images served via /api/media/:id with 1-year cache headers

πŸ“ License

Apache 2.0