Installation Guide
This guide will help you set up and self-host Your Bible application on your own infrastructure.Prerequisites
Before you begin, ensure you have the following installed and configured:- Node.js 18+ - JavaScript runtime
- pnpm (recommended), npm, or yarn - Package manager
- Git - Version control
Required API Keys and Services
You’ll need accounts and API keys for the following services:- Convex - Real-time backend (convex.dev)
- API.Bible - Bible content API (api.bible)
- Google Gemini AI - AI story generation (ai.google.dev)
- Neon or another PostgreSQL provider - Database (neon.tech)
- Upstash Redis - Rate limiting and caching (upstash.com)
- Better Auth - Authentication configuration
- UploadThing (optional) - File uploads (uploadthing.com)
- GitHub OAuth (optional) - GitHub authentication
Installation Steps
Install Dependencies
Install all required packages using your preferred package manager:
pnpm is recommended for faster installation and better disk space efficiency.
Configure Environment Variables
Create a
.env file in the root directory with all required configuration:Environment Variable Details
API.Bible Configuration:API_BASE_URL: Base URL for API.Bible (typicallyhttps://api.scripture.api.bible/v1)API_KEY: Your API.Bible API key from api.bible
BETTER_AUTH_SECRET: Random secret string for session encryption (generate withopenssl rand -base64 32)BETTER_AUTH_URL: Your application URL (usehttp://localhost:5173for development)
DATABASE_URL: PostgreSQL connection string from Neon or your provider
GEMINI_MODEL: AI model to use (e.g.,gemini-1.5-flash)GEMINI_API_KEY: Your Google AI API key
- Required for rate limiting on AI story generation
- Get all Redis/KV variables from your Upstash dashboard
CONVEX_DEPLOYMENT: Your Convex deployment nameVITE_CONVEX_URL: Your Convex deployment URL
Set Up Convex
Initialize and deploy your Convex backend:This command will:
- Set up your Convex project
- Create the necessary database tables (collections, collectionVerses, notes, stories)
- Start watching for schema changes
- Provide you with your
CONVEX_DEPLOYMENTandVITE_CONVEX_URLvalues
Keep the
convex dev command running in a separate terminal window during development. It will automatically sync schema changes and functions.Set Up Database
If using Drizzle ORM for database migrations, run:This will create all necessary database tables in your PostgreSQL instance.
Verify Installation
Once the development server is running:- Open
http://localhost:5173in your browser - You should see the Your Bible homepage
- Test the Bible reader by selecting a translation and chapter
- Create an account to test authentication
- Try creating a collection and adding verses
- Test the search functionality
- Create a note on a chapter
- Generate an AI story (if you have Gemini API configured)
Production Build
To build the application for production:dist directory, ready for deployment.
Project Structure
Understanding the project structure:Convex Schema
The application uses Convex for real-time data with the following schema:- collections - User-created verse collections
- collectionVerses - Individual verses within collections
- notes - User-created notes for each chapter
- stories - AI-generated stories based on biblical passages
Troubleshooting
Port Already in Use
If port 5173 is already in use, you can specify a different port:Convex Connection Issues
Ensurenpx convex dev is running and the VITE_CONVEX_URL in your .env matches your Convex dashboard.
API.Bible Errors
Verify your API key is correct and has access to Bible translations. Check the API.Bible documentation for troubleshooting.Database Connection Errors
Ensure yourDATABASE_URL is correctly formatted and your database is accessible. For Neon, check your connection string in the Neon dashboard.
Next Steps
Quickstart Guide
Learn how to use Your Bible as an end user
Contributing
Contribute to the project by submitting pull requests
For support, please open an issue in the GitHub repository or contact the development team.