Skip to content

LucasEdwa/Homewithin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

120 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HomeWithin

A safe space for LGBTQ+ people in Sweden — when home isn't always safe.


The Problem We're Solving

For many LGBTQ+ people, the most dangerous place in their life is where they live.

In Sweden — one of the world's most progressive countries — 1 in 3 LGBTQ+ youth still report experiencing violence or threats at home. Conversion pressure, surveillance by family members, housing instability, and social isolation are daily realities. The resources exist. The crisis lines exist. But finding them when you're scared, in a hurry, or being monitored by someone else's phone is a different challenge entirely.

HomeWithin is the first mobile app built exclusively to meet that challenge — a private, clinically-informed, always-available support companion for LGBTQ+ people in Sweden.


Why This Matters

The statistics are not abstract:

  • LGBTQ+ youth are 4× more likely to attempt suicide than their peers
  • 40% of homeless youth in Sweden identify as LGBTQ+
  • Conversion therapy — banned in many countries — still occurs informally in Swedish homes and religious communities
  • Young people who are outed without consent face acute safety risks within 24–72 hours
  • Mental health waiting lists in Sweden average 6–12 months for public services

HomeWithin does not replace professional care. It bridges the gap between crisis and care — available at 2am, requires no appointment, no real name, and no one else's permission.


What HomeWithin Does

Privacy Before Everything

The first thing HomeWithin does is protect you.

  • No real name required — users choose a nickname (River, Sage, Alex — anything they like)
  • Hide from search — your profile is invisible by default; no one can find you unless you reach out first
  • Disguise Mode — one tap transforms the app into a convincing Weather app, Calculator, or Notes list. If someone looks over your shoulder or picks up your phone, they see nothing suspicious
  • PIN lock — a personal PIN keeps the app locked when not in use
  • Decoy screen — even if the app is opened by someone else, the decoy interface shows before any personal content

No other LGBTQ+ support app prioritizes physical device safety to this degree.


Safety Check-In — Know Where You Stand

HomeWithin includes a 6-step clinical safety assessment designed specifically for LGBTQ+ risk factors. It takes under 5 minutes and runs entirely on-device — nothing is sent anywhere.

Step 1 — Right now: A mood slider (1–10) and a direct question about immediate danger.

Step 2 — Home & body: Physical harm, emotional control, and housing stability.

Step 3 — Identity & pressure: Conversion therapy pressure, being outed without consent, and phone surveillance.

Step 4 — School & community: Bullying, community hostility, anxiety in public spaces.

Step 5 — Your mind: Thoughts of self-harm or hopelessness — handled with maximum care and an immediate crisis interrupt.

Step 6 — Your resources: Protective factors: trusted contacts, safe places, basic needs.

The algorithm weighs risk and protective factors using a clinically-informed scoring model. The result is one of three outcomes:

  • 🟢 Green — You seem to be in a safe place.
  • 🟡 Yellow — Some things are weighing on you. Quick links to peer support, the AI companion, and resources.
  • 🔴 Red — Immediate support. Local help centers near you appear automatically, with one-tap calling.

A crisis interrupt fires immediately when a user indicates self-harm thoughts or immediate danger — before the assessment even completes. It surfaces phone numbers without requiring any navigation.

Safety plans are written inside the app — first contact, safe place, something you need to hear, one small action — and stored only on the device, encrypted.


Local Resources — All 21 Swedish Counties

HomeWithin includes a complete, curated directory of LGBTQ+ support organizations across all 21 Swedish counties (län).

Every county shows local RFSL chapters alongside national resources always available regardless of location:

Organization Type Contact
Mind – Självmordslinjen Crisis support 90101
BRIS – Barnens Rätt i Samhället Youth support 116 111
RFSL – Riksförbundet för HBTQ+ LGBTQ+ center rfsl.se
FPES – Riksförbundet för transpersoner Trans support fpes.se
Diskrimineringsombudsmannen (DO) Legal aid do.se
UMO – Ungdomsmottagningen online Youth health umo.se

Resources are filterable by type: LGBTQ+ Centers · Shelters · Therapists · Legal Aid · Support Groups

The location button uses GPS (if permitted) to automatically detect your county and surface the closest resources first. No account needed. Nothing is sent anywhere.


AI Companion — Someone Who Knows You

HomeWithin's AI companion is not a generic chatbot. It reads your history.

