A web application that generates unique digital artwork based on real-time weather data from Ottawa, Canada, and Tokyo, Japan. Built with open-source tools including p5.js for generative art and Node.js for the backend.
- π€οΈ Real-time weather data from Ottawa and Tokyo
- π¨ Unique generative artwork created in the browser using p5.js
- π§ Email delivery of artwork as PNG attachment
- π± Responsive design for all devices
- π Generate multiple variations of artwork
- Frontend: HTML5, CSS3, JavaScript, p5.js
- Backend: Node.js, Express.js
- APIs: OpenWeatherMap (weather data)
- Email: Nodemailer (Gmail SMTP)
- Hosting: Vercel/Netlify (free tier)
- Node.js (v14 or higher)
- npm or yarn
- OpenWeatherMap API key (free at openweathermap.org)
- Gmail account with App Password enabled
# Clone or download the project
cd weather-art-app
# Install dependencies
npm install
# Copy environment template
cp .env.example .envEdit the .env file with your credentials:
# Get your free API key from openweathermap.org
OPENWEATHER_API_KEY=your_api_key_here
# Gmail configuration (use App Password, not regular password)
EMAIL_USER=your_email@gmail.com
EMAIL_PASS=your_app_password_here
EMAIL_FROM=your_email@gmail.com
# Server configuration
PORT=3000
NODE_ENV=development
DOMAIN_URL=http://localhost:3000- Enable 2-factor authentication on your Gmail account
- Go to Google Account settings > Security > App passwords
- Generate a new app password for "Mail"
- Use this password in your
.envfile
# Development mode (with auto-restart)
npm run dev
# Production mode
npm startVisit http://localhost:3000 to see the application.
# Install Node.js if not already installed
brew install node
# Navigate to project directory
cd weather-art-app
# Install dependencies
npm install
# Start the server
npm startIf you prefer using MAMP:
- Place the project files in your MAMP
htdocsdirectory - Install Node.js dependencies:
npm install - Start MAMP and run:
node server.js - Access via
http://localhost:8888(MAMP port)
- Install Vercel CLI:
npm i -g vercel - Run
vercelin project directory - Follow prompts to deploy
- Add environment variables in Vercel dashboard
- Connect your custom domain in Vercel settings
- Build the project (if needed)
- Drag and drop the project folder to Netlify
- Configure environment variables
- Connect your custom domain
weather-art-app/
βββ public/
β βββ index.html # Main HTML file
β βββ app.js # Main application logic
β βββ artwork.js # p5.js artwork generation
βββ server.js # Express server
βββ package.json # Dependencies
βββ .env.example # Environment template
βββ README.md # This file
- Weather Data: Fetches real-time weather from OpenWeatherMap API for Ottawa and Tokyo
- Art Generation: Uses p5.js to create unique artwork based on weather parameters:
- Temperature affects curve patterns
- Humidity controls particle density
- Wind speed influences line patterns
- Weather conditions determine colors and shapes
- Email Delivery: Converts artwork to PNG and sends as email attachment
Edit server.js to add more cities:
const cities = [
{ name: 'Ottawa', country: 'CA' },
{ name: 'Tokyo', country: 'JP' },
{ name: 'London', country: 'GB' }
];Edit artwork.js to change the generative art algorithms:
- Modify
drawWeatherPatterns()for different visual styles - Adjust
getWeatherColor()for different color schemes - Add new shape functions in
drawCityPattern()
- Weather API Error: Check your OpenWeatherMap API key
- Email Not Sending: Verify Gmail App Password setup
- CORS Issues: Ensure server is running on correct port
- Canvas Not Loading: Check browser console for p5.js errors
- Chrome/Edge: Full support
- Firefox: Full support
- Safari: Full support
- Mobile browsers: Responsive design included
MIT License - Feel free to use and modify for your projects.
This is an open-source project. Feel free to:
- Report bugs
- Suggest new features
- Submit pull requests
- Share your artwork variations
For issues or questions:
- Check the troubleshooting section
- Review browser console for errors
- Verify all environment variables are set correctly
- Test with a simple email first