A single-page application designed to guide users through Byron Katie's method of inquiry, followed by a "turnaround" exercise. The experience is seamless, quiet, and meditative—focused on introspection, not UI elements.
- Sequential guided inquiry process
- Persistent storage of past inquiries
- Minimalist, contemplative UI with generous whitespace
- Ability to copy inquiry to clipboard in Markdown format
- View and manage past inquiries
- AI guidance that provides insights on completed inquiries
- Smart linking of suggested follow-up beliefs for deeper inquiry
- AI-powered next belief suggestions based on previous inquiry patterns
- Frontend: SvelteKit with Tailwind CSS for styling
- Database: SQLite with Drizzle ORM
- AI Integration: OpenAI API for guidance and next belief suggestions
- Node.js (v18 or newer)
- npm
- Clone the repository:
git clone <repository-url>
cd inquiry- Install dependencies:
npm install- Setup environment:
Create a .env file in the root directory with:
DATABASE_URL=inquiry.db
OPENAI_API_KEY=your_openai_api_key_here
You'll need to get your OpenAI API key from OpenAI's platform to use the AI guidance feature.
- Set up the database:
npm run db:pushTo start the development server:
npm run devOpen your browser and navigate to http://localhost:5173.
npm run buildnpm run previewThe application includes unit tests for critical components and utilities:
# Run all tests
npm run test:unit -- --run
# Run tests for a specific file
npm run test:unit -- --run src/lib/utils/beliefProcessor.test.js
# Run tests in watch mode during development
npm run test:unitThe test suite focuses on:
- Utility functions for processing AI-generated belief suggestions
- Handling various markdown and plain text formats
- Edge cases in belief parsing
The application includes a Docker-based deployment system for easy hosting.
- Docker and Docker Compose
- SSH access to your server
- A domain name pointing to your server
- Create a
deploy.configfile in the root directory (copy fromdeploy.config.exampleif available):
# Server configuration
SERVER_IP=your_server_ip
SERVER_USER=your_ssh_username
SERVER_DIR=/path/on/server/for/app
DOMAIN_NAME=your-domain.com
# Docker configuration (optional)
DOCKER_REGISTRY=ghcr.io
DOCKER_USERNAME=your_username
DOCKER_IMAGE=inquiry
DOCKER_TAG=web-latest- Make sure your
.envfile contains production-ready values.
The application can be deployed using the included deploy.sh script:
# Standard deployment
./deploy.sh
# Clean build deployment (rebuilds from scratch)
./deploy.sh --no-cache
# Deploy with database seeding (copies your local database to the server)
./deploy.sh --seed-db
# Clean build with database seeding
./deploy.sh --no-cache --seed-dbThe deployment script:
- Builds a Docker image of the application
- Pushes the image to the specified Docker registry
- Copies configuration files to your server
- Updates the running containers on your server
- Verifies the deployment with health checks
- Optionally seeds the database from your local development environment
- Docker and Docker Compose installed
- Proper firewall settings to allow HTTP/HTTPS traffic
- A reverse proxy (like Nginx or Traefik) for SSL termination (recommended)
- Enter Belief: Write down the belief you want to examine
- Guided Questions: Answer each question sequentially
- Is it true?
- Can I absolutely know it's true?
- How do I react when I believe that thought?
- Who would I be without the thought?
- Turnarounds: Write three turnarounds for the belief
- Summary: Review your inquiry and save or copy as Markdown
- Inquiries Index: View, revisit, or delete past inquiries
- Next Belief Suggestions: Get AI-powered suggestions for your next inquiry based on patterns in your previous work
The Inquiry app includes AI guidance for completed inquiries:
- After completing an inquiry, view it and click the "Get Guidance" button
- The app will send your inquiry to OpenAI's GPT-4o model
- Responses are streamed in real-time and displayed as formatted markdown
- The AI provides insights about your inquiry process and suggestions
- Potential next beliefs are automatically converted to clickable links
- Click any suggested belief to start a new inquiry with that belief pre-populated
This feature helps deepen your inquiry practice by providing thoughtful reflection and suggestions for further exploration.
The app analyzes your previous inquiries and uses AI to suggest meaningful next beliefs to explore:
- Previous beliefs and their suggested next steps are extracted from your inquiry history
- This data is processed and sent to the OpenAI API using a specialized prompt
- The AI generates personalized suggestions based on patterns in your past inquiries
- The suggestions appear in the "Suggest Next Beliefs" panel on the home page
- Click any suggestion to start a new inquiry with that belief pre-populated
- If AI generation fails, the system falls back to suggestions extracted from previous AI guidance
This feature helps guide your inquiry practice by identifying meaningful patterns and suggesting productive next steps tailored to your personal journey.
MIT
The Inquiry project includes a robust database migration system for managing schema changes:
- Version-based migrations with automatic ordering
- Migration status tracking with detailed error logging
- Transaction-based migrations with rollback support
- Graceful error handling and recovery from failed migrations
- CLI for running migrations manually
# Show migration status
npm run migrate:status
# Apply all pending migrations (including previously rolled back migrations)
npm run migrate:up
# Rollback to a specific version (e.g., version 2)
npm run migrate:rollback 2
# Create a new migration file
npm run migrate:create my_migration_nameMigration files are located in src/lib/server/db/migrations/ with the naming format:
<version>_<name>.js
Each migration must export up and down functions:
/**
* Migration: example
* Version: 1
*/
// Apply the migration
export async function up(db, sqlite) {
console.log('Running migration: example');
// Implement migration logic here
sqlite.prepare('CREATE TABLE example (id INTEGER PRIMARY KEY)').run();
}
// Roll back the migration
export async function down(db, sqlite) {
console.log('Rolling back migration: example');
// Implement rollback logic here
sqlite.prepare('DROP TABLE example').run();
}You can specify a different database path for migrations:
npm run migrate:status -- --db ./path/to/database.dbMigrations automatically run on server startup via hooks.server.js.
Tests for the migration system are located in src/lib/server/db/migrations/tests/ and cover:
- Basic migration operations
- Version ordering
- Rollback functionality
- Transaction handling
- Error recovery
- System-level integration
Run the tests with:
npm test -- src/lib/server/db/migrations/tests