A schema-driven image gallery built with React, GraphQL, and AWS.
- Dynamic Schema-Driven UI – Easily modify layout & actions via JSON schema.
- GraphQL API – Optimized image queries and mutations.
- AWS Cloud Integration – S3 for image storage, DynamoDB for metadata, EC2 for backend.
You can access the live version of the gallery hosted on AWS at the following URL: Cloud Image Gallery
Prerequisites Node.js, Yarn
- Clone the repo and navigate to
server/
- Install dependencies:
yarn install
- Start the server:
yarn start
- Test GraphQL Api at:
http://localhost:4000/graphql
- Navigate to
client/
- Install dependencies:
yarn install
- Start the frontend:
yarn dev
- Open
http://localhost:5173
in the browser.
The application is deployed on AWS using S3, EC2, DynamoDB, and CloudFront.
GitHub Actions triggers deploy on every push to main
:
- Frontend → Uploaded to S3 + CloudFront cache invalidation.
- Backend → Deployed to EC2 via SSH.
The UI structure is controlled by schema.json
, which defines how images are displayed and interacted with.
{
"layout": {
"type": "grid",
"spacing": 4,
"columns": 3
},
"actions": [
{
"name": "Like",
"icon": "Favorite",
"action": "toggleLike",
"color": "error"
},
{
"name": "Feature",
"icon": "Star",
"action": "toggleFeature",
"color": "warning"
},
{
"name": "Delete",
"icon": "Delete",
"action": "deleteImage",
"color": "default"
}
]
}
Modifying schema.json changes UI layout & behavior without altering code!
The GraphQL API enables interaction with the gallery by retrieving image metadata from DynamoDB and updating the stored information.
query GetImages {
schema {
layout {
type
spacing
}
actions {
name
icon
action
color
}
}
images {
id
src
alt
likes
isFeatured
}
}
mutation AddLike($id: ID!) {
addLike(id: $id) {
id
likes
}
}
mutation RemoveLike($id: ID!) {
removeLike(id: $id) {
id
likes
}
}
mutation DeleteImage($id: ID!) {
deleteImage(id: $id)
}
mutation MarkFeatured($id: ID!) {
markFeatured(id: $id) {
id
isFeatured
}
}
All mutations update the DynamoDB table, ensuring the metadata remains consistent across sessions.