Skip to content

Project-Janata/Janata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

653 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Janatha

The official app to connect the CHYKs of Chinmaya Mission West.

Om Sri Chinmaya Sadgurave Namaha. Om Sri Gurubyo Namaha.

Tech Stack

  • Frontend: Expo (React Native) — web + iOS + Android from one codebase
  • Backend: Hono on Cloudflare Workers (Pages Functions)
  • Database: Cloudflare D1 (SQLite at the edge)
  • Auth: PBKDF2 password hashing + JWT (via jose)

Project Structure

├── packages/
│   ├── frontend/      # Expo app (screens, components, auth)
│   └── backend/       # Hono API (routes, DB queries, auth)
├── functions/
│   └── api/[[route]].ts  # CF Pages Functions entry point
├── migrations/        # D1 SQL migrations
├── wrangler.toml      # Cloudflare Pages config
└── package.json       # npm workspaces root

Local Development

Prerequisites

  • Node.js >= 20
  • npm >= 10
  • A Cloudflare account with wrangler CLI configured (for deployment)

Setup

git clone https://github.com/Project-Janatha/Project-Janatha.git
cd Project-Janatha
npm run setup    # Installs deps + runs D1 migrations + seeds test data

Running

npm run dev      # Starts both API (8787) + Frontend (8081)

Other dev commands

Command Description
npm run dev Start API + frontend
npm run dev:backend Start only the API server
npm run dev:frontend Start only the Expo dev server
npm run d1:migrate:local Run D1 migrations
npm run build Typecheck + build frontend

Running on mobile

npm run ios       # Requires Xcode
npm run android   # Requires Android Studio

Deployment

The app deploys to Cloudflare Pages (frontend) and Cloudflare Workers (backend API) with D1.

First-time setup

  1. Create the D1 database:
npx wrangler d1 create chinmaya-janata-db --config packages/backend/wrangler.toml
  1. Update database_id in packages/backend/wrangler.toml with the ID from the output.

  2. Run migrations:

npm run d1:migrate    # Remote database
  1. Set secrets for the backend:
cd packages/backend
npx wrangler secret put JWT_SECRET
npx wrangler secret put JWT_REFRESH_SECRET

Deploy

npm run deploy            # Deploy both frontend + backend
npm run deploy:frontend   # Frontend only
npm run deploy:backend    # Backend only

Running Tests

# Backend unit tests (vitest + Cloudflare Workers pool)
cd packages/backend && npm test

# E2E tests (Playwright)
npx playwright test

About

The official project to connect the CHYKs of CMW!

Resources

License

Stars

Watchers

Forks

Contributors