Before every conversation, the AI receives a compact summary of:

  • Your last 20 journal entries — themes, emotions, and key moments
  • Your mood history — the last 30 check-ins with dates and scores
  • Your profile — pronouns, age range, language, what matters to how you're addressed

When you write "I've been feeling like I'm disappearing lately," the AI can gently notice that the same theme appeared in your journal two weeks ago and your mood has been declining since. It does not just respond to the message — it responds to you.

The companion is session-aware, rate-limited, and designed to hold space rather than give advice. It is a 2am voice that does not judge, does not get tired, and never tells you to just stay positive.


Journal & Mood Tracking — Witness Your Own Journey

A daily practice built for LGBTQ+ emotional complexity.

  • Check-ins — a mood score (1–10) with emotional tags: hopeful, anxious, numb, proud, angry, safe, unseen, loved, and more
  • Journal entries — free-form writing with tag support, private and stored on-device
  • Mood trends — the home dashboard shows your pattern over time; the AI companion reads it

Writing about your experience is one of the most evidence-backed interventions for emotional regulation. HomeWithin makes it available in 30 seconds, any time.


Chosen Family — Build the Network That Holds You

Biological family is a lottery. Chosen family is a decision.

HomeWithin's Chosen Family screen lets you build your personal support network with real care for how LGBTQ+ support actually works:

  • Roles — Trusted Friend, Mentor, Peer Support, Emergency Contact, Community Group, and more
  • Link to matched users — people you've connected with through peer matching can be added directly to your chosen family
  • Link to support circles — community groups you've joined appear as a picker; tapping opens the circle chat directly
  • Contact options — call, SMS, or in-app chat depending on how the person is connected to you

This is not a contacts list. It is an intentional support architecture — a visual, living record of who has you.


Peer Matching — Find People Who Get It

Sometimes you need to talk to someone who has been through something similar.

HomeWithin connects you with other LGBTQ+ users based on shared needs, intentions, and experience. All matching is:

  • Anonymous by default — no real names until both people choose to share more
  • Opt-in — you control whether you're visible to matching at all
  • Need-aware — users express what they're looking for: someone to listen, shared experience, peer who has navigated coming out at home, and so on

Accepted matches become chat relationships inside the app and can be added directly to your Chosen Family.


Content Safety & Messaging Controls

HomeWithin applies multiple layers of protection inside every conversation — both 1-on-1 matches and group circles.

Automatic content filter

Every message passes through a two-tier client-side filter before it is sent:

Tier Content Outcome
Hard block Hate speech, slurs, direct threats, illegal material Message is rejected — cannot be sent
Soft warning Strong language / profanity A prompt asks you to edit or confirm before sending

The filter runs entirely on-device before anything touches the server.

Delete your own messages

Long-pressing any message you sent shows a delete confirmation. The message is removed from the database and disappears immediately on both sides.

Report a user

  • From the Connect screen — a flag button on every browse card lets you report a profile before you match
  • Inside a 1-on-1 chat — the options menu includes "Report a message"
  • Inside a circle — long-pressing another user's message shows a report prompt

Reports are reviewed within 24 hours. The reported user is never told who filed the report.

Block a user

Blocking is available from within any 1-on-1 chat. A blocked user can no longer contact you or appear in your match results.

Auto-delete messages

The timer button in every chat lets you choose an auto-delete window:

Setting Behaviour
Off Messages are kept indefinitely
1 hour All messages — including existing ones — expire in 1 hour
6 hours All messages expire in 6 hours
24 hours All messages expire in 24 hours
7 days All messages expire in 7 days

Changing the timer applies retroactively. When you switch to "1 hour", all messages currently in the chat are updated to expire within that window — not just future ones. Your own messages are updated in the database (RLS-enforced); all messages are removed from local state immediately so the chat clears without waiting for a reload.

This means auto-delete can be used as a one-tap "clean chat" — selecting any timer clears the conversation history on your device right away.


Support Circles — Community Without Exposure

Support circles are small, themed group spaces inside HomeWithin.

You browse and join circles that match your experience — coming out, family rejection, trans support, healing from trauma, identity exploration. Once inside:

  • Chat in the circle's shared space
  • Attend workshops organized around the circle's theme
  • Connect with individual members if both people agree

Circles are moderated and do not expose your identity to the group until you choose to engage.


