{"id":25171388,"url":"https://github.com/basemax/fileuploadexpressts","last_synced_at":"2025-05-05T20:42:45.771Z","repository":{"id":196328652,"uuid":"689019708","full_name":"BaseMax/FileUploadExpressTS","owner":"BaseMax","description":"This is a simple File Upload API built with Express.js and TypeScript. It allows users to upload and serve files, such as images or documents. You can customize this API for your specific needs and use it as a foundation for building file handling features in your applications.","archived":false,"fork":false,"pushed_at":"2025-04-09T14:04:26.000Z","size":1833,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-04T21:45:38.041Z","etag":null,"topics":["api","api-file-upload","api-restful","api-upload","express","express-javascript","express-js","express-ts","express-typescript","file-upload","file-upload-api","javascript","js","restful","ts","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BaseMax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-09-08T15:51:56.000Z","updated_at":"2025-04-09T14:04:25.000Z","dependencies_parsed_at":"2024-09-13T06:04:00.292Z","dependency_job_id":"60955f3a-2472-4c24-a5be-f3d275d8d852","html_url":"https://github.com/BaseMax/FileUploadExpressTS","commit_stats":null,"previous_names":["basemax/fileuploadexpressts"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FFileUploadExpressTS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FFileUploadExpressTS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FFileUploadExpressTS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FFileUploadExpressTS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BaseMax","download_url":"https://codeload.github.com/BaseMax/FileUploadExpressTS/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252573361,"owners_count":21770202,"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":["api","api-file-upload","api-restful","api-upload","express","express-javascript","express-js","express-ts","express-typescript","file-upload","file-upload-api","javascript","js","restful","ts","typescript"],"created_at":"2025-02-09T09:20:01.734Z","updated_at":"2025-05-05T20:42:45.748Z","avatar_url":"https://github.com/BaseMax.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# File Upload API using Express.js and TypeScript\n\nThis is a simple File Upload API built with Express.js and TypeScript. It allows users to upload and serve files, such as images or documents. You can customize this API for your specific needs and use it as a foundation for building file handling features in your applications.\n\n## Features\n\n- Upload files (images, documents, etc.) to the server.\n- Serve uploaded files to clients.\n- Error handling and validation for uploaded files.\n- TypeScript support for improved code quality.\n\n## Screenshots\n\n#### manage users file with minio(object storage)\n\n![](https://github.com/BaseMax/FileUploadExpressTS/blob/main/screenshots/Screenshot%20from%202023-09-27%2022-35-53.png)\n\n#### login user\n\n![](https://github.com/BaseMax/FileUploadExpressTS/blob/main/screenshots/Screenshot%20from%202023-09-27%2022-33-02.png)\n\n#### register new user\n\n![](https://github.com/BaseMax/FileUploadExpressTS/blob/main/screenshots/Screenshot%20from%202023-09-27%2022-33-31.png)\n\n#### upload file\n\n![](https://github.com/BaseMax/FileUploadExpressTS/blob/main/screenshots/Screenshot%20from%202023-09-27%2022-33-41.png)\n\n#### upload from link\n\n![](https://github.com/BaseMax/FileUploadExpressTS/blob/main/screenshots/Screenshot%20from%202023-09-27%2022-33-47.png)\n\n#### create directory\n\n![](https://github.com/BaseMax/FileUploadExpressTS/blob/main/screenshots/Screenshot%20from%202023-09-27%2022-33-59.png)\n\n#### leaderboard\n\n![](https://github.com/BaseMax/FileUploadExpressTS/blob/main/screenshots/Screenshot%20from%202023-09-27%2022-34-07.png)\n\n## Prerequisites\n\nBefore you begin, ensure you have met the following requirements:\n\n- Node.js and npm installed on your development machine.\n- Basic knowledge of Express.js and TypeScript.\n\n## Installation\n\n1. Clone this repository:\n\n   ```bash\n   git clone https://github.com/BaseMax/FileUploadExpressTS.git\n   ```\n\nNavigate to the project directory:\n\n```bash\ncd FileUploadExpressTS\n```\n\nInstall dependencies:\n\n```bash\nnpm install\n```\n\n## Usage\n\nStart the server:\n\n```bash\nnpm start\n```\n\nThe server will run on `http://localhost:3000` by default. You can customize the port and other settings in the configuration files.\n\nTo upload a file, make a POST request to /upload with a multipart/form-data body containing the file to be uploaded. You can use tools like curl, Postman, or any HTTP client library to interact with the API.\n\nExample using curl:\n\n```bash\ncurl -X POST -F \"file=@path/to/your/file.jpg\" http://localhost:3000/api/file/upload (with token HEADER)\n```\n\nReplace `path/to/your/file.jpg` with the path to the file you want to upload.\n\nThe uploaded file will be stored on the server (the default storage location is uploads/), and you will receive a response with information about the uploaded file, including its URL.\n\nTo access the uploaded file, make a GET request to the provided URL.\n\n## API Routes\n\n| #   | Route                                       | Description                                                     | Response Example                                      |\n| --- | ------------------------------------------- | --------------------------------------------------------------- | ----------------------------------------------------- |\n| 1   | `/api/auth/register`                        | Register a new user account.                                    | `{\"message\": \"User registered successfully\"}`         |\n| 2   | `/api/auth/login`                           | User login with credentials.                                    | `{\"token\": \"your-auth-token\", \"user\": {...}}`         |\n| 3   | `/api/auth/logout`                          | User logout.                                                    | `{\"message\": \"User logged out successfully\"}`         |\n| 4   | `/api/auth/reset-password`                  | Reset user password.                                            | `{\"message\": \"Password reset link sent\"}`             |\n| 5   | `/api/auth/forgot-password`                 | Forgot user password.                                           | `{\"message\": \"Password reset email sent\"}`            |\n| 6   | `/api/file/upload`                          | Upload a file.                                                  | `{\"message\": \"File uploaded successfully\"}`           |\n| 7   | `/api/directory`                            | Create a new directory.                                         | `{\"message\": \"Directory created successfully\"}`       |\n| 8   | `/api/file/move`                            | Move a file to a different location.                            | `{\"message\": \"File moved successfully\"}`              |\n| 9   | `/api/file/copy`                            | Copy a file to a different location.                            | `{\"message\": \"File copied successfully\"}`             |\n| 10  | `/api/file/upload-from-link`                | Upload a file from a URL/link.                                  | `{\"message\": \"File uploaded from link successfully\"}` |\n| 11  | `/api/file/search`                          | Search for files by name or metadata.                           | `[{\"id\": 1, \"name\": \"file1.jpg\", ...}, ...]`          |\n| 12  | `/api/file/stats/:id`                       | View download statistics for a file.                            | `{\"downloads\": 100}`                                  |\n| 13  | `/api/file/leaderboard/`                    | Get the leaderboard of hot links.                               | `[{\"file\": \"file1.jpg\", \"downloads\": 100}, ...]`      |\n| 14  | `/api/file/:id`                             | Download a specific file by ID.                                 | (File download response)                              |\n| 15  | `/api/file/:id`                             | Delete a specific file by ID.                                   | `{\"message\": \"File deleted successfully\"}`            |\n| 16  | `/api/file/rename/:id`                      | Rename a specific file by ID.                                   | `{\"message\": \"File renamed successfully\"}`            |\n| 17  | `/api/file/uploads`                         | View a list of user's uploaded files.                           | `[{\"file\": \"file1.jpg\", \"uploads\": 10}, ...]`         |\n| 18  | `/api/user/profile`                         | Get user profile information.                                   | `{\"id\": 1, \"username\": \"example\", ...}`               |\n| 19  | `/api/user/profile`                         | Update user profile information.                                | `{\"message\": \"Profile updated successfully\"}`         |\n| 20  | `/api/user/change-password`                 | Change user password.                                           | `{\"message\": \"Password changed successfully\"}`        |\n| 21  | `/api/user/delete-account`                  | Delete user account.                                            | `{\"message\": \"User account deleted successfully\"}`    |\n| 22  | `/api/user/downloads`                       | View a list of user's downloaded files.                         | `[{\"file\": \"file1.jpg\", \"downloads\": 5}, ...]`        |\n| 23  | `/api/user`                                 | View a list of all registered users (admin only).               | `[{\"id\": 1, \"username\": \"user1\", ...}, ...]`          |\n| 24  | `/api/file`                                 | View a list of all files (admin only).                          | `[{\"id\": 1, \"name\": \"file1.jpg\", ...}, ...]`          |\n| 25  | `/api/file/admin/stats/:id`                 | View statistics for a specific file (admin only).               | `{\"downloads\": 100}`                                  |\n| 26  | `/api/admin/user-stats/:id`                 | View statistics for a specific user (admin only).               | `{\"downloads\": 500, \"uploads\": 200}`                  |\n|     |\n| 27  | `/api/user/:id`                             | Delete a user account (admin only).                             | `{\"message\": \"User account deleted successfully\"}`    |\n| 28  | `/api/user`                                 | Create a new user account (admin only).                         | `{\"message\": \"User created successfully\"}`            |\n| 29  | `/api/file/admin/:id`                       | Delete a specific file by ID (admin only).                      | `{\"message\": \"File deleted successfully\"}`            |\n| 30  | `/api/admin/view-user-downloads/:id`        | View a list of a specific user's downloaded files (admin only). | `[{\"file\": \"file1.jpg\", \"downloads\": 5}, ...]`        |\n| 31  | `/api/admin/view-user-uploads/:id`          | View a list of a specific user's uploaded files (admin only).   | `[{\"file\": \"file1.jpg\", \"uploads\": 10}, ...]`         |\n| 32  | `/api/admin/change-user-password/:id`       | Change a user's password (admin only).                          | `{\"message\": \"User password changed successfully\"}`   |\n| 33  | `/api/directory`                            | View a list of all directories (admin only).                    | `[{\"id\": 1, \"name\": \"dir1\", ...}, ...]`               |\n| 34  | `/api/directory/view-directory-content/:id` | View the contents of a directory by ID (admin only).            | `[{\"id\": 1, \"name\": \"file1.jpg\", ...}, ...]`          |\n| 36  | `/api/directory/view-directory-stats/:id`   | View statistics for a directory by ID (admin only).             | `{\"files\": 10, \"subdirectories\": 5}`                  |\n| 37  | `/api/user/set-user-role/:id`               | Set the role of a user (admin only).                            | `{\"message\": \"User role set successfully\"}`           |\n\n## Configuration\n\nYou can customize the API's configuration by modifying the config.ts file. Here are some configuration options you can adjust:\n\n- `UPLOAD_DIR`: The directory where uploaded files are stored.\n- `PORT`: The port on which the server listens.\n\n## Contributing\n\nContributions are welcome! If you find a bug or have a suggestion for improvement, please open an issue or create a pull request.\n\n## License\n\nThis project is licensed under the MIT License. See the LICENSE file for details.\n\nRemember to replace placeholders like `http://localhost:3000` with your actual server URL and provide more specific usage instructions if needed. Additionally, update the `LICENSE` file with the appropriate license for your project.\n\nCoypright 2023, Max Base\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Ffileuploadexpressts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbasemax%2Ffileuploadexpressts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Ffileuploadexpressts/lists"}