Skip to content

pixels-to-cloud is a photo-editor app that aims to inspire developers to create high-performance, scalable, distributed systems.

License

Notifications You must be signed in to change notification settings

digitalocean/pixels-to-cloud

Repository files navigation

pixels-to-cloud

pixels-to-cloud is a photo-editor app that aims to inspire developers to create high-performance, scalable, distributed systems. By leveraging technologies such as gRPC and DigitalOcean Object Storage (Spaces), this project showcases the potential of modern tech stacks to build robust and efficient application architectures.

Here is the overview of the architecture:

arch

Prerequisites

Setting Up DigitalOcean Spaces & Rclone

To create three DigitalOcean Spaces instances in NYC, AMS, and SYD, follow these steps:

  1. Log in to Your DigitalOcean Account:

  2. Navigate to Spaces Object Storage:

  3. Create Spaces across three Data Centers:

    • Choose data center regions:
      • NYC: "New York(nyc3)"
      • AMS: "Amsterdam(ams3)"
      • SYD: "Sydney(syd1)"
    • Name your Spaces (e.g., pixbox-nyc, pixbox-ams, pixbox-syd).
    • Adjust settings as needed and click "Create a Spaces Bucket".
    • For more details, refer to the DigitalOcean Spaces Documentation.
  4. Generate Spaces Access Keys:

    • Go to the API section to generate new Spaces Keys.
    • Copy the Access Key and Secret Key and store them securely.
  5. Configure Spaces Access using Rclone:

    • Run rclone config to set up the rclone configuration
    • Your configuration file should be similar to the one below:
    # Rclone configuration example
    [pixbox-ams]
    type = s3
    provider = DigitalOcean
    env_auth = false
    access_key_id = <Access Key>
    secret_access_key = <Secret>
    endpoint = ams3.digitaloceanspaces.com
    acl = 
    
    [pixbox-syd]
    type = s3
    provider = DigitalOcean
    env_auth = false
    access_key_id = <Access Key>
    secret_access_key = <Secret>
    endpoint = syd1.digitaloceanspaces.com
    acl = 
    
    [pixbox-nyc]
    type = s3
    provider = DigitalOcean
    env_auth = false
    access_key_id = <Access Key>
    secret_access_key = <Secret>
    endpoint = nyc3.digitaloceanspaces.com
    acl = 

Run the demo

git clone https://github.com/digitalocean/pixels-to-cloud.git
cd pixels-to-cloud

There are three main components:

For ease of usage, we have created a Makefile with all the necessary commands to build/run the project.

Start the Server

# The server will start listening on localhost:9001
make run
# The above make command translates to
cargo run --release --bin server

Start the Rclone Synchronizer

./scripts/spaces-sync.sh <path to the directory to be synced>
# Example
./scripts/spaces-sync.sh ./images/edited 

Using the Client

# The client is used to upload the image to be edited to the server.
make upload
# The above make command translates to
cargo run --bin client upload --imgpath </path/to/your/image>

Acknowledgments

References

About

pixels-to-cloud is a photo-editor app that aims to inspire developers to create high-performance, scalable, distributed systems.

Topics

Resources

License

Security policy

Stars

Watchers

Forks