This project demonstrates how to use the Cloudinary Community Astro SDK to create a photo album app.
The sample project showcases the following functionality:
- Using the Upload Widget to upload images to your product environment
- Using the REST API to upload images to your product environment
- Transforming and displaying images
Create an unsigned upload preset in your Cloudinary product environment and make a note of the name of the unsigned upload preset as well as your Cloudinary cloud name.
Create a .env
file with the following content at the root of the project:
PUBLIC_CLOUDINARY_CLOUD_NAME="your-cloud-name"
PUBLIC_CLOUDINARY_UPLOAD_PRESET="your-unsigned-upload-preset"
CLOUDINARY_API_KEY="your-cloudinary-api-key"
CLOUDINARY_API_SECRET="your-cloudinary-api-secret"
CLOUDINARY_TAG="myphotoalbum-astro"
From your terminal, in the root folder of your project, run:
npm i
npm run dev
Then, click the localhost link to open the app in your browser, or open a browser and navigate to localhost:4321 or to the port displayed in the terminal.
Try uploading images using each of the upload tabs, then see your images displayed in the Photo Album tab.
- Take a look at the source code to understand how it works.
- Discover more features in the Cloudinary Docs.
- If you have further questions open a GitHub Issue, or raise a support request.
Feel free to fork this repo as a starting point for your own Astro app, contribute to it, or star it if you like it!