{"id":29871421,"url":"https://github.com/betiol/weather-app","last_synced_at":"2026-04-11T05:36:56.249Z","repository":{"id":306820168,"uuid":"1026955195","full_name":"betiol/weather-app","owner":"betiol","description":"tRPC Weather App","archived":false,"fork":false,"pushed_at":"2025-07-27T19:24:26.000Z","size":226,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-27T21:25:49.662Z","etag":null,"topics":["cloudrun","firebase","gcp","js","node","react","trpc"],"latest_commit_sha":null,"homepage":"https://weather-app-rr.netlify.app/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/betiol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-27T01:50:57.000Z","updated_at":"2025-07-27T19:24:30.000Z","dependencies_parsed_at":"2025-07-27T21:25:53.208Z","dependency_job_id":"ce471f92-ad68-426a-af22-bfaa6916b09b","html_url":"https://github.com/betiol/weather-app","commit_stats":null,"previous_names":["betiol/weather-app"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/betiol/weather-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betiol%2Fweather-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betiol%2Fweather-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betiol%2Fweather-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betiol%2Fweather-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/betiol","download_url":"https://codeload.github.com/betiol/weather-app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betiol%2Fweather-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31670374,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T17:19:37.612Z","status":"online","status_checked_at":"2026-04-11T02:00:05.776Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudrun","firebase","gcp","js","node","react","trpc"],"created_at":"2025-07-30T19:46:14.757Z","updated_at":"2026-04-11T05:36:56.241Z","avatar_url":"https://github.com/betiol.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Weather App\n\nThis project is a full-stack application that manages user locations using OpenWeatherMap API to fetch geographic data based on zip codes. The application is built using a modern stack with TypeScript, tRPC, React, and Firebase Realtime Database.\n\n## Features Implemented\n\n- ✅ Complete CRUD operations for user management\n- ✅ Firebase Authentication with Email/Password\n- ✅ Protected routes and authenticated API endpoints\n- ✅ Firebase Realtime Database integration for real-time data updates\n- ✅ Automatic fetching of geographic data (latitude, longitude, timezone) from OpenWeatherMap API\n- ✅ Interactive map visualization of user locations using Google Maps\n- ✅ Real-time updates across all connected clients\n- ✅ Type-safe end-to-end API using tRPC\n- ✅ Monorepo architecture for better code organization and sharing\n- ✅ Automated deployment using GitHub Actions\n- ✅ Backend deployed to Google Cloud Run\n- ✅ Frontend deployed to Netlify\n\n## Tech Stack\n\n- **Frontend**: React, TypeScript, Tailwind CSS, Framer Motion\n- **Backend**: Node.js, TypeScript, tRPC\n- **Database**: Firebase Realtime Database\n- **Authentication**: Firebase Authentication\n- **APIs**: OpenWeatherMap API, Google Maps API\n- **Build Tools**: Turborepo, Vite\n- **Package Manager**: Bun\n- **Deployment**: GitHub Actions, Google Cloud Run, Netlify\n\n## How to Run\n\n1. Clone the repository\n```bash\ngit clone https://github.com/betiol/weather-app.git\ncd weather-app\n```\n\n2. Install dependencies\n```bash\nbun install\n```\n\n3. Set up environment variables:\n\nCreate `.env` files in both `apps/api` and `apps/web` directories:\n\nFor `apps/api/.env`:\n```env\nPORT=your_app_port\nOPENWEATHER_API_KEY=your_openweather_api_key\nFIREBASE_PROJECT_ID=your_firebase_project_id\nFIREBASE_PRIVATE_KEY=your_firebase_private_key\nFIREBASE_CLIENT_EMAIL=your_firebase_client_email\nFIREBASE_DATABASE_URL=your_firebase_database_url\n```\n\nFor `apps/web/.env`:\n```env\nVITE_API_BASE_URL=your_api_base_url\nVITE_FIREBASE_API_KEY=your_firebase_api_key\nVITE_FIREBASE_AUTH_DOMAIN=your_firebase_auth_domain\nVITE_FIREBASE_DATABASE_URL=your_firebase_database_url\nVITE_FIREBASE_PROJECT_ID=your_firebase_project_id\nVITE_FIREBASE_STORAGE_BUCKET=your_firebase_storage_bucket\nVITE_FIREBASE_MESSAGING_SENDER_ID=your_firebase_messaging_sender_id\nVITE_FIREBASE_APP_ID=your_firebase_app_id\nVITE_GOOGLE_MAPS_API_KEY=your_google_maps_api_key\n```\n\n4. Start the development servers\n```bash\nbun dev\n```\n\nThis will start both the API and web application in development mode. The web application will be available at `http://localhost:5173` and the API at `http://localhost:3000`.\n\n## Live Deployment\n\nThe application is deployed and available online:\n\n- **Frontend**: Deployed on Netlify with automatic deployment from the main branch\n- **Backend**: Deployed on Google Cloud Run with containerized deployment\n- **CI/CD**: GitHub Actions automatically builds and deploys both frontend and backend on every push to main\n\n## Authentication\n\nThe application uses Firebase Authentication for secure user access:\n\n- Email/Password authentication\n- Protected routes using React Context\n- Authenticated tRPC endpoints\n- Secure session management\n- Real-time authentication state updates\n\n## Architecture Approach\n\n### Why tRPC?\n\ntRPC was chosen over traditional REST for several key benefits:\n\n1. **Type Safety**: tRPC provides end-to-end type safety between the client and server without manual type synchronization or code generation.\n2. **Developer Experience**: Automatic IntelliSense and type checking across the full stack.\n3. **Performance**: Smaller bundle size and better performance compared to REST clients due to its minimal runtime.\n4. **Real-time Capabilities**: Built-in support for subscriptions and real-time updates.\n\n### Monorepo Structure\n\nThe project uses a monorepo architecture with Turborepo for several reasons:\n\n1. **Code Sharing**: Shared types and utilities between frontend and backend.\n2. **Consistent Development Experience**: Single command to run all services.\n3. **Dependency Management**: Centralized package management and versioning.\n4. **Build Performance**: Turborepo's intelligent build caching.\n\nThe project is organized into:\n- `apps/api`: Backend tRPC server\n- `apps/web`: React frontend application\n- `packages/`: Shared code (types, utilities)\n\n## Testing\n\nThe project includes several types of tests:\n\n1. **Unit Tests**: Service layer testing using Jest\n   - User service operations\n   - Weather service integration\n   - Firebase database operations\n   - Authentication flows\n\n2. **Integration Tests**: API endpoint testing\n   - CRUD operations\n   - Error handling\n   - Data validation\n   - Authentication middleware\n\n3. **Manual Testing**:\n   - Cross-browser compatibility\n   - Responsive design\n   - Real-time updates\n   - Map interaction\n   - Form validation\n   - Authentication flows\n   - Session management\n\n## Testing Done\n\n### What was tested and how:\n\n1. **API Endpoints Testing**:\n   - All CRUD operations (Create, Read, Update, Delete)\n   - Authentication middleware feature\n   - Error handling for invalid zip codes\n   - OpenWeatherMap API integration\n\n2. **Frontend features**:\n   - User registration and login flows\n   - Form validation (name and zip code fields)\n   - Real-time updates when users are added/edited/deleted\n   - Google Maps integration and marker display\n   - Responsive design across different screen sizes\n\n3. **Integration Testing**:\n   - End-to-end user creation workflow\n   - Geographic data fetching from zip codes\n   - Firebase Realtime Database operations\n   - tRPC client-server communication\n\n4. **Manual Testing Scenarios**:\n   - Created users with various zip codes (valid and invalid)\n   - Updated user information and verified re-fetching of location data\n   - Tested authentication flows (login, logout, session persistence)\n   - Verified real-time updates across multiple browser tabs\n   - Tested map interactions and marker clustering\n   - Cross-browser compatibility (Chrome, Firefox, Safari)\n\n## Assumptions Made\n\n1. Users are identified by unique IDs generated by Firebase\n2. Zip codes are assumed to be US-based for OpenWeatherMap API\n3. All users have valid zip codes that can be geocoded\n4. Google Maps API is used for visualization only\n5. Real-time updates are required for collaborative features\n6. Email/Password is sufficient for authentication needs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbetiol%2Fweather-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbetiol%2Fweather-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbetiol%2Fweather-app/lists"}