Prerequisites
Before you begin, ensure you have the following installed:Node.js
pnpm
Git
Code Editor
Installation Steps
Install Dependencies
Environment Configuration
Service Configuration
1. API.Bible Setup
Get API Key
- Visit API.Bible
- Sign up for a free account
- Navigate to “API Keys” section
- Create a new API key
2. Convex Backend Setup
Create Convex Account
- Visit Convex.dev
- Sign up with GitHub or email
- Create a new project
Initialize Convex
- Log you in (if first time)
- Create/link a project
- Deploy your schema
- Generate environment variables
3. PostgreSQL Database Setup
- Using Neon (Recommended)
- Using Local PostgreSQL
Create Neon Account
- Visit Neon.tech
- Sign up for a free account
- Create a new project
Get Connection String
- Go to your project dashboard
- Copy the connection string
- It should look like:
postgresql://user:password@host/database
4. Better Auth Configuration
5. Google Gemini AI Setup
Get Gemini API Key
- Visit Google AI Studio
- Sign in with your Google account
- Click “Get API Key”
- Create a new API key
6. Redis/Upstash Setup
Create Upstash Account
- Visit Upstash
- Sign up for a free account
- Create a new Redis database
Get Connection Details
- Click on your database
- Go to “REST API” section
- Copy the connection details
7. Optional: UploadThing (Future Feature)
UploadThing Configuration
UploadThing Configuration
- Visit UploadThing
- Create an account and project
- Get your token from the dashboard
- Add to
.env:
Running the Development Server
Start Convex
- Watch for schema changes
- Hot reload functions
- Provide real-time sync
- Hot Module Replacement (HMR)
- Fast refresh for React components
- TypeScript checking
- Automatic route generation
Verification Steps
1. Check Application Loads
1. Check Application Loads
- Page loads without errors
- No console errors in browser DevTools
- Navigation works
2. Test API.Bible Connection
2. Test API.Bible Connection
- Select a Bible translation from dropdown
- Navigate to Genesis chapter 1
- Verify verses load correctly
3. Test Authentication
3. Test Authentication
- Click “Sign In”
- Create a new account with email
- Verify successful sign-in
- Check that protected routes are now accessible
4. Test Convex Integration
4. Test Convex Integration
- Create a new collection
- Add a verse to the collection
- Verify data persists after page refresh
5. Test AI Story Generation
5. Test AI Story Generation
- Navigate to Stories section
- Create a new story
- Fill in all required fields
- Generate a story
- Verify story appears correctly
Common Issues and Troubleshooting
Port Already in Use
Port Already in Use
Convex Connection Issues
Convex Connection Issues
- Verify
VITE_CONVEX_URLis set correctly - Check Convex dashboard for deployment status
- Try restarting
npx convex dev - Clear browser cache and reload
API.Bible Not Loading
API.Bible Not Loading
- Verify
API_KEYis valid - Check API key hasn’t expired
- Verify
API_BASE_URLis correct:https://api.scripture.api.bible/v1 - Check browser console for specific error messages
- Verify API key has necessary permissions
Database Connection Errors
Database Connection Errors
Authentication Not Working
Authentication Not Working
- Verify
BETTER_AUTH_SECRETis set - Check
BETTER_AUTH_URLmatches your dev server URL - Verify database migrations ran successfully
- Clear cookies and try again
- Check browser console for errors
Story Generation Failing
Story Generation Failing
- Verify
GEMINI_API_KEYis valid - Check API key has necessary permissions
- Verify Redis is connected (for rate limiting)
- Check browser console and server logs
- Ensure you haven’t exceeded rate limit (5 stories/day)
Rate Limiting Issues
Rate Limiting Issues
- Verify all Redis environment variables are set
- Test Redis connection in Upstash dashboard
- Check
KV_REST_API_TOKENis valid - Restart development server
TypeScript Errors
TypeScript Errors
Module Not Found Errors
Module Not Found Errors
- Verify all dependencies are installed:
pnpm install - Check
tsconfig.jsonpaths are configured - Restart development server
- Clear Vite cache:
rm -rf node_modules/.vite
Development Tools
Recommended VS Code Extensions
- ES7+ React/Redux/React-Native snippets: React snippets
- Tailwind CSS IntelliSense: Tailwind autocompletion
- TypeScript: Built-in, ensure it’s enabled
- ESLint: Code linting
- Prettier: Code formatting
- Error Lens: Inline error display
Browser DevTools
- React Developer Tools: Inspect React component tree
- TanStack Query Devtools: Built into the app (bottom left corner in dev mode)
- Network Tab: Monitor API requests
- Console: Check for errors and warnings
Build and Production Testing
Building for Production
dist directory.
Testing Production Build Locally
Production Checklist
Before Deploying
Before Deploying
- All tests pass
- No console errors or warnings
- Build completes without errors
- Environment variables are properly configured for production
- API keys are valid and have proper rate limits
- Database migrations are up to date
- Authentication works correctly
- All features tested on production build
- Mobile responsiveness verified
- Performance is acceptable (check Lighthouse scores)
Next Steps
Now that your local environment is set up:- Read the Project Structure guide to understand the codebase
- Review the Database Schema documentation
- Explore the Integrations to understand external services
- Check the Contributing Guide before making changes