{"id":31642132,"url":"https://github.com/shift/psychonautwiki-journal","last_synced_at":"2026-04-18T12:03:44.380Z","repository":{"id":313894836,"uuid":"1053323332","full_name":"shift/psychonautwiki-journal","owner":"shift","description":"Harm reduction desktop application with complete PsychonautWiki substance database - built with Kotlin Multiplatform \u0026 Compose Desktop","archived":false,"fork":false,"pushed_at":"2025-09-14T19:12:16.000Z","size":356,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-07T03:58:16.513Z","etag":null,"topics":["compose-desktop","desktop-application","harm-reduction","kotlin-multiplatform","nix","psychonautwiki","substance-database"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shift.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-09T09:39:28.000Z","updated_at":"2025-09-28T23:17:21.000Z","dependencies_parsed_at":"2025-09-09T12:49:01.073Z","dependency_job_id":"2de5b723-e547-47be-9bf3-6d1d51320dbc","html_url":"https://github.com/shift/psychonautwiki-journal","commit_stats":null,"previous_names":["shift/psychonautwiki-journal"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shift/psychonautwiki-journal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shift%2Fpsychonautwiki-journal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shift%2Fpsychonautwiki-journal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shift%2Fpsychonautwiki-journal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shift%2Fpsychonautwiki-journal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shift","download_url":"https://codeload.github.com/shift/psychonautwiki-journal/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shift%2Fpsychonautwiki-journal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31967993,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compose-desktop","desktop-application","harm-reduction","kotlin-multiplatform","nix","psychonautwiki","substance-database"],"created_at":"2025-10-07T03:56:42.265Z","updated_at":"2026-04-18T12:03:44.315Z","avatar_url":"https://github.com/shift.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PsychonautWiki Journal\n\nA comprehensive harm reduction desktop application built with Kotlin Multiplatform and Compose Desktop, featuring the complete PsychonautWiki substance database.\n\n## 🎯 Purpose\n\nThis application provides evidence-based harm reduction information for psychoactive substances, helping users make informed decisions about substance use through comprehensive data on dosing, duration, interactions, and safety information.\n\n## ✨ Features\n\n- **📊 Complete PsychonautWiki Database**: Access to 289 psychoactive substances with comprehensive harm reduction data\n- **💊 Detailed Substance Information**: \n  - Dosing guidelines for different routes of administration\n  - Duration data (onset, peak, offset, total duration)\n  - Bioavailability information\n  - Interaction warnings and contraindications\n  - Tolerance and addiction potential information\n- **🔍 Advanced Search \u0026 Filtering**: Search by substance name, common names, categories, or effects\n- **⚡ Fast Performance**: Optimized database loading with health monitoring and metrics\n- **🖥️ Modern Desktop UI**: Clean, responsive interface built with Compose Desktop\n- **🛡️ Robust Error Handling**: Graceful fallbacks and comprehensive error reporting\n\n## 🛠️ Technology Stack\n\n- **Kotlin Multiplatform**: Cross-platform development\n- **Compose Desktop**: Modern declarative UI framework\n- **kotlinx.serialization**: JSON parsing and data serialization\n- **SQLDelight**: Database management with coroutines support\n- **Koin**: Dependency injection\n- **NixOS**: Reproducible development environment\n\n## 🚀 Getting Started\n\n### Prerequisites\n\n- **Nix with flakes enabled** (recommended for reproducible builds)\n- **Java 17+** (if not using Nix)\n- **Gradle 7.6+** (if not using Nix)\n\n### Quick Start with Nix\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/shift/psychonautwiki-journal.git\n   cd psychonautwiki-journal\n   ```\n\n2. Enter the development environment:\n   ```bash\n   nix develop\n   ```\n\n3. Build and run the application:\n   ```bash\n   cd psychonautwiki-journal-desktop\n   gradle run\n   ```\n\n### Traditional Setup\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/shift/psychonautwiki-journal.git\n   cd psychonautwiki-journal/psychonautwiki-journal-desktop\n   ```\n\n2. Build and run:\n   ```bash\n   ./gradlew run\n   ```\n\n## 📊 Database Integration\n\nThe application successfully loads the complete PsychonautWiki database:\n\n- **289 substances** with comprehensive harm reduction data\n- **12 substances** with bioavailability information\n- **Multiple routes of administration** per substance\n- **Interaction warnings** for dangerous combinations\n- **Category-based organization** (psychedelics, stimulants, depressants, etc.)\n\n### Database Loading Features\n\n- **Progress Tracking**: Real-time loading progress with metrics\n- **Health Monitoring**: Database integrity checks and load time tracking\n- **Graceful Fallbacks**: Fallback to essential substances if full database fails\n- **Error Recovery**: Robust handling of malformed JSON entries\n\nExpected console output on successful load:\n```\n🔄 Loading PsychonautWiki substance database...\n📁 JSON file loaded: 458192 characters\n✅ Successfully loaded PsychonautWiki database in ~500ms\n📊 Database metrics:\n   • 289 substances\n   • 15 categories\n   • 180+ substances with dosing/duration data\n   • 12 substances with bioavailability data\n   • 150+ substances with interaction warnings\n   • 400+ total routes of administration\n```\n\n## 🏗️ Architecture\n\n### Data Layer\n- **PsychonautWikiDatabase**: Singleton database manager with JSON parsing\n- **SubstanceRepository**: Repository pattern for data access\n- **SubstanceLoader**: Service layer for substance loading operations\n\n### Domain Models\n- **SubstanceInfo**: Complete substance information\n- **RouteOfAdministration**: Dosing and route-specific data\n- **BioavailabilityRange**: Bioavailability percentage ranges\n- **DurationRange**: Time-based effect duration data\n- **InteractionData**: Substance interaction warnings\n\n### UI Layer\n- **Compose Desktop**: Modern declarative UI\n- **MVVM Pattern**: ViewModels for state management\n- **Responsive Design**: Adaptive layouts for different screen sizes\n\n## 🔧 Build Commands\n\nIn the NixOS development environment:\n\n```bash\n# Build the application\ngradle build\n\n# Run the application\ngradle run\n\n# Run tests\ngradle test\n\n# Run all checks (including BDD tests)\ngradle check\n\n# Build distribution package\ngradle distZip\n```\n\n## 🧪 Testing\n\nThe project includes comprehensive testing:\n\n- **Unit Tests**: Core functionality and data models\n- **Integration Tests**: Database loading and parsing\n- **BDD Tests**: Cucumber-based behavior testing\n- **Kotest**: Modern Kotlin testing framework\n\n## 📁 Project Structure\n\n```\npsychonautwiki-journal/\n├── psychonautwiki-journal-desktop/    # Desktop application\n│   ├── src/commonMain/kotlin/          # Shared Kotlin code\n│   │   ├── data/                       # Data layer (repositories, models)\n│   │   ├── ui/                         # UI layer (screens, viewmodels)\n│   │   └── navigation/                 # Navigation logic\n│   ├── src/commonMain/resources/       # Resources (database JSON)\n│   ├── src/commonTest/kotlin/          # Shared tests\n│   └── src/desktopMain/kotlin/         # Desktop-specific code\n├── psychonautwiki-journal-android/     # Android application (legacy)\n├── flake.nix                          # NixOS development environment\n└── README.md                          # This file\n```\n\n## 🔄 Recent Improvements\n\n### JSON Parsing Fixes\n- **Fixed bioavailability parsing**: Created `BioavailabilityRange` to handle complex JSON structures\n- **Fixed duration range parsing**: Made `min` field optional for partial data\n- **Enhanced error handling**: Robust parsing with graceful fallbacks\n\n### Database Enhancements\n- **Loading metrics**: Comprehensive health monitoring and performance tracking\n- **Progress indicators**: Real-time feedback during database loading\n- **Error recovery**: Partial loading support for malformed entries\n\n### UI Improvements\n- **Bioavailability display**: Shows bioavailability ranges in substance listings\n- **Enhanced search**: Full-text search across complete database\n- **Performance optimization**: Efficient rendering of large substance lists\n\n## 🤝 Contributing\n\nThis project focuses on harm reduction and evidence-based information. Contributions are welcome for:\n\n- **UI/UX improvements**\n- **Additional harm reduction features**\n- **Database optimization**\n- **Testing and documentation**\n- **Accessibility enhancements**\n\n## ⚖️ Legal \u0026 Safety\n\n- **Educational Purpose**: This application is for educational and harm reduction purposes only\n- **Not Medical Advice**: Information provided is not medical advice; consult healthcare professionals\n- **Substance Safety**: Promotes responsible use and harm reduction practices\n- **Data Source**: Information sourced from PsychonautWiki, a collaborative harm reduction resource\n\n## 📄 License\n\n[License information to be added]\n\n## 🙏 Acknowledgments\n\n- **PsychonautWiki**: For providing the comprehensive substance database\n- **Harm Reduction Community**: For evidence-based safety information\n- **Kotlin \u0026 Compose Teams**: For excellent development tools\n- **NixOS Community**: For reproducible development environments\n\n---\n\n**🛡️ Remember: The safest use is no use. If you choose to use substances, please prioritize harm reduction, start with low doses, test substances when possible, and never use alone.**","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshift%2Fpsychonautwiki-journal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshift%2Fpsychonautwiki-journal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshift%2Fpsychonautwiki-journal/lists"}