Programs & Growth Tracks

Structured programs for people who want a guided path rather than open-ended tools.

Multi-week tracks include:

  • Coming Out with Confidence
  • Healing from Family Rejection
  • Building Your Chosen Family
  • Mindfulness for LGBTQ+ Wellbeing
  • Trans+ Peer Café
  • Queer Grief & Loss Circle

Each program combines reading, reflection prompts, check-ins, and connection opportunities. Progress is tracked privately.


Resources & Articles

A curated library of LGBTQ+-specific educational and emotional content:

  • Articles on identity, coming out, relationships, and mental health
  • Guides for navigating Swedish systems — healthcare, legal name change, housing rights
  • Bookmarkable for offline reading

Events & Workshops

A live event feed showing:

  • Online workshops hosted by the HomeWithin community (weekly and monthly)
  • Local meetups by county — Stockholm Pride, Göteborg Pride, Malmö Pride, RFSL open events, and community cafés
  • RSVP for upcoming events with calendar reminders

Emergency Screen

A dedicated emergency screen — accessible from anywhere in the app in a single tap — that surfaces:

  • Critical crisis lines with one-tap calling (Mind 90101, BRIS 116 111)
  • Your nearest RFSL chapter based on GPS county detection
  • Step-by-step guidance on what to do if you are in immediate danger

Designed to be usable in 5 seconds by someone who is frightened and thinking slowly.


Progress & Intentions

A personal dashboard showing:

  • Streak tracking for daily check-ins and journaling
  • Mood trends over 7, 30, and 90 days
  • Milestones: first week, first month, first year
  • Personal intentions — short statements of what you're working toward — shown on the home screen as a daily reminder

Who This Is For

HomeWithin is built for any LGBTQ+ person in Sweden who needs support, but the design is particularly intentional for:

  • Young people (13–25) still living at home, navigating family dynamics and school
  • People in rural counties far from the nearest RFSL chapter or queer community
  • People under surveillance — a family member checking their phone, a partner monitoring messages
  • People in crisis who need help right now, not in six months
  • People rebuilding after rejection, estrangement, or a difficult coming-out

Technology & Privacy

Layer Technology Privacy impact
Mobile app React Native / Expo (iOS + Android) Runs natively, no browser history
Auth & data Supabase — EU-hosted, end-to-end encrypted GDPR-compliant by architecture
Local data Expo SecureStore Journal, safety plan, mood — encrypted on-device only
AI Session-based, no persistent server storage No conversation history saved after session ends
Tracking None Zero advertising SDKs, zero third-party data sharing

HomeWithin collects no advertising data, uses no tracking SDKs, and shares nothing with third parties.


The Vision

HomeWithin is not just an app. It is an infrastructure project for LGBTQ+ safety in Sweden.

The goal is a world where every LGBTQ+ person — no matter which of the 21 Swedish counties they live in, no matter how isolated or how surveilled — has access to:

  1. Someone to talk to, right now
  2. The resources closest to them
  3. A community that knows what it means to build a life on your own terms
  4. The privacy to do all of that safely

Home is not a place you're born into. It's something you build.

HomeWithin helps you build it.


For Developers

Prerequisites

  • Node.js 18+
  • Expo CLI (npm install -g expo)
  • iOS Simulator (Xcode) or Android Emulator, or the Expo Go app on a physical device
  • A Supabase project (see supabase/ for schema migrations and edge functions)

Quick start

git clone https://github.com/LucasEdwa/Homewithin.git
cd Homewithin
npm install
npx expo start

Copy .env.example to .env.local and fill in your Supabase URL and anon key before starting.

Architecture

HomeWithin follows a Layered Architecture across four layers:

Layer Folder Responsibility
View app/ + components/ Expo Router screens and React Native UI
State context/ React Context — auth, safety level, security, location
Service services/ Supabase queries, SecureStore, business logic
Data supabase/ + data/ DB schema, edge functions, static content

Folder structure

