{"id":21199088,"url":"https://github.com/atomostechhq/ap-efss","last_synced_at":"2025-10-07T07:19:00.949Z","repository":{"id":251032975,"uuid":"835871239","full_name":"atomostechhq/ap-efss","owner":"atomostechhq","description":"An enterprise file storage service for storing the static files on the internet.","archived":false,"fork":false,"pushed_at":"2024-10-19T18:29:25.000Z","size":36,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-14T22:23:51.630Z","etag":null,"topics":["file","file-upload","filestorage"],"latest_commit_sha":null,"homepage":"https://static.miratsapiservices.com/uploads/README.pdf","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/atomostechhq.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}},"created_at":"2024-07-30T17:33:50.000Z","updated_at":"2024-07-31T11:04:10.000Z","dependencies_parsed_at":"2025-01-21T14:43:19.534Z","dependency_job_id":"12c1ec7e-0d64-4b35-8499-4571114d789e","html_url":"https://github.com/atomostechhq/ap-efss","commit_stats":null,"previous_names":["atomostechhq/ap-efss"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/atomostechhq/ap-efss","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomostechhq%2Fap-efss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomostechhq%2Fap-efss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomostechhq%2Fap-efss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomostechhq%2Fap-efss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atomostechhq","download_url":"https://codeload.github.com/atomostechhq/ap-efss/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomostechhq%2Fap-efss/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278736770,"owners_count":26036856,"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-07T02:00:06.786Z","response_time":59,"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":["file","file-upload","filestorage"],"created_at":"2024-11-20T19:56:54.848Z","updated_at":"2025-10-07T07:19:00.888Z","avatar_url":"https://github.com/atomostechhq.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Atomos AP EFSS\n\nAtomos AP EFSS (Enterprise File Storage System) is a Node.js application for securely uploading and serving static assets in a structured directory system. This application supports API key authentication for secure file uploads and serves files publicly via URLs. It also leverages Nginx for caching to ensure fast file serving.\n\n## Features\n\n- Secure file uploads with API key authentication\n- Structured directory system (company-wise and content-wise)\n- Supports multiple file types (PDF, TXT, XLSX, PNG, JPEG, SVG, etc.)\n- Public access to files via URLs\n- Nginx caching for fast file serving\n\n## Installation\n\n### Prerequisites\n\n- Node.js and npm installed\n- Nginx installed\n- A Google Cloud Platform (GCP) VM instance (optional, for deployment)\n\n### Clone the Repository\n\n```sh\ngit clone https://github.com/atomostechhq/atomos-ap-efss.git\ncd atomos-ap-efss\n```\n\n### Install Dependencies\n\n```sh\nnpm install\n```\n\n### Environment Configuration\n\nCreate a `.env` file in the root directory with the following content:\n\n```env\nPORT=3000\nUPLOAD_DIR=uploads\nAPI_KEY=your-secure-api-key\n```\n\nReplace `your-secure-api-key` with a secure API key of your choice.\n\n## Usage\n\n### Running the Application\n\nTo start the application, run:\n\n```sh\nnode src/app.js\n```\n\nThe server will start on the port specified in your `.env` file (default is 3000).\n\n### Uploading Files\n\nYou can upload files using a tool like Postman or `curl`. The API endpoint for file uploads requires an API key for authentication.\n\nExample `curl` command:\n\n```sh\ncurl -H \"x-api-key: your-secure-api-key\" \\\n     -F \"company=CompanyA\" \\\n     -F \"contentType=pdf\" \\\n     -F \"filename=customName.pdf\" \\\n     -F \"file=@path/to/your/file.pdf\" \\\n     http://localhost:3000/api/files/upload\n```\n\nIf `filename` is not provided, the original file name will be used.\n\n### Retrieving Files\n\nFiles can be retrieved by navigating to their URL in the browser. The URL structure is as follows:\n\n```\nhttp://localhost:3000/uploads/\u003ccompany\u003e/\u003ccontentType\u003e/\u003cfileName\u003e\n```\n\nExample:\n\n```\nhttp://localhost:3000/uploads/CompanyA/pdf/customName.pdf\n```\n\n## Nginx Configuration for Caching\n\nTo enable caching and improve file serving speed, you can configure Nginx as a reverse proxy.\n\n### Install Nginx\n\n```sh\nsudo apt update\nsudo apt install nginx\n```\n\n### Configure Nginx\n\nCreate a new Nginx configuration file:\n\n```sh\nsudo nano /etc/nginx/sites-available/atomos-ap-efss\n```\n\nAdd the following content to the file:\n\n```nginx\nserver {\n    listen 80;\n    server_name your_domain_or_ip;\n\n    location / {\n        proxy_pass http://localhost:3000;\n        proxy_http_version 1.1;\n        proxy_set_header Upgrade $http_upgrade;\n        proxy_set_header Connection 'upgrade';\n        proxy_set_header Host $host;\n        proxy_cache_bypass $http_upgrade;\n    }\n\n    location /uploads/ {\n        alias /path/to/your/uploads/;\n        expires 30d;\n        add_header Cache-Control \"public\";\n        access_log off;\n    }\n}\n```\n\nReplace `/path/to/your/uploads/` with the actual path to your uploads directory.\n\n### Enable the Configuration\n\nCreate a symbolic link to enable the new configuration:\n\n```sh\nsudo ln -s /etc/nginx/sites-available/atomos-ap-efss /etc/nginx/sites-enabled/\n```\n\n### Test the Configuration\n\nTest the Nginx configuration for syntax errors:\n\n```sh\nsudo nginx -t\n```\n\n### Restart Nginx\n\nRestart Nginx to apply the changes:\n\n```sh\nsudo systemctl restart nginx\n```\n\n## Deployment on GCP VM Instance\n\nTo deploy the application on a Google Cloud Platform (GCP) VM instance, follow these steps:\n\n1. **Create a VM Instance**: Create a new VM instance on GCP with the desired specifications.\n\n2. **Install Node.js and Nginx**: SSH into your VM instance and install Node.js and Nginx.\n\n3. **Clone the Repository and Install Dependencies**:\n\n   ```sh\n   git clone https://github.com/yourusername/atomos-ap-efss.git\n   cd atomos-ap-efss\n   npm install\n   ```\n\n4. **Configure Environment Variables**: Create a `.env` file with your configuration.\n\n5. **Start the Application**: Run the application.\n\n6. **Configure Nginx**: Set up Nginx as described in the Nginx Configuration section.\n\n7. **Open Necessary Ports**: Ensure that the necessary ports (e.g., 80 for HTTP) are open in your GCP firewall settings.\n\n## License\n\nThis project is licensed under the MIT License. See the LICENSE file for details.\n\n## Contributing\n\nContributions are welcome! Please submit a pull request or open an issue to discuss improvements or bugs.\n\n## Acknowledgments\n\n- Inspired by the need for a robust enterprise file storage system.\n- Built with love by the Atomos AP EFSS team.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomostechhq%2Fap-efss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatomostechhq%2Fap-efss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomostechhq%2Fap-efss/lists"}