Welcome to Fast Scriptures! This comprehensive guide will take you from setup to shipping features like a pro.
Fast Scriptures is a modern, mobile-first scripture reading application that lets users:
- Search through all LDS scriptures with full-text search
- Browse scriptures by volume, book, and chapter
- Get random verses for daily inspiration
- Read with a beautiful, dark Cursor-inspired interface
The app is built with FastAPI (backend) + React (frontend) and designed to be fast, accessible, and developer-friendly.
Before you start, make sure you have these tools installed:
- Python 3.9+ - For the FastAPI backend
- uv - Fast Python package manager (install guide)
- Node.js 18+ - For the React frontend
- Git - For version control
- Visual Studio Code or Cursor - The project is optimized for these editors
- GitHub CLI (
gh) - Makes creating PRs easier - httpie or curl - For testing API endpoints
# Verify your tools are installed
python --version # Should be 3.9+
uv --version # Should be latest
node --version # Should be 18+
npm --version # Comes with Node.js
git --version # Any recent versiongit clone https://github.com/willwillis/fast-api-scripture-app.git
cd fast-api-scripture-appgit submodule update --init --recursiveThis downloads the LDS scripture database (~10MB)
cd backend
# Install Python dependencies (uv is much faster than pip)
uv sync
# Optional: Install monitoring dependencies if you want New Relic integration
# uv sync --extra monitoring
# Set up the database (copies from submodule)
python setup_database.py
# Start the backend server
uv run uvicorn app.main:app --reload --host 0.0.0.0 --port 8000β Backend ready! Visit http://localhost:8000/docs to see the API documentation
Note: New Relic monitoring is optional. The app runs fine without it - you'll just see a harmless import message in the logs if it's not installed.
cd frontend
# Install Node.js dependencies
npm install
# Start the frontend development server
npm run devβ Frontend ready! Visit http://localhost:5173 to see the application
You should now have:
- β Backend API running at http://localhost:8000
- β Frontend app running at http://localhost:5173
- β API docs at http://localhost:8000/docs
- β Scripture database loaded and working
Try searching for "love" or clicking "Random Scripture" to test everything works!
Here's what you're working with:
fast-scriptures/
βββ backend/ # FastAPI backend
β βββ app/
β β βββ main.py # πͺ Entry point - starts here
β β βββ routes/ # π€οΈ API endpoints (/api/scriptures/*)
β β βββ services/ # π§ Business logic (database queries)
β β βββ models/ # π Data structures (what API returns)
β β βββ utils/ # βοΈ Configuration & helpers
β βββ tests/ # π§ͺ Backend tests
β βββ pyproject.toml # π¦ Python dependencies
βββ frontend/ # React frontend
β βββ src/
β β βββ App.tsx # π Main app component
β β βββ components/ # π§© UI components
β β βββ hooks/ # πͺ React hooks (useScriptures)
β β βββ services/ # π‘ API calls to backend
β β βββ types/ # π TypeScript types
β βββ package.json # π¦ Node.js dependencies
β βββ tailwind.config.js # π¨ Styling configuration
βββ submodules/
β βββ lds-scriptures/ # π Scripture database (SQLite)
βββ docs/ # π Documentation (you are here!)
| File | What It Does | When You'd Edit It |
|---|---|---|
backend/app/routes/scriptures.py |
API endpoints for scripture operations | Adding new API features |
backend/app/services/database.py |
Database queries and business logic | Changing how data is fetched |
frontend/src/components/ScriptureReader.tsx |
Main UI component | Improving the user interface |
frontend/src/hooks/useScriptures.ts |
React hook for API calls | Adding new frontend features |
frontend/src/services/api.ts |
API client functions | Adding new API endpoints |
# Create feature branch
git checkout -b feature/your-feature-name
# Make changes
# (edit files, add features, fix bugs)
# Test your changes (see Testing section below)
cd backend && uv run pytest
cd frontend && npm run test
# Commit changes with good commit message
git add .
git commit -m "feat: add your feature description"
# Push and create PR
git push -u origin feature/your-feature-name# Start development servers
cd backend && uv run uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
cd frontend && npm run dev
# Run quality checks
cd backend && uv run black app tests && uv run isort app tests && uv run flake8 app tests
cd frontend && npm run lint
# Run tests
cd backend && uv run pytest
cd frontend && npm run testLet's make a small change to get familiar with the workflow:
git checkout -b improve-docsEdit README.md and add your name to a contributors section, or fix a typo you notice.
# Test backend
cd backend
uv run pytest tests/ -v
# Test frontend
cd frontend
npm run test
npm run lint
# Test both work together (manual)
# Visit http://localhost:5173 and try the appgit add .
git commit -m "docs: add contributor section to README
- Added contributors section to acknowledge project contributors
- Fixed minor typo in setup instructions"git push -u origin improve-docs
# If you have GitHub CLI:
gh pr create --title "Improve documentation" --body "Small improvements to README"
# Otherwise, go to GitHub and create a PR manuallyWe use Conventional Commits for clear, semantic commit messages:
type(scope): description
[optional body]
[optional footer]
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changesrefactor: Code refactoringtest: Test additions/changeschore: Build/tooling changes
feat(api): add user authentication endpoints
fix(frontend): resolve search input validation issue
docs(readme): update deployment instructions
test(backend): add comprehensive API tests
Testing is crucial! Here's how to run all the tests:
cd backend
# Run all tests
uv run pytest
# Run with coverage
uv run pytest --cov=app --cov-report=term-missing
# Run specific test
uv run pytest tests/test_api.py::TestScriptureEndpoints::test_get_volumes
# Run integration tests
uv run pytest -m integrationcd frontend
# Run all tests
npm run test
# Run with coverage
npm run test:coverage
# Run in watch mode (for development)
npm run test -- --watch
# Run specific test file
npm run test -- App.test.tsx# Backend linting and formatting
cd backend
uv run black --check app tests # Check formatting
uv run isort --check-only app tests # Check import order
uv run flake8 app tests # Check code style
uv run mypy app # Type checking
# Frontend linting
cd frontend
npm run lint # Check TypeScript/JavaScript
npx tsc --noEmit # Check TypeScript types# Run monitoring script for end-to-end validation
python scripts/monitor.py --url http://localhost:8000
# Test production endpoints
python scripts/monitor.py --url https://scriptures-fast-api.onrender.com# Use our Makefiles for convenience
make test-backend
make test-frontend
make lint-allBefore submitting a PR, ensure:
- Tests pass locally
- Code follows style guidelines
- Documentation updated
- No security vulnerabilities
- Performance impact considered
- Backward compatibility maintained
When reviewing code, focus on:
- Logic and architecture
- Security issues
- Error handling
- Proper testing
- Documentation updates
- VS Code: Python, TypeScript, ESLint, Prettier, GitLens
- PyCharm: Python development with FastAPI support
- WebStorm: JavaScript/TypeScript development
# Backend development
uv run uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
uv run pytest --cov=app --cov-report=term-missing
uv run black --check app tests
# Frontend development
npm run dev
npm run build
npm run lint -- --fix
npm run test -- --watch
# Database operations
cd backend
python setup_database.py"Module not found" errors
cd backend
uv sync # Reinstall dependencies"Database not found" errors
git submodule update --init --recursive
python setup_database.pyPort 8000 already in use
# Kill any existing process
lsof -ti:8000 | xargs kill -9
# Or use a different port
uv run uvicorn app.main:app --reload --port 8001"Module not found" or TypeScript errors
cd frontend
rm -rf node_modules package-lock.json
npm installPort 5173 already in use
# Vite will automatically use next available port
# Or specify a different port
npm run dev -- --port 3000Tailwind styles not working
# Restart the dev server
npm run devGit submodule problems
git submodule deinit --all
git submodule update --init --recursivePre-commit hooks failing
# Install pre-commit (if you want to use it)
pip install pre-commit
pre-commit install
# Or skip pre-commit for now
git commit --no-verify -m "your message"- Never commit secrets or API keys
- Use environment variables for configuration
- Validate all inputs
- Sanitize database queries
- Keep dependencies updated
# Backend security scan
cd backend
uv run bandit -r app/
# Frontend security audit
cd frontend
npm audit
npm audit fix# Run with debug logging
DEBUG=true uv run uvicorn app.main:app --reload
# Use Python debugger
import pdb; pdb.set_trace()
# Check logs (if logging is configured)
tail -f backend/logs/app.log- Use browser Developer Tools
- Install React Developer Tools extension
- Check Network tab for API calls
- Review Console for errors and warnings
# Backend performance tests
cd backend
uv run pytest tests/test_performance.py
# Frontend bundle analysis
cd frontend
npm run build
npx vite-bundle-analyzer dist
# API response times
python scripts/monitor.py --url http://localhost:8000We use several tools for production monitoring:
- New Relic APM dashboard
- Render service logs
- GitHub Actions synthetic monitoring
- Error tracking and alerting
See our Operations Guide for detailed monitoring setup.
Stuck? Here are the best places to get help:
- Check our docs: Browse the documentation index
- Search issues: Look through GitHub issues
- Ask a question: Create a new issue with the "question" label
- Review existing code: Look at similar features in the codebase
- π Read API Standards - Learn our API design principles
- π Browse
backend/app/routes/scriptures.py- See how endpoints are built - π§ͺ Check
backend/tests/test_api.py- See how we test APIs - π FastAPI Documentation
- π Pydantic Documentation
- π¨ Examine
frontend/src/components/- See our React components - πͺ Study
frontend/src/hooks/useScriptures.ts- Learn our data fetching - π± Review the Tailwind config - Understand our theming
- π React Documentation
- π TypeScript Handbook
- π Vite Documentation
- π Read Deployment Guide - Learn how we deploy
- π Check Operations Guide - See our monitoring and SRE practices
- π pytest Documentation
- π React Testing Library
- π Vitest Documentation
Looking for something to work on? Here are beginner-friendly areas:
- Fix typos in documentation
- Improve error messages
- Add missing TypeScript types
- Fix responsive design issues
- Add new search filters
- Improve keyboard navigation
- Add loading states
- Enhance accessibility
- Add code comments
- Create tutorials
- Improve setup instructions
- Add architecture diagrams
- Add test cases
- Improve test coverage
- Add integration tests
- Create visual regression tests
Welcome to the Fast Scriptures community! π
We're excited to have you contribute. Start small, ask questions, and don't hesitate to open a PR even for minor improvements. Every contribution helps make the project better!
Quick Links: Documentation Index | API Standards | Operations Guide | Main README