A modern web application that showcases surreal paintings from WikiArt, featuring a decoupled architecture with Go backend API and static frontend.
- Surreal Art Gallery: Browse beautiful surreal paintings from WikiArt
- Pinterest-style Layout: Responsive masonry grid with image overlays
- API-driven: RESTful Go backend with Redis caching
- Modern Frontend: HTML/CSS/JavaScript with Masonry.js and ImagesLoaded
- Docker Ready: Containerized deployment with Docker Compose
- Production Deployed: Backend on Render, Frontend on Vercel
- Backend: Go (net/http), Redis caching, WikiArt API integration
- Frontend: Vanilla JavaScript, HTML5, CSS3, Masonry.js
- Deployment: Docker, Docker Compose, Render (backend), Vercel (frontend)
- Database: Redis for API response caching
- Go 1.20+
- Docker & Docker Compose
- Redis (local or cloud)
-
Clone the repository
git clone https://github.com/kwabsntim/surreal-artz.git cd surreal-artz -
Environment Setup
# Copy environment template cp .env.example .env # Edit .env with your Redis credentials REDIS_ADDR=localhost:6379 REDIS_USERNAME=default # optional REDIS_PASSWORD=your_password
-
Run with Docker Compose
docker-compose up --build
-
Access the application
- Frontend: http://localhost:8080
- API: http://localhost:8080/paintings
-
Start Redis
docker run --name redis -p 6379:6379 -d redis:7-alpine
-
Run the Go server
go mod tidy go run ./cmd
Fetch paginated surreal paintings.
Parameters:
style(optional): Art style (default: "surrealism")page(optional): Page number (default: 1)limit(optional): Items per page (default: 10, max: 100)
Example:
curl "http://localhost:8080/paintings?style=surrealism&page=1&limit=20"Response:
[
{
"id": "painting-id",
"title": "The Persistence of Memory",
"artistName": "Salvador Dalí",
"yearAsString": "1931",
"image": "https://example.com/painting.jpg"
}
]surreal-artz/
├── cmd/
│ └── server.go # HTTP server entry point
├── internal/
│ └── wikiartz/
│ ├── interface.go # Service interfaces
│ ├── models.go # Data models
│ └── service.go # WikiArt API integration
├── utils/
│ ├── parser.go # Pagination utilities
│ └── redis.go # Redis client wrapper
├── web/ # Static frontend files
│ ├── index.html
│ ├── style.css
│ ├── app.js
│ └── config.js
├── Dockerfile
├── docker-compose.yml
├── go.mod
└── README.md
- Connect your GitHub repo to Render
- Set build command:
go build -o server ./cmd - Set start command:
./server - Add environment variables:
REDIS_ADDR: Your Redis Cloud URLREDIS_USERNAME: defaultREDIS_PASSWORD: Your Redis password
- Import the repo to Vercel
- Set root directory:
web - Deploy (Vercel detects static site automatically)
- Update
web/index.htmlwith your Render backend URL
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the Creative Commons Attribution 4.0 International License.
You are free to:
- Share — copy and redistribute the material in any medium or format
- Adapt — remix, transform, and build upon the material for any purpose, even commercially
Under the following terms:
- Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made.
See the LICENSE file for full license text.
- WikiArt for the amazing art collection
- Masonry.js for the grid layout
- ImagesLoaded for image loading detection
Enjoy exploring surreal art! 🎨