Inspiration

Immigration in the U.S. is broken. There are 11+ million pending cases, asylum seekers wait an average of 1,283 days, and there's no right to a public defender in immigration court. The people who need help the most can't afford $300–500/hour attorneys and are left piecing together advice from Reddit threads, Facebook groups, and word of mouth.

The single most valuable resource for someone navigating the system is knowing what happened to people like them. That knowledge exists — locked in lawyer offices, court records, and people's heads. We wanted to unlock it.

What it does

Lumina is a community-powered immigration legal research platform. Immigrants who've been through the system share their anonymized case outcomes — what they filed, what happened, what they'd do differently. These cases are stored on Pinata's IPFS infrastructure so they can never be altered or deleted.

An AI assistant lets newcomers search in plain language: "I'm from Guatemala, I've been here 12 years, I just got a Notice to Appear — what are my options?" The AI finds similar cases, cites specific outcomes, and identifies potential legal strategies.

The platform is fully multilingual — users can switch to their preferred language and the entire interface, AI responses, and case content translate in real time. For users who struggle with reading or literacy, ElevenLabs text-to-speech reads AI responses aloud in natural-sounding voices across multiple languages, making legal research accessible to people who might not be comfortable reading dense legal information in a second language.

Contributors stake USDC through an on-chain escrow contract when they upload. The community votes to approve or flag — approved cases release the stake plus earnings, flagged cases get slashed. This creates accountability and self-policing quality control.

How we built it

  • Frontend: Next.js 16 with App Router and Tailwind CSS
  • Backend: Hono on Node.js handling auth, search, chat sessions, escrow tracking, trust voting, and credit accounting
  • Storage: Pinata SDK for Private IPFS — every case gets a tamper-proof CID, searchable metadata, and file vectors for semantic search
  • AI: Groq-hosted Llama 3.3 70B for sub-second legal research synthesis with case citations
  • Voice: ElevenLabs API for text-to-speech — AI responses can be read aloud in the user's language, removing literacy barriers for immigrants who may not read English fluently
  • Translation: Real-time multilingual support — the UI, AI responses, and case content adapt to the user's preferred language
  • Blockchain: Solidity escrow contract on Base Sepolia — USDC staking via stakeAndRegister(), community voting via vote(), auto-release after timeout
  • Auth: better-auth for accounts, wagmi/viem for wallet interactions
  • Database: PostgreSQL with Drizzle ORM for escrow records, trust votes, credits, and chat history

Challenges we ran into

  • Pinata SDK versioning: The SDK API didn't match documentation — we figured out correct method signatures through trial and error
  • Next.js + BigInt: Target config doesn't support 100000n literals, so we used BigInt(100000) everywhere for USDC amounts
  • Real testnet USDC: We committed to Circle's actual USDC on Base Sepolia instead of a mock token, which meant dealing with real faucet limitations but made the demo authentic
  • Z-index stacking: Our landing page candle animation overlays blocked navigation buttons — a subtle bug that only appeared when clicking logout

Accomplishments that we're proud of

  • End-to-end flow works: Upload → stake USDC on-chain → case goes to IPFS → plain-language search → AI cites the case → community votes → stake releases → contributor earns
  • Nothing is simulated: Cases are on Pinata's IPFS with real CIDs, stakes are actual USDC transactions on Base Sepolia with verifiable BaseScan receipts
  • Truly accessible: A Spanish-speaking immigrant can switch the language, ask a question in Spanish, get AI-synthesized legal research back in Spanish, and have ElevenLabs read it aloud — no English literacy required
  • 30 realistic seed cases across asylum, cancellation of removal, U-visa, VAWA, TPS, DACA, naturalization, H-1B, and more — including cases based on real BIA decisions
  • The AI responses are genuinely useful: Compassionate, well-cited legal research that always recommends consulting an attorney

What we learned

  • Content-addressed storage solves a real problem for vulnerable populations whose documents get questioned — a CID that proves a file hasn't been altered is genuinely powerful
  • Incentive design matters: staking + voting solves both "why would anyone share?" and "how do we prevent garbage?" simultaneously
  • Accessibility isn't optional when your users are immigrants — multilingual support and text-to-speech aren't nice-to-haves, they're core features
  • Immigration law is incredibly complex — building the case taxonomy alone gave us a deeper appreciation for what immigrants face
  • Groq's inference speed on a 70B model makes conversational legal research feel natural rather than like a "submit and wait" form

What's next for Lumina

  • Expanded language coverage: Add more languages and regional dialects to reach immigrants from every background
  • Attorney network: The lawyer referral system exists, next step is onboarding immigration attorneys who can verify cases for additional trust
  • Mainnet deployment: Move the escrow contract from Base Sepolia to Base mainnet with real USDC
  • Case trend analytics: Aggregate outcome data to show approval rates by case type, country, court, and year
  • Mobile app: Many immigrants access the internet primarily through phones — a mobile-first experience would dramatically increase accessibility

Built With

Share this project:

Updates