homeschool-master-docs

Homeschool Management App - Documentation

Welcome to the complete documentation for the Homeschool Management SaaS application. You can also view documentation on github pages.

Table of Contents


Overview

A comprehensive homeschool management platform built with Rails API backend and React Native mobile frontend.

Tech Stack:

Key Features:


Architecture Documentation

Database Architecture

Complete database schema with 15 tables, relationships, indexes, and constraints.

Contents:

API Specification

RESTful API documentation with 80+ endpoints across 9 modules.

Contents:

Mobile App Architecture

React Native frontend architecture and patterns.

Contents:

Rails Implementation Guide

Step-by-step instructions for building the Rails API backend.

Contents:


Getting Started

Prerequisites

Backend Development:

Ruby 3.2.2
Rails 7.1+
PostgreSQL 14+
Redis 6+

Mobile Development:

Node.js 18+ LTS
npm or yarn
Expo CLI
Xcode (for iOS, macOS only)
Android Studio (for Android)

Quick Start - Backend

# Clone the API repository
git clone https://github.com/YOUR-ORG/homeschool-api.git
cd homeschool-api

# Install dependencies
bundle install

# Setup database
rails db:create db:migrate db:seed

# Start server
rails server

API will be available at http://localhost:3000

Quick Start - Mobile

# Clone the mobile repository
git clone https://github.com/YOUR-ORG/homeschool-mobile.git
cd homeschool-mobile

# Install dependencies
npm install

# Start Expo
npx expo start

# Run on iOS
npx expo run:ios

# Run on Android
npx expo run:android

Development Guides

Backend Development

Project Structure:

homeschool-api/
├── app/
│   ├── controllers/api/v1/     # API controllers
│   ├── models/                 # ActiveRecord models
│   ├── services/               # Business logic (JWT, etc.)
│   └── serializers/            # JSON serialization
├── config/
│   ├── routes.rb              # API routes
│   └── initializers/          # CORS, etc.
├── db/
│   ├── migrate/               # Database migrations
│   └── seeds/                 # Seed data
└── spec/                      # RSpec tests

Key Commands:

# Generate model
rails g model Student teacher:references first_name:string

# Generate controller
rails g controller api/v1/students

# Run migrations
rails db:migrate

# Run tests
bundle exec rspec

# Rails console
rails console

# Database console
rails dbconsole

Common Patterns:

Mobile Development

Project Structure:

homeschool-mobile/
├── src/
│   ├── api/                   # API service layer
│   ├── components/            # React components
│   ├── hooks/                 # Custom hooks
│   ├── screens/               # Screen components
│   ├── navigation/            # React Navigation config
│   ├── store/                 # Zustand stores
│   ├── types/                 # TypeScript types
│   └── utils/                 # Utilities
├── assets/                    # Images, fonts
└── app.json                   # Expo configuration

Key Commands:

# Start development server
npx expo start

# Run tests
npm test

# Type check
npm run type-check

# Lint
npm run lint

# Build for iOS
eas build --platform ios

# Build for Android
eas build --platform android

Common Patterns:


API Reference

Base URL

Development: http://localhost:3000/api/v1
Production: https://api.homeschoolapp.com/api/v1

Authentication

All authenticated endpoints require a JWT token in the Authorization header:

Authorization: Bearer YOUR_ACCESS_TOKEN

Token Lifecycle:

Quick Reference - Key Endpoints

Authentication:

POST   /auth/register           # Create account
POST   /auth/login              # Login
POST   /auth/refresh            # Refresh access token
POST   /auth/logout             # Logout
POST   /auth/password/reset-request
POST   /auth/password/reset

Students:

GET    /students                # List all students
GET    /students/:id            # Get student details
POST   /students                # Create student
PUT    /students/:id            # Update student
DELETE /students/:id            # Delete student

Calendar:

GET    /calendar/events         # List events
GET    /calendar/events/:id     # Get event details
POST   /calendar/events         # Create event
PUT    /calendar/events/:id     # Update event
DELETE /calendar/events/:id     # Delete event
PATCH  /calendar/events/:id/attendance/:student_id

Assignments:

GET    /assignments             # List assignments
GET    /assignments/:id         # Get assignment
POST   /assignments             # Create assignment
PUT    /assignments/:id         # Update assignment
DELETE /assignments/:id         # Delete assignment
PATCH  /assignments/:id/complete

Tasks:

GET    /tasks                   # List tasks
GET    /tasks/:id               # Get task
POST   /tasks                   # Create task
PUT    /tasks/:id               # Update task
DELETE /tasks/:id               # Delete task
PATCH  /tasks/:id/complete

For complete API documentation, see API Specification.


Deployment

Backend - Heroku (MVP)

# Create Heroku app
heroku create homeschool-api

# Add PostgreSQL
heroku addons:create heroku-postgresql:hobby-dev

# Add Redis
heroku addons:create heroku-redis:hobby-dev

# Set environment variables
heroku config:set JWT_SECRET_KEY=your-production-secret
heroku config:set RAILS_ENV=production
heroku config:set RAILS_SERVE_STATIC_FILES=true

# Deploy
git push heroku main

# Run migrations
heroku run rails db:migrate

# Run seeds
heroku run rails db:seed

# Open app
heroku open

Mobile - Expo EAS

# Install EAS CLI
npm install -g eas-cli

# Login to Expo
eas login

# Configure project
eas build:configure

# Build for iOS
eas build --platform ios

# Build for Android
eas build --platform android

# Submit to App Store
eas submit --platform ios

# Submit to Play Store
eas submit --platform android

Environment Variables

Backend (.env):

DATABASE_URL=postgres://...
JWT_SECRET_KEY=your-secret-key
JWT_ACCESS_TOKEN_EXPIRY=3600
JWT_REFRESH_TOKEN_EXPIRY=2592000
REDIS_URL=redis://localhost:6379/0
AWS_ACCESS_KEY_ID=your-key
AWS_SECRET_ACCESS_KEY=your-secret
AWS_REGION=us-east-1
AWS_BUCKET=homeschool-uploads

Mobile (.env):

EXPO_PUBLIC_API_BASE_URL=https://api.homeschoolapp.com/v1
EXPO_PUBLIC_API_TIMEOUT=30000
EXPO_PUBLIC_ENABLE_BIOMETRICS=true
EXPO_PUBLIC_ENABLE_OFFLINE_MODE=true

Additional Resources

Documentation Files


Contributing

Development Workflow

  1. Create a new branch: git checkout -b feature/your-feature
  2. Make your changes
  3. Write/update tests
  4. Commit: git commit -m "feat: add new feature"
  5. Push: git push origin feature/your-feature
  6. Create Pull Request

Commit Convention

Follow Conventional Commits:

feat: add student profile images
fix: resolve calendar timezone issue
docs: update API documentation
chore: upgrade dependencies
refactor: extract validation logic
test: add assignment tests

Code Style

Backend:

Mobile:


Support

Getting Help

Reporting Bugs

Please include:

  1. Description of the issue
  2. Steps to reproduce
  3. Expected behavior
  4. Actual behavior
  5. Screenshots (if applicable)
  6. Environment (OS, browser, device)

License

MIT License - see LICENSE file for details


Changelog

v1.0.0 (Upcoming)


Last Updated: December 2025
Status: In Development
Version: 0.1.0 (Pre-release)