{"id":20615123,"url":"https://github.com/starlingvibes/cloud-bs","last_synced_at":"2026-04-10T00:04:05.530Z","repository":{"id":190037128,"uuid":"681817881","full_name":"starlingvibes/cloud-bs","owner":"starlingvibes","description":"The Cloud Backup API is a backend service that powers a cloud backup system. It allows users to securely create accounts and manage their backups in the cloud. This API is built using Google Cloud, Redis, ExpressJS, NodeJS, PostgreSQL, TypeScript and Jest for testing.","archived":false,"fork":false,"pushed_at":"2023-12-28T22:34:48.000Z","size":812,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-17T04:16:24.209Z","etag":null,"topics":["express-js","google-cloud","nodejs","postgresql","redis"],"latest_commit_sha":null,"homepage":"https://cloud-backup.onrender.com","language":"TypeScript","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/starlingvibes.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}},"created_at":"2023-08-22T20:27:50.000Z","updated_at":"2023-08-27T16:57:49.000Z","dependencies_parsed_at":"2023-08-23T00:55:27.216Z","dependency_job_id":"bc31189b-fe1f-4147-bbc5-5d944e838d9c","html_url":"https://github.com/starlingvibes/cloud-bs","commit_stats":{"total_commits":37,"total_committers":1,"mean_commits":37.0,"dds":0.0,"last_synced_commit":"a25aad2067582e4a56061232247627bf43a97764"},"previous_names":["starlingvibes/cloud-bs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starlingvibes%2Fcloud-bs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starlingvibes%2Fcloud-bs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starlingvibes%2Fcloud-bs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starlingvibes%2Fcloud-bs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/starlingvibes","download_url":"https://codeload.github.com/starlingvibes/cloud-bs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242269117,"owners_count":20100071,"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":["express-js","google-cloud","nodejs","postgresql","redis"],"created_at":"2024-11-16T11:14:25.154Z","updated_at":"2025-12-30T19:05:20.072Z","avatar_url":"https://github.com/starlingvibes.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\n\n# Cloud Backup Service API\n\nThe Cloud Backup API is a backend service that powers a cloud backup system. It allows users to securely create accounts and manage their backups in the cloud. This API is built using Google Cloud, Redis, ExpressJS, NodeJS, PostgreSQL, TypeScript and Jest for testing.\n\n## Features\n\n- User and admin registration: users and admins can create accounts with their full name, email address and password.\n- User and admin login: users and admins can login to their accounts with their email address and password.\n- Upload files: users can upload files (including photos and videos) of not more than 200MB.\n- Stream photos and videos: Users can stream photos and videos from the cloud.\n- Download files: users can download the files they uploaded to the bucket.\n- View upload history: users can view their upload history.\n- Delete files: users can delete files they created.\n- View files: users can view all the files they created.\n- View all upload history: Admins can view the upload history of the entire application.\n- View all files: admins can view all the files of the entire application.\n- Delete unsafe files: admins can delete files created by any user that are deemed unsafe.\n- Secure Backup Storage: user files are securely stored on the cloud.\n- API Testing: Comprehensive unit tests are implemented using Jest.\n\n\n## API Endpoints\n### Authentication (users and admins)\n- `POST /api/v1/auth/register`: Register a new user account, admin accounts require a secret token.\n- `POST /api/v1/auth/login`: Log in using email and password for both users and admins.\n- `PUT /api/v1/auth/revoke/:userId`: Allows the Admin to revoke the session of a user\n\n### User   functionalities\n- `POST /api/v1/storage/upload`: Upload a file to the backup service\n- `POST /api/v1/storage/create-folder`: Create a folder for storing files in the bucket\n- `POST /api/v1/storage/upload`: Upload a file to a specified folder\n- `GET /api/v1/storage/download/:fileName`: Download a file from the storage bucket\n- `GET /api/v1/storage/download/:folderName/:fileName`: Download a file from a specified folder \n- `GET /api/v1/storage/list`: Get all files created by the user \n- `DELETE /api/v1/storage/delete/:fileName`: Delete file created by the user \n- `GET /api/v1/history/:userId`: Get the file upload history of the user\n- `POST /api/v1/storage/compress`: Compress files and store them on the server\n\n### Admin   functionalities\n- `DELETE /api/v1/storage/delete/:fileName`: Delete a file from the storage bucket\n- `GET /api/v1/storage/fetch-files`: Get all files stored on the bucket\n- `GET /api/v1/storage/`: Get the history of all files uploaded to the bucket\n- `GET /api/v1/history/:userId`: Get the file upload history of a given user\n- `POST /api/v1/storage/mark-unsafe/:id`: Mark a file as unsafe\n \n## Database Setup:\n\n   - Launch a PostgreSQL shell and login using `psql -U \u003cusername\u003e`.\n   - Create a new database using `CREATE DATABASE \"cloud_backup\";`.\n   - Connect to the database using `\\c cloud_backup`.\n   - Start the server, it will automatically describe the necessary tables\n\n## Prerequisites\n\n- Node.JS (v14.^.^ or higher)\n- PostgreSQL database\n- Postman for testing the API\n- Redis for caching\n- Docker for containerization\n\n## Installation\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/starlingvibes/cloud-bs.git\n```\n\n2. Navigate to the project directory:\n\n```bash\ncd cloud-bs\n```\n\n3. Install dependencies:\n\n```bash\nyarn add package.json\n```\n\n4. Create a `.env` file in the project root and set the following environment variables:\n\n```env\n# server settings\nPORT=8000\n\n# database settings\nDB_HOST=\nDB_USERNAME=\nDB_PASSWORD=\nDB_NAME=cloud_backup\n\n# redis configuration\nREDIS_HOST=\nREDIS_PASSWORD=\nREDIS_PORT=\nREDIS_URL=\n\n# application secrets\nJWT_SECRET_USER=\nJWT_SECRET_ADMIN=\nADMIN_TOKEN=\n```\n\n5. Set up your PostgreSQL database with the provided configuration.\n\n6. Create a Google Cloud Storage bucket and download the JSON credentials file. Save it as `storage-keys.json` in the project root directory.\n\n7. Create a Redis instance and set the environment variables in the `.env` file.\n\n8. Start the server:\n\n```bash\nyarn start:dev\n```\n\n\n## Testing\n\nThe API includes unit tests implemented using Jest.\n\nTo run tests:\n\n```bash\nyarn test\n```\n\n## Dockerization \n\nThe API is containerized using Docker. A Dockerfile is provided in the repository. To build and run the Docker container:\n\n```bash\ndocker build -t cloud-bs .\ndocker run -p 13000:8000 -d cloud-bs\n```\n\n## Postman Collection\n\nYou can find a Postman collection with example API requests in the `src/postman` directory. Import this collection into Postman to test the API endpoints.\n\n## Contributing\n\nContributions to this project are welcome! Feel free to submit issues and pull requests.\nFor any inquiries or questions, feel free to contact [dera@ieee.org](mailto:dera@ieee.org).\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstarlingvibes%2Fcloud-bs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstarlingvibes%2Fcloud-bs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstarlingvibes%2Fcloud-bs/lists"}