A modern smart home dashboard application with photo slideshow capabilities, built with React and FastAPI.
This application consists of two main components:
git clone https://github.com/anmalkov/umbrella.git
cd umbrella/dashboard
# Navigate to backend directory
cd backend
# Create virtual environment
python -m venv venv
# Activate virtual environment
# Windows:
venv\Scripts\activate
# macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Start the backend server
python main.py
The backend will be available at http://localhost:8081
# Navigate to frontend directory (in a new terminal)
cd frontend
# Install dependencies
npm install
# Create environment file
echo "REACT_APP_API_URL=http://localhost:8081" > .env
# Start the frontend server
npm start
The frontend will be available at http://localhost:3000
umbrella/dashboard/
โโโ backend/ # FastAPI backend
โ โโโ config/ # Room configurations
โ โ โโโ rooms/ # Room-specific config files
โ โ โโโ kitchen.json # Example room config
โ โโโ photos/ # Photo storage
โ โ โโโ kitchen/ # Room-specific photos
โ โโโ tests/ # Backend tests
โ โโโ main.py # FastAPI application
โ โโโ requirements.txt # Python dependencies
โ โโโ api-test.http # HTTP test requests
โโโ frontend/ # React frontend
โ โโโ public/ # Static assets
โ โโโ src/
โ โ โโโ components/ # UI components
โ โ โโโ hooks/ # Custom React hooks
โ โ โโโ layout/ # Layout components
โ โ โโโ slideshow/ # Slideshow functionality
โ โ โโโ utils/ # Utility functions
โ โ โโโ widgets/ # Widget components
โ โโโ package.json # Frontend dependencies
โ โโโ tailwind.config.js # Tailwind configuration
โโโ README.md # This file
Create room configurations in backend/config/rooms/{room_id}.json:
{
"roomId": "kitchen",
"widgets": [
{
"type": "time",
"title": "Current Time",
"showTime": true,
"timezone": "UTC",
"timeFormat": "HH:mm:ss",
"showDate": true,
"dateFormat": "dddd, MMMM DD",
"position": { "x": 0, "y": 0, "w": 2, "h": 1 }
},
{
"type": "slideshow",
"folder": "kitchen",
"interval": 10,
"inactivityDelay": 10,
"showTime": true,
"timeFormat": "HH:mm:ss",
"showDate": true,
"dateFormat": "dddd, MMMM DD"
}
]
}
Place photos in backend/photos/{room_id}/:
backend/photos/
โโโ kitchen/
โ โโโ 001.jpg
โ โโโ 002.jpg
โ โโโ subfolder/
โ โโโ 003.jpg
โ โโโ 004.jpg
โโโ living-room/
โโโ photo1.jpg
โโโ photo2.jpg
GET / - API informationGET /api/health - Health checkGET /debug/info - Debug information (development only)GET /api/config/{room_id} - Get room configurationGET /api/photos/list/{folder} - List photos in folderGET /api/photos/next - Get next photo in sequenceGET /api/photos/previous - Get previous photo in sequenceGET /api/photos/file/{folder}/{filename} - Serve photo filecd backend
python -m pytest tests/ -v
cd frontend
npm test
Use the provided HTTP test files:
backend/api-test.http - Core API endpointsbackend/test-slideshow.http - Slideshow functionalityThis project includes automated Docker image building and publishing to Docker Hub via GitHub Actions.
# Pull and run the latest image
docker run -p 80:80 anmalkov/umbrella:latest
# Or run a specific version
docker run -p 80:80 anmalkov/umbrella:v1.0.0
The project automatically builds and publishes Docker images when you create a new tag:
# Create and push a tag to trigger Docker build
git tag v1.0.0
git push origin v1.0.0
This will:
anmalkov/umbrellav1.0.0, 1.0, 1)To enable automatic Docker publishing, add these secrets to your GitHub repository:
DOCKER_USERNAME: Your Docker Hub usernameDOCKER_PASSWORD: Your Docker Hub password or access token# Build the image locally
docker build -t umbrella-dashboard .
# Run the container
docker run -p 80:80 umbrella-dashboard
Backend:
cd backend
pip install -r requirements.txt
python main.py
Frontend:
cd frontend
npm run build
Backend:
DEBUG=false
LOG_LEVEL=INFO
ENVIRONMENT=production
Frontend:
REACT_APP_API_URL=https://your-api-domain.com
anmalkov/umbrella/docs and /redocgit checkout -b feature/amazing-featuregit commit -m 'Add amazing feature'git push origin feature/amazing-featureThis project is licensed under the MIT License - see the LICENSEโ file for details.
backend/README.md and frontend/README.mdMade with โค๏ธ by anmalkovโ
Content type
Image
Digest
sha256:aa2ce7381โฆ
Size
57.2 MB
Last updated
about 1 year ago
docker pull anmalkov/umbrella