UNPKG

hayai-db

Version:

⚔ Instantly create and manage local databases with one command

157 lines (123 loc) • 4.46 kB
# Development Setup Guide ## šŸš€ Hayai v0.4.1 - Development Environment Before you start working on Hayai, make sure you have the following installed: - **Node.js** (v18 or higher) - **npm** or **yarn** - **Docker** (for testing database containers) - **Git** ## šŸ“¦ Current Database Support (v0.4.1) Hayai supports **19 databases across 8 technical categories**: - **SQL (4):** postgresql, mariadb, sqlite, duckdb - **Embedded (1):** leveldb - **Key-Value (1):** redis - **Wide Column (1):** cassandra - **Vector (3):** qdrant, weaviate, milvus - **Graph (1):** arangodb - **Search (2):** meilisearch, typesense - **Time Series (6):** influxdb2, influxdb3, timescaledb, questdb, victoriametrics, horaedb ## Installation ### Option 1: Using WSL (Recommended for Windows users) 1. Open WSL terminal 2. Navigate to your project directory: ```bash cd /home/hitoshi/Documents/github/hitoshyamamoto/hayai ``` 3. Install dependencies: ```bash npm install ``` ### Option 2: Using Windows PowerShell 1. Install Node.js for Windows from [nodejs.org](https://nodejs.org/) 2. Open PowerShell in your project directory 3. Install dependencies: ```powershell npm install ``` ## Development Commands ```bash # Install dependencies npm install # Start development mode with hot reload npm run dev # Build the project npm run build # Run tests npm test # Format code npm run format # Lint code npm run lint ``` ## Testing Your CLI After installation, you can test your CLI in development mode: ```bash # Run the CLI in development mode npm run dev -- --help # Test the init command npm run dev -- init # Test other commands npm run dev -- list npm run dev -- start npm run dev -- stop ``` ## Project Structure ``` hayai/ ā”œā”€ā”€ src/ │ ā”œā”€ā”€ cli/ # CLI interface │ │ ā”œā”€ā”€ index.ts # Main CLI entry point │ │ └── commands/ # Command implementations │ │ ā”œā”€ā”€ init.ts # Database initialization │ │ ā”œā”€ā”€ start.ts # Start containers │ │ ā”œā”€ā”€ stop.ts # Stop containers │ │ ā”œā”€ā”€ list.ts # List instances │ │ ā”œā”€ā”€ remove.ts # Remove instances │ │ ā”œā”€ā”€ logs.ts # Show logs │ │ ā”œā”€ā”€ studio.ts # Admin dashboard │ │ └── snapshot.ts # Create snapshots │ ā”œā”€ā”€ core/ # Core engine logic │ │ ā”œā”€ā”€ types.ts # Type definitions │ │ ā”œā”€ā”€ config.ts # Configuration management │ │ ā”œā”€ā”€ docker.ts # Docker integration │ │ ā”œā”€ā”€ port-manager.ts # Port allocation │ │ └── templates.ts # Template generation │ ā”œā”€ā”€ templates/ # Database templates │ ā”œā”€ā”€ api/ # Optional REST API │ └── dashboard/ # Optional web dashboard ā”œā”€ā”€ dist/ # Compiled output ā”œā”€ā”€ package.json # Dependencies and scripts ā”œā”€ā”€ tsconfig.json # TypeScript configuration ā”œā”€ā”€ hayai.config.yaml # Global configuration └── .gitignore # Git ignore rules ``` ## Next Steps 1. **Install dependencies** using one of the methods above 2. **Implement Docker integration** in `src/core/docker.ts` 3. **Create database templates** in `src/templates/` 4. **Test with real databases** using Docker 5. **Add more database engines** to the supported list 6. **Implement admin dashboard** features 7. **Add comprehensive tests** ## Contributing 1. Fork the repository 2. Create a feature branch 3. Make your changes 4. Add tests for new functionality 5. Submit a pull request ## Troubleshooting ### WSL Path Issues If you encounter path issues with WSL, make sure you're working in the correct directory: ```bash pwd # Should show /home/hitoshi/Documents/github/hitoshyamamoto/hayai ``` ### Node.js Not Found If Node.js is not found, install it: - **WSL**: `sudo apt update && sudo apt install nodejs npm` - **Windows**: Download from [nodejs.org](https://nodejs.org/) ### Docker Issues Make sure Docker is running: ```bash docker --version docker ps ``` Ready to build the future of local database management! šŸš€