{"id":31712284,"url":"https://github.com/freifunk/videoodyssee-api","last_synced_at":"2025-10-09T01:03:59.918Z","repository":{"id":71420446,"uuid":"509071700","full_name":"freifunk/videoodyssee-api","owner":"freifunk","description":"API for the Videoodyssee frontend","archived":false,"fork":false,"pushed_at":"2025-09-25T14:56:59.000Z","size":329,"stargazers_count":0,"open_issues_count":11,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-25T16:41:19.942Z","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/freifunk.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":"2022-06-30T12:30:18.000Z","updated_at":"2025-07-23T21:37:25.000Z","dependencies_parsed_at":"2025-06-03T10:02:02.418Z","dependency_job_id":"1bd70f1f-4e8d-4e1e-bc47-eec19a391e19","html_url":"https://github.com/freifunk/videoodyssee-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/freifunk/videoodyssee-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freifunk%2Fvideoodyssee-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freifunk%2Fvideoodyssee-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freifunk%2Fvideoodyssee-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freifunk%2Fvideoodyssee-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/freifunk","download_url":"https://codeload.github.com/freifunk/videoodyssee-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freifunk%2Fvideoodyssee-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000729,"owners_count":26082894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"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-10-09T01:01:04.905Z","updated_at":"2025-10-09T01:03:59.906Z","avatar_url":"https://github.com/freifunk.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VideoOdyssee API\n\n🎥 **Modern, secure and production-ready API for video processing workflows**\n\n[![CI Status](https://github.com/freifunk/videoodyssee-api/actions/workflows/ci.yml/badge.svg)](https://github.com/freifunk/videoodyssee-api/actions/workflows/ci.yml)\n[![Tests](https://freifunk.github.io/videoodyssee-api/badges/tests.svg)](https://github.com/freifunk/videoodyssee-api/actions/workflows/ci.yml)\n[![Coverage](https://freifunk.github.io/videoodyssee-api/badges/coverage.svg)](https://freifunk.github.io/videoodyssee-api/coverage/)\n[![Security](https://freifunk.github.io/videoodyssee-api/badges/security.svg)](https://github.com/freifunk/videoodyssee-api/security/advisories)\n[![Node.js](https://img.shields.io/badge/node.js-18%2B-brightgreen)](https://nodejs.org/)\n\n## 🚀 Features\n\n- **🔐 Secure Authentication** with JWT tokens\n- **📹 Video Management** with approval workflows  \n- **🔄 Pipeline Integration** for automated video processing\n- **📊 Professional Logging** with Winston (container-ready)\n- **🏥 Health Monitoring** with `/health` endpoint\n- **🐳 Container Native** - ready for Docker, Kubernetes, systemd\n- **✅ Comprehensive Testing** with 81% code coverage\n- **🛡️ Security Hardened** - 0 known vulnerabilities\n\n## 📋 Table of Contents\n\n- [Quick Start](#quick-start)\n- [Environment Setup](#environment-setup)\n- [API Endpoints](#api-endpoints)\n- [Development](#development)\n- [Testing](#testing)\n- [Deployment](#deployment)\n- [Logging](#logging)\n- [Security](#security)\n\n## 🚀 Quick Start\n\n### Prerequisites\n- Node.js 18+ \n- npm or yarn\n\n### Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/freifunk/videoodyssee-api.git\ncd videoodyssee-api\n\n# Install dependencies\nnpm install\n\n# Set up environment variables\ncp .env.example .env\n# Edit .env with your configuration\n\n# Start development server\nnpm run dev\n```\n\nThe API will be available at `http://localhost:8000`\n\n### Health Check\n```bash\ncurl http://localhost:8000/health\n```\n\n## 🔧 Environment Setup\n\nCreate a `.env` file with the following variables:\n\n```env\n# Server Configuration\nPORT=8000\nNODE_ENV=development\n\n# Authentication\nEMAIL=admin@videoodyssee.com\nPASSWORD=your-admin-password\nJWT_SECRET=your-super-secret-jwt-key\n\n# External Services\nVOCTOWEB_URL=https://media.ccc.de\nACCESS_KEY=your-pipeline-access-key\nAPI_KEY=your-api-key\nPIPELINE_URL=https://videopipeline.freifunk.net/go/api/pipelines/processing-pipeline/schedule\n```\n\n## 📡 API Endpoints\n\n### Authentication\n```http\nPOST /auth/login\nContent-Type: application/json\n\n{\n  \"email\": \"admin@videoodyssee.com\",\n  \"password\": \"your-password\"\n}\n```\n\n### Video Management\n```http\n# Submit new video\nPOST /video\nContent-Type: application/json\n\n{\n  \"title\": \"My Video\",\n  \"conference\": \"TestConf2024\",\n  \"language\": \"English\",\n  \"date\": \"2024-01-15\",\n  \"url\": \"https://example.com/video.mp4\",\n  \"name\": \"John Doe\",\n  \"email\": \"john@example.com\",\n  \"persons\": [\"Speaker 1\", \"Speaker 2\"],\n  \"tags\": [\"tech\", \"conference\"]\n}\n\n# List all videos\nPOST /video/list\n\n# Approve video\nPOST /video/approve\n{\n  \"id\": \"video-uuid\"\n}\n\n# Reject video  \nPOST /video/reject\n{\n  \"id\": \"video-uuid\"\n}\n```\n\n### Pipeline Triggers\n```http\nPOST /pipeline/trigger\nContent-Type: application/json\n\n{\n  \"title\": \"Video Title\",\n  \"event\": \"Conference Name\",\n  \"language\": \"English\",\n  \"date\": \"2024-01-15\",\n  \"url\": \"https://example.com/video.mp4\",\n  \"name\": \"Submitter Name\",\n  \"email\": \"submitter@example.com\",\n  \"persons\": [\"Speaker 1\", \"Speaker 2\"],\n  \"tags\": [\"tag1\", \"tag2\"]\n}\n```\n\n### Monitoring\n```http\nGET /health\n```\n\n## 🛠️ Development\n\n### Available Scripts\n\n```bash\n# Development with hot reload \u0026 colored logs\nnpm run dev\n\n# Production mode with JSON logs\nnpm start\n\n# Run tests\nnpm test\n\n# Run tests with coverage\nnpm run test:coverage\n\n# Run tests silently\nnpm run test:silent\n\n# Debug mode\nnpm run debug\n```\n\n### Development Workflow\n\n1. **Start development server:**\n   ```bash\n   npm run dev\n   ```\n\n2. **Run tests in watch mode:**\n   ```bash\n   npm test -- --watch\n   ```\n\n3. **Check test coverage:**\n   ```bash\n   npm run test:coverage\n   ```\n\n## 🧪 Testing\n\nComprehensive test suite with **26 tests** and **81% coverage**:\n\n```bash\n# Run all tests\nnpm test\n\n# Generate coverage report\nnpm run test:coverage\n\n# Run tests silently (useful for CI)\nnpm run test:silent\n```\n\n### Test Structure\n- **Unit Tests**: `tests/utils/`\n- **Route Tests**: `tests/routes/`\n- **Integration Tests**: Full API workflow testing\n\n## 🚀 Deployment\n\n### 🐳 Docker\n\n```dockerfile\nFROM node:18-alpine\nWORKDIR /app\nCOPY package*.json ./\nRUN npm ci --only=production\nCOPY . .\nEXPOSE 8000\nCMD [\"npm\", \"start\"]\n```\n\n### ☸️ Kubernetes\n\nDeploy with the provided manifests:\n\n```bash\nkubectl apply -f deployment/kubernetes/deployment.yaml\n```\n\nFeatures:\n- **3 replicas** for high availability\n- **Health checks** (liveness \u0026 readiness probes)\n- **Resource limits** (512Mi memory, 500m CPU)\n- **Secret management** for sensitive data\n- **ConfigMap** for configuration\n\n### 🖥️ systemd\n\nInstall as a system service:\n\n```bash\n# Copy service file\nsudo cp deployment/systemd/videoodyssee-api.service /etc/systemd/system/\n\n# Reload systemd and start service\nsudo systemctl daemon-reload\nsudo systemctl enable videoodyssee-api\nsudo systemctl start videoodyssee-api\n\n# View logs\njournalctl -u videoodyssee-api -f\n```\n\n### 🌐 Production Deployment\n\n```bash\n# Set production environment\nexport NODE_ENV=production\n\n# Install production dependencies only\nnpm ci --only=production\n\n# Start with process manager (PM2)\nnpm install -g pm2\npm2 start server.js --name videoodyssee-api\n\n# Or use the systemd service\nsudo systemctl start videoodyssee-api\n```\n\n## 📊 Logging\n\nProfessional logging with **Winston** - optimized for modern deployment environments:\n\n### Environment-Based Logging\n\n#### Development\n- **Colored output** for easy reading\n- **All log levels** (debug, info, warn, error)\n- **Timestamps** with milliseconds\n\n#### Production  \n- **Structured JSON** for log aggregation\n- **stdout/stderr** output (container-friendly)\n- **Exception handling** built-in\n\n#### Testing\n- **Minimal output** (errors only)\n- **Can be silenced** with `TEST_SILENT=true`\n\n### Log Levels\n\n```javascript\nlogger.error('❌ Critical error occurred');\nlogger.warn('⚠️ Warning message');\nlogger.info('✅ Information message');\nlogger.debug('🔍 Debug information');\n```\n\n### Log Aggregation\n\nPerfect for:\n- **ELK Stack** (Elasticsearch, Logstash, Kibana)\n- **Grafana Loki**\n- **Fluentd/Fluent Bit**\n- **systemd journald**\n\n## 🛡️ Security\n\n### Security Features\n- ✅ **0 vulnerabilities** in dependencies\n- ✅ **JWT authentication** with configurable secrets\n- ✅ **Input validation** on all endpoints  \n- ✅ **Error handling** without information leakage\n- ✅ **CORS** protection\n- ✅ **Rate limiting ready** (easily extensible)\n\n### Dependency Management\n- **Automated updates** with Renovate\n- **Regular security audits** with `npm audit`\n- **Minimal attack surface** with production-only dependencies\n\n### systemd Security (Production)\n- `NoNewPrivileges=true`\n- `PrivateTmp=true` \n- `ProtectSystem=strict`\n- `ProtectHome=true`\n\n## 🔄 CI/CD\n\n### GitHub Actions Ready\n\nThe project is structured for easy CI/CD integration:\n\n```yaml\n# Example workflow step\n- name: Run tests\n  run: npm test\n\n- name: Check security\n  run: npm audit\n\n- name: Check coverage\n  run: npm run test:coverage\n```\n\n## 📈 Monitoring\n\n### Health Check Endpoint\n\n```bash\ncurl http://localhost:8000/health\n```\n\nResponse:\n```json\n{\n  \"status\": \"healthy\",\n  \"timestamp\": \"2024-01-15T10:30:00.000Z\",\n  \"uptime\": 3600.123,\n  \"environment\": \"production\"\n}\n```\n\n### Kubernetes Probes\n\n- **Liveness Probe**: `/health` (checks if app is running)\n- **Readiness Probe**: `/health` (checks if app can serve traffic)\n\n## 🤝 Contributing\n\n1. **Fork** the repository\n2. **Create** a feature branch (`git checkout -b feature/amazing-feature`)\n3. **Run tests** (`npm test`)\n4. **Commit** changes (`git commit -m 'Add amazing feature'`)\n5. **Push** to branch (`git push origin feature/amazing-feature`)\n6. **Open** a Pull Request\n\n## 📝 License\n\nThis project is licensed under the ISC License - see the [LICENSE](LICENSE) file for details.\n\n## 👥 Authors\n\n- **andibraeu** - *Current maintainer* - Modernized and maintained the project\n- **Vijay Reddy** - *Original work* - [@0xVijayReddy](https://github.com/0xVijayReddy)\n\n## 🙏 Acknowledgments\n\n- Express.js community\n- Winston logging library\n- Jest testing framework\n- All contributors and testers\n\n---\n\n**🎉 Ready for production deployment with modern DevOps practices!**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreifunk%2Fvideoodyssee-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreifunk%2Fvideoodyssee-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreifunk%2Fvideoodyssee-api/lists"}