{"id":28926481,"url":"https://github.com/triple-ade/thryx-backend","last_synced_at":"2025-09-07T15:33:37.962Z","repository":{"id":292805267,"uuid":"981980534","full_name":"TRIPLE-ADE/thryx-backend","owner":"TRIPLE-ADE","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-12T07:59:37.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-12T08:59:15.219Z","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/TRIPLE-ADE.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}},"created_at":"2025-05-12T07:41:22.000Z","updated_at":"2025-05-12T07:59:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"4ae44169-3534-46bc-b411-6f87b76c5af5","html_url":"https://github.com/TRIPLE-ADE/thryx-backend","commit_stats":null,"previous_names":["triple-ade/thryx-backend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TRIPLE-ADE/thryx-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TRIPLE-ADE%2Fthryx-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TRIPLE-ADE%2Fthryx-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TRIPLE-ADE%2Fthryx-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TRIPLE-ADE%2Fthryx-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TRIPLE-ADE","download_url":"https://codeload.github.com/TRIPLE-ADE/thryx-backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TRIPLE-ADE%2Fthryx-backend/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261289433,"owners_count":23136071,"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","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-06-22T12:10:58.734Z","updated_at":"2025-09-07T15:33:37.938Z","avatar_url":"https://github.com/TRIPLE-ADE.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Adaptive File Upload API\n\nThis project provides an Express.js server with an adaptive file upload endpoint. It automatically chooses between in-memory and disk storage for uploaded files based on system memory usage and file size, then uploads the file to the Google Gemini Files API.\n\n## Features\n- **Adaptive Storage:** Uses memory for small files and low memory usage, disk for large files or high memory pressure.\n- **CORS Protection:** Only allows requests from trusted origins.\n- **Performance Monitoring:** Logs request durations and upload details.\n- **Automatic Cleanup:** Ensures temporary files are deleted after processing.\n\n## Requirements\n- Node.js (v16 or newer recommended)\n- A Google Gemini API key\n\n## Setup\n1. **Clone the repository:**\n   ```bash\n   git clone \u003cyour-repo-url\u003e\n   cd \u003cyour-repo-directory\u003e\n   ```\n2. **Install dependencies:**\n   ```bash\n   npm install\n   ```\n3. **Configure environment variables:**\n   - Create a `.env` file in the root directory:\n     ```env\n     GOOGLE_API_KEY=your-google-gemini-api-key\n     ```\n\n## Usage\n1. **Start the server:**\n   ```bash\n   npm start\n   # or\n   node app.js\n   ```\n2. **Upload a file:**\n   - Send a `POST` request to `/upload` with a file in the `file` field (multipart/form-data).\n   - Example using `curl`:\n     ```bash\n     curl -F \"file=@/path/to/your/file.pdf\" http://localhost:3000/upload\n     ```\n   - The server will respond with a JSON object containing the Gemini API upload result.\n\n## Environment Variables\n- `GOOGLE_API_KEY`: Your Google Gemini API key (required).\n\n## Notes\n- The server will automatically create an `uploads` directory if it does not exist.\n- Files are deleted from disk after being uploaded to Gemini, regardless of storage type.\n- CORS is restricted to a set of allowed origins (see `allowedOrigins` in `app.js`).\n\n## License\nMIT ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftriple-ade%2Fthryx-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftriple-ade%2Fthryx-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftriple-ade%2Fthryx-backend/lists"}