Homewithin/
├── app/
│   ├── (tabs)/          ← bottom-tab screens (home, connect, journal, safety, resources)
│   ├── onboarding/      ← 3-step onboarding flow
│   ├── (auth)/          ← welcome, sign-in
│   ├── (safety)/        ← lock, PIN, disguise, decoy, emergency
│   ├── (social)/        ← chat, circles, chosen-family
│   ├── (wellness)/      ← check-in, journal entry, progress, intentions
│   └── (content)/       ← articles, programs, events, local-resources
│
├── components/
│   ├── ui/              ← design-system primitives (Button, Card, Input, …)
│   ├── profile/         ← profile-scoped components
│   └── safety/          ← safety-scoped components (EmergencyButton, …)
│
├── services/
│   ├── supabase.ts      ← Supabase client singleton
│   ├── storage.ts       ← Expo SecureStore (journal, safety plan, PIN)
│   ├── social/          ← chat, matching, circles, chosen-family, notifications
│   ├── wellness/        ← AI companion, safety score, progress stats
│   ├── content/         ← resources, programs, local-resources
│   └── user/            ← account, avatar
│
├── context/
│   ├── AuthContext.tsx      ← user profile + onboarding state
│   ├── SafetyContext.tsx    ← safety level (green / yellow / red)
│   ├── SecurityContext.tsx  ← PIN, lock screen, disguise mode
│   ├── LocationContext.tsx  ← GPS-derived nearby state and resources
│   ├── UnreadContext.tsx    ← unread message badge count
│   └── SessionContext.tsx   ← aggregated hook (useSession) + SessionBridge
│
├── hooks/               ← data-fetching hooks (useMatches, useMessages, useProgress, useCheckIns)
├── constants/           ← design tokens only (Colors, Spacing, Typography, theme)
├── data/                ← static business content (articles, hotlines, programs, localResources)
├── types/               ← domain-scoped TypeScript types; index.ts is a re-export barrel
└── supabase/
    ├── functions/       ← Deno edge functions (AI companion, match scoring)
    └── migrations/      ← SQL schema migrations

State management

Four focused React Contexts replace the original monolithic SessionContext:

  • AuthContext — Supabase auth listener, profile hydration, onboarding flag
  • SafetyContext — safety assessment result (green / yellow / red)
  • SecurityContext — PIN-lock, disguise mode, AppState re-lock on background
  • LocationContext — GPS county detection, nearby resource list

All four are composed inside SessionProvider. Existing screens call useSession() unchanged; tests can still use <SessionContext.Provider value={mock}> directly.

Engineering Decisions

1. SessionBridge facade pattern

State is split across four focused providers (AuthContext, SafetyContext, SecurityContext, LocationContext) rather than a single monolithic context. A SessionBridge component sits at the bottom of the provider tree, reads all four contexts, and publishes one unified SessionContext. Production screens call useSession() and get everything; tests skip the providers entirely and render <SessionContext.Provider value={mock}> directly. The pattern was chosen to make testing predictable without introducing a state management library.

2. Security threat model

The app is designed for users who may be monitored by a hostile person on the same device. PIN is stored as a SHA-256 hash (never plaintext) via expo-crypto. Auth tokens are stored in expo-secure-store with AFTER_FIRST_UNLOCK — inaccessible while the device is locked. AppState fires a re-lock on inactive or background transitions. detectSessionInUrl: false prevents auth tokens from leaking through deep link URLs. Disguise mode is a direct response to this threat: one tap replaces the app shell with a convincing Weather, Calculator, or Notes interface.

3. Real-time chat with AppState resume handling

Chat uses a Supabase realtime channel subscription for live message delivery. WebSocket connections silently drop when the app moves to the background on iOS/Android. On AppState change to active, useMessages explicitly refetches the message list to fill any gap that occurred while the socket was disconnected — ensuring no messages are missed without requiring a full reconnect cycle.


Testing

npm test                 # run all Jest tests
npm test -- --watch      # watch mode

Tests live in __tests__/ mirroring the source structure. Test helpers in __tests__/helpers/renderWithSession.tsx provide a pre-wired session mock.

Database

Supabase project schema is version-controlled in supabase/migrations/. Apply locally with the Supabase CLI:

supabase db reset        # apply all migrations from scratch
supabase functions serve # run edge functions locally

Contact

Built with care in Sweden.

For partnerships, press inquiries, or collaboration with RFSL and Swedish LGBTQ+ organizations: lucas.eduardo2070@gmail.com


HomeWithin is not a medical device and does not replace professional mental health care. If you are in immediate danger, call 112.

About

Anonymous safety companion for LGBTQ+ youth in Sweden — disguise mode, on-device crisis assessment, AI companion, and local support resources across all 21 Län.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors