{"id":34712773,"url":"https://github.com/homuchen/meno-api","last_synced_at":"2026-05-26T02:03:25.367Z","repository":{"id":321189423,"uuid":"1084721349","full_name":"HoMuChen/meno-api","owner":"HoMuChen","description":"An api server for meno","archived":false,"fork":false,"pushed_at":"2025-12-04T04:16:40.000Z","size":610,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-07T10:35:44.645Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/HoMuChen.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-10-28T04:22:48.000Z","updated_at":"2025-12-04T04:16:44.000Z","dependencies_parsed_at":"2025-10-28T10:27:04.046Z","dependency_job_id":null,"html_url":"https://github.com/HoMuChen/meno-api","commit_stats":null,"previous_names":["homuchen/meno-api"],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/HoMuChen/meno-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoMuChen%2Fmeno-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoMuChen%2Fmeno-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoMuChen%2Fmeno-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoMuChen%2Fmeno-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HoMuChen","download_url":"https://codeload.github.com/HoMuChen/meno-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoMuChen%2Fmeno-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33500457,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-25T14:31:05.219Z","status":"online","status_checked_at":"2026-05-26T02:00:06.821Z","response_time":63,"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":[],"created_at":"2025-12-25T00:49:08.681Z","updated_at":"2026-05-26T02:03:25.355Z","avatar_url":"https://github.com/HoMuChen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Meno API\n\nRESTful API built with Express, MongoDB, and clean architecture principles.\n\n## 🏗️ Architecture\n\nThis project follows **Clean Architecture** (Hexagonal/Onion Architecture) with clear separation of concerns:\n\n```\nsrc/\n├── core/           # Business logic layer\n├── components/     # Infrastructure layer (database, storage, logging)\n├── api/            # HTTP interface layer\n├── models/         # Data models\n└── utils/          # Utilities\n```\n\n### Dependency Flow\n\n```\nControllers → Core Services → Components\n```\n\n- **Controllers** handle HTTP concerns only\n- **Core Services** contain business logic\n- **Components** handle infrastructure (database, storage, logging)\n\n## 🚀 Features\n\n- ✅ **Clean Architecture** - Separation of concerns, testable, maintainable\n- ✅ **Pluggable Storage** - Interface-based storage (local filesystem, GCS, S3)\n- ✅ **Audio File Support** - Full MP3, M4A, WAV, WebM, OGG, FLAC support with automatic duration extraction\n- ✅ **MongoDB Database** - Mongoose ODM with schema validation\n- ✅ **Winston Logging** - Structured logging with file rotation\n- ✅ **Swagger Documentation** - Auto-generated API docs from code\n- ✅ **Error Handling** - Global error handler with custom error classes\n- ✅ **Request Validation** - Joi schema validation\n- ✅ **Health Checks** - Readiness and liveness endpoints\n\n## 📦 Installation\n\n```bash\n# Install dependencies\nnpm install\n\n# Copy environment file\ncp .env.example .env\n\n# Update .env with your configuration\n```\n\n## 🔧 Configuration\n\nEdit `.env` file:\n\n```bash\nNODE_ENV=development\nPORT=3000\nMONGODB_URI=mongodb://localhost:27017/meno-api\nSTORAGE_PROVIDER=local\nLOCAL_STORAGE_PATH=./storage\nLOG_LEVEL=info\n```\n\n## 🏃 Running the Server\n\n```bash\n# Development (with auto-reload)\nnpm run dev\n\n# Production\nnpm start\n```\n\nServer will start on `http://localhost:3000`\n\n## 📚 API Documentation\n\n### Interactive Documentation\n\nOnce the server is running, visit:\n\n- **Swagger UI**: http://localhost:6001/api-docs\n- **Health Check**: http://localhost:6001/api/health\n\n### OpenAPI Specification\n\nFor frontend development or code generation:\n\n- **OpenAPI YAML**: `docs/openapi.yaml` (1600+ lines, 23 endpoints)\n- **Documentation Guide**: See `docs/README.md` for usage instructions\n\nTo regenerate the OpenAPI spec after making changes:\n\n```bash\nnpm run generate:openapi\n```\n\n## 🛣️ API Endpoints\n\n### Health\n- `GET /api/health` - Health check\n- `GET /api/health/ready` - Readiness check\n\n### Users\n- `GET /api/users` - Get all users (paginated)\n- `GET /api/users/:id` - Get user by ID\n- `POST /api/users` - Create new user\n- `PUT /api/users/:id` - Update user\n- `DELETE /api/users/:id` - Delete user\n- `POST /api/users/:id/avatar` - Upload user avatar\n\n### Files\n- `POST /api/files` - Upload file\n- `GET /api/files` - Get all files (paginated)\n- `GET /api/files/:id` - Get file by ID\n- `GET /api/files/:id/download` - Download file\n- `GET /api/files/:id/url` - Get file URL\n- `DELETE /api/files/:id` - Delete file\n\n## 🔌 Storage Providers\n\n### Local Filesystem (Default)\n\n```bash\nSTORAGE_PROVIDER=local\nLOCAL_STORAGE_PATH=./storage\n```\n\n### Google Cloud Storage\n\n```bash\nSTORAGE_PROVIDER=gcs\nGCS_BUCKET_NAME=your-bucket-name\nGCS_KEY_FILE=./path/to/service-account-key.json\n```\n\n**Note**: GCS provider requires implementation. See `src/components/storage/providers/gcs.provider.js`\n\n### Adding New Storage Providers\n\n1. Create new provider class implementing `IStorageProvider` interface\n2. Add to `StorageFactory` in `src/components/storage/storage.factory.js`\n3. Update environment configuration\n\n## 🧪 Testing\n\n```bash\n# Run tests\nnpm test\n\n# Run tests with coverage\nnpm test -- --coverage\n\n# Watch mode\nnpm run test:watch\n```\n\n## 📝 Code Quality\n\n```bash\n# Lint code\nnpm run lint\n\n# Fix linting issues\nnpm run lint:fix\n```\n\n## 🗂️ Project Structure\n\n```\nmeno-api/\n├── src/\n│   ├── api/                    # HTTP layer\n│   │   ├── controllers/        # Request handlers\n│   │   ├── middleware/         # Express middleware\n│   │   ├── routes/             # Route definitions\n│   │   └── validators/         # Request validation\n│   ├── components/             # Infrastructure\n│   │   ├── config/             # Configuration\n│   │   ├── database/           # MongoDB connection\n│   │   ├── logging/            # Winston logger\n│   │   └── storage/            # Storage abstraction\n│   ├── core/                   # Business logic\n│   │   ├── interfaces/         # Contracts\n│   │   └── services/           # Domain services\n│   ├── models/                 # MongoDB schemas\n│   ├── utils/                  # Utilities\n│   ├── app.js                  # Express app setup\n│   └── server.js               # Entry point\n├── storage/                    # Local file storage\n├── logs/                       # Log files\n├── tests/                      # Test files\n├── .env.example                # Environment template\n├── .gitignore\n├── package.json\n└── README.md\n```\n\n## 🔐 Environment Variables\n\n| Variable | Description | Default |\n|----------|-------------|---------|\n| `NODE_ENV` | Environment | `development` |\n| `PORT` | Server port | `3000` |\n| `MONGODB_URI` | MongoDB connection string | `mongodb://localhost:27017/meno-api` |\n| `STORAGE_PROVIDER` | Storage provider (local, gcs, s3) | `local` |\n| `LOCAL_STORAGE_PATH` | Local storage path | `./storage` |\n| `LOG_LEVEL` | Logging level | `info` |\n| `LOG_DIR` | Log directory | `./logs` |\n\n## 🤝 Contributing\n\n1. Follow clean architecture principles\n2. Controllers only call core services\n3. Core services call components via interfaces\n4. Add tests for new features\n5. Update Swagger documentation\n\n## 📄 License\n\nISC\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhomuchen%2Fmeno-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhomuchen%2Fmeno-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhomuchen%2Fmeno-api/lists"}