diff --git a/.env.example b/.env.example deleted file mode 100644 index 12b0de80..00000000 --- a/.env.example +++ /dev/null @@ -1,59 +0,0 @@ -# ================================== -# Database Configuration -# ================================== - -# PostgreSQL database connection URL -# Format: postgresql://username:password@host:port/database -# Example: postgresql://postgres:password@localhost:5432/memohome -DATABASE_URL=postgresql://postgres:1234@localhost:5432/database_name - - -# ================================== -# API Server Configuration -# ================================== -API_SERVER_PORT=7002 -WEB_PORT=7003 - -API_BASE_URL=http://localhost:7002 -WEB_URL=http://localhost:7003 - - -# ================================== -# Authentication Configuration -# ================================== - -# Root user credentials (super admin) -# This user is not stored in the database and has full admin privileges -# Use a strong username and password in production -ROOT_USER=admin -ROOT_USER_PASSWORD=change_this_secure_password - -# JWT secret key for signing tokens -# IMPORTANT: Use a long, random string in production (at least 32 characters) -# You can generate one with: openssl rand -base64 32 -JWT_SECRET=your-jwt-secret-key-change-in-production-use-long-random-string - -# JWT token expiration time -# Format: number + unit (s=seconds, m=minutes, h=hours, d=days) -# Examples: 30m, 2h, 7d, 30d -# Default: 7d (7 days) -JWT_EXPIRES_IN=7d - - -# ================================== -# Optional: Development Configuration -# ================================== - -# Node environment -# Options: development, production, test -NODE_ENV=development - -REDIS_URL=redis://example - -CONTAINER_DATA_DIR= -NERDCTL_COMMAND=nerdctl -CONTAINERD_SOCKET= - - -# Enable debug logging (optional) -# DEBUG=true diff --git a/README.md b/README.md index 35d29f84..10b4032a 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,15 @@ Memoh是一个专属于你的AI私人管家,你可以把它跑在你的NAS, - [ ] 文件系统管理:Memoh可以帮你管理你的文件系统,比如:文件搜索,图片分类,文件分享等。他可以创建文件,也可以通过聊天软件发送文件给你;你也可以通过发送文件给他帮你处理。 - More... +## Development + +你需要先安装mise,然后执行以下命令: + +```bash +mise install +mise run dev +``` + ## Star History [![Star History Chart](https://api.star-history.com/svg?repos=memohai/Memoh&type=date&legend=top-left)](https://www.star-history.com/#memohai/Memoh&type=date&legend=top-left) diff --git a/agent/mise.toml b/agent/mise.toml new file mode 100644 index 00000000..8a8bc0a0 --- /dev/null +++ b/agent/mise.toml @@ -0,0 +1,15 @@ +[tasks.dev] +alias = "dev" +description = "Start agent gateway development server" +run = "pnpm dev" +depends = ["//:pnpm-install"] + +[tasks.build] +description = "Build agent gateway" +run = "pnpm build" +depends = ["//:pnpm-install"] + +[tasks.start] +description = "Start agent gateway" +run = "pnpm start" +depends = ["//:pnpm-install"] \ No newline at end of file diff --git a/cmd/agent/mise.toml b/cmd/agent/mise.toml new file mode 100644 index 00000000..627b3b5b --- /dev/null +++ b/cmd/agent/mise.toml @@ -0,0 +1,5 @@ +[tasks.start] +alias = "dev" +description = "Start server" +run = "go run main.go" +depends = ["//:go-install"] diff --git a/mise.toml b/mise.toml new file mode 100644 index 00000000..c514aff0 --- /dev/null +++ b/mise.toml @@ -0,0 +1,41 @@ +experimental_monorepo_root = true + +[tools] +# Go version from go.mod +go = "1.25.2" +# Node.js for frontend packages +node = "22" +# Bun for agent gateway +bun = "latest" +# pnpm for workspace management +pnpm = "9" + +[task_config] +dir = "{{cwd}}" + +[settings] +experimental = true + +[tasks.pnpm-install] +description = "Install dependencies" +run = "pnpm install" + +[tasks.go-install] +description = "Install Go dependencies" +run = "go mod download" + +[tasks.dev] +description = "Start development environment" +depends = [ + "//agent:dev", + "//cmd/agent:start", +] + +[tasks.setup] +description = "Setup development environment" +depends = [ + "//:pnpm-install", + "//:go-install", +] +run = "echo '✓ Setup complete! Next: Copy config.toml.example to config.toml and configure, then run: mise run dev:web'" +