hayai-db
Version:
ā” Instantly create and manage local databases with one command
157 lines (123 loc) ⢠4.46 kB
Markdown
# 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! š