Dropzone is streamlined and simple to use image repository service.
- Secure uploading and storing of images
- Clean deletions of stored images
🌟 NEW
Friendly URL Generation upon upload
This REST API service is live and hosted on https://us-central1-dropzone-dev.cloudfunctions.net/api
Below are instructions to use and customize locally.
Follow the steps below to use this app locally.
- Clone the repo by running
git clone https://github.com/harshhpaatel/dropzone.git
- Run
cd functions
Runs the app in the development mode.
Use the endpoint localhost:5003
Running this command will start nodemon where the server will restart if you make edits.
Launches the test runner.
Launches the firebase emulator for the app. Use the endpoint localhost:5001/dropzone-dev/us-central1/api
Additionally, to successfully run this code locally, you will need to create a file config/keys.js
as follows:
module.exports = {
CLOUDINARY_CLOUD_NAME: "_CLOUD_NAME",
CLOUDINARY_API_KEY: "_API_KEY",
CLOUDINARY_API_SECRET: "_API_SECRET",
};
GET /images/status
- Returns the health status of the image service.
POST /images
- This will upload the included image to the service. Send a payload of
{ image: PATH_TO_IMAGE }
. Optionally include propertypublic_id
to explicitly define the image id. Otherwise, a random generated id will be assigned to the image.
DELETE /images/:public_id
- This will delete the image with id
public_id
.
This project uses mocha to test the health and functionality of various API endpoints. Run the tests by running npm test
. Here is an example successful execution of tests:
- Integrate Firebase Authentication to assign image owners.
- Implement user permission features.
- Allow users to upload/delete multiple images by passing an array of id's.
- Allow users to use a custom domain for the friendly url.
- Add more thorough testing.