An AI-powered assistant that helps users plan their day by combining real-time weather data, local news, and intelligent recommendations.
| Service | URL |
|---|---|
| Frontend | https://day-mate-navy.vercel.app/ |
| Backend API | https://daymate-backend-5f7j.onrender.com |
| API Documentation | https://daymate-backend-5f7j.onrender.com/docs |
- Real-time Weather Integration - Fetches current weather data from Open-Meteo API (FREE, no key needed)
- Real-time Traffic Updates - Shows road congestion levels and incidents using TomTom Traffic API (Open Traffic - World Bank)
- News Aggregation - Retrieves local news via NewsAPI
- AI Planning Agent - Generates personalized daily recommendations using Google Gemini
- Clean User Interface - Modern React UI with Tailwind CSS styling
- Docker Containerization - Ready-to-deploy Dockerfiles
- Unit Tests - Comprehensive test coverage for backend services
- Fallback Mechanisms - Rule-based plans when AI is unavailable
- Why FastAPI?
- High performance with async support
- Automatic OpenAPI documentation
- Built-in data validation with Pydantic
- Easy to test and deploy
-
Why React?
- Component-based architecture for maintainability
- Large ecosystem and community support
- Excellent developer experience with hooks
-
Why Vite?
- Lightning-fast development server
- Optimized production builds
- Modern ES modules support
- Why Tailwind?
- Utility-first approach for rapid development
- Highly customizable design system
- Small production bundle with purging
DayMate/
├── backend/ # FastAPI Backend
│ ├── app/
│ │ ├── __init__.py
│ │ ├── main.py # Application entry point
│ │ ├── models.py # Pydantic data schemas
│ │ └── services/
│ │ ├── __init__.py
│ │ ├── weather.py # Open-Meteo integration (FREE)
│ │ ├── news.py # NewsAPI integration
│ │ └── ai_agent.py # OpenAI integration
│ ├── tests/
│ │ └── test_services.py # Unit tests
│ ├── .env.example # Environment template
│ ├── requirements.txt # Python dependencies
│ └── Dockerfile # Container configuration
│
├── frontend/ # React + Vite Frontend
│ ├── src/
│ │ ├── components/
│ │ │ ├── WeatherCard.jsx
│ │ │ ├── NewsFeed.jsx
│ │ │ ├── PlanDisplay.jsx
│ │ │ ├── LoadingSpinner.jsx
│ │ │ └── ErrorMessage.jsx
│ │ ├── App.jsx # Main application
│ │ ├── main.jsx # Entry point
│ │ └── index.css # Tailwind styles
│ ├── .env.example # Environment template
│ ├── package.json
│ ├── vite.config.js
│ └── tailwind.config.js
│
└── README.md # This file
- Python 3.11+
- Node.js 18+
- npm or yarn
- Weather API - Using Open-Meteo - NO API KEY NEEDED! Completely free.
- NewsAPI Key - Get FREE key here - Free for development
- Google Gemini API Key - Get FREE key here - Free tier available
# 1. Navigate to backend directory
cd backend
# 2. Create virtual environment
python -m venv venv
# 3. Activate virtual environment
# Windows:
venv\Scripts\activate
# macOS/Linux:
source venv/bin/activate
# 4. Install dependencies
pip install -r requirements.txt
# 5. Create environment file
copy .env.example .env # Windows
# cp .env.example .env # macOS/Linux
# 6. Edit .env and add your API keys (Weather is FREE - no key needed!)
# NEWS_API_KEY=your_key
# GEMINI_API_KEY=your_key
# 7. Run the server
uvicorn app.main:app --reload --port 8000The backend will be available at http://localhost:8000
- API Documentation:
http://localhost:8000/docs
# 1. Navigate to frontend directory
cd frontend
# 2. Install dependencies
npm install
# 3. Create environment file
copy .env.example .env # Windows
# cp .env.example .env # macOS/Linux
# 4. Run development server
npm run devThe frontend will be available at http://localhost:5173
# Navigate to backend directory
cd backend
# Run tests
pytest tests/ -v| Method | Endpoint | Description |
|---|---|---|
| GET | / |
Health check |
| GET | /health |
Service health status |
| POST | /api/plan |
Generate daily plan |
| GET | /api/weather/{city} |
Get weather for city |
| GET | /api/news/{city} |
Get news for city |
curl -X POST "http://localhost:8000/api/plan" \
-H "Content-Type: application/json" \
-d '{"city": "London"}'{
"weather": {
"temp": 15.5,
"feels_like": 14.2,
"humidity": 72,
"condition": "Clouds",
"description": "overcast clouds",
"icon": "04d",
"wind_speed": 5.2,
"city_name": "London",
"country": "GB"
},
"news": [
{
"title": "Local News Headline",
"description": "News description...",
"url": "https://...",
"source": "BBC News",
"published_at": "2024-01-01T12:00:00Z"
}
],
"ai_plan": "## Daily Plan for London\n\n### Morning\n- ...",
"city": "London"
}-
Push your code to GitHub
-
Create a new Web Service on Render
-
Connect your GitHub repository
-
Configure settings:
- Build Command:
pip install -r requirements.txt - Start Command:
uvicorn app.main:app --host 0.0.0.0 --port $PORT - Root Directory:
backend
- Build Command:
-
Add Environment Variables in Render dashboard:
NEWS_API_KEYGEMINI_API_KEY- (Weather uses Open-Meteo - NO KEY NEEDED!)
-
Deploy!
This section outlines the configuration required to run DayMate locally and in production.
- TOMTOM_API_KEY
- NEWS_API_KEY
- GEMINI_API_KEY
- ALLOWED_ORIGINS (comma-separated list of allowed front-end origins)
For local development: copy backend/.env.example to backend/.env and fill in values. For production, set these values in your host's environment configuration (for example, Render's Service Environment settings).
-
ALLOWED_ORIGINSshould contain the exact origins your frontend will use (for examplehttp://localhost:5173,https://day-mate-navy.vercel.app). -
Do not use a wildcard (
*) when your frontend relies on credentials (cookies or auth headers), since browsers require an explicit origin when credentials are allowed. -
Firebase / Firestore:
- Enable Authentication (Google provider) and add your deployed frontend domain to Authorized Domains in the Firebase Console.
- Structure chat data under
users/{uid}/chatHistoryso records are user-scoped. - Apply Firestore security rules that restrict access to authenticated users acting on their own data; an example rule is shown below.
Frontend build-time variables: On Vercel set
VITE_API_URLto your backend URL (for examplehttps://daymate-backend-5f7j.onrender.com) and theVITE_FIREBASE_*values from your Firebase project settings. These are read at build time — update them in Vercel and redeploy the site. Recommended Firestore rules (example - restrict reads/writes to authenticated users under their UID):
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId}/{collection}/{docId} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
match /{document=**} {
allow read, write: if false;
}
}
}
If secrets are committed inadvertently, rotate affected keys and follow best-practice guidance from your provider to remove them from history.
-
Import your GitHub repository on Vercel
-
Configure settings:
- Framework Preset: Vite
- Root Directory:
frontend
-
Add Environment Variable:
VITE_API_URL= Your Render backend URL (e.g.,https://daymate-backend-5f7j.onrender.com)
- Deploy!
# Backend
cd backend
docker build -t daymate-backend .
docker run -p 8000:8000 --env-file .env daymate-backend
# Or use docker-compose (create docker-compose.yml first)Add your screenshots to a
screenshots/folder
┌─────────────────┐ ┌─────────────────┐
│ React App │────▶│ FastAPI │
│ (Frontend) │◀────│ (Backend) │
└─────────────────┘ └────────┬────────┘
│
┌───────────────────────┼───────────────────────┐
│ │ │
▼ ▼ ▼
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Open-Meteo │ │ NewsAPI │ │ Google Gemini │
│ (FREE!) │ │ │ │ API │
└─────────────────┘ └─────────────────┘ └─────────────────┘
# Weather: Uses Open-Meteo - NO API KEY NEEDED!
# Traffic: Uses TomTom Traffic API (Open Traffic - World Bank)
# Based on OSM and Telenav data - Free developer tier available
TOMTOM_API_KEY=your_tomtom_api_key
NEWS_API_KEY=your_newsapi_key
GEMINI_API_KEY=your_gemini_api_key
ALLOWED_ORIGINS=http://localhost:5173VITE_API_URL=http://localhost:8000- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License.
- Open-Meteo for FREE weather data (no API key!)
- NewsAPI for news aggregation
- Google Gemini for AI-powered recommendations
- Tailwind CSS for styling
- FastAPI for the backend framework




