TaskPilot is a modern, full-stack, cloud-native To-Do list application built with a microservice architecture. It leverages Java/Spring Boot for the backend, React/TypeScript for the frontend, and integrates with Google's Gemini AI to intelligently decompose complex tasks into manageable sub-tasks.
- Project Description
- Features
- Architecture
- Technology Stack
- Getting Started
- Environment Variables
- Deployment
- API Endpoints
- License
This project serves as a comprehensive demonstration of building a scalable, maintainable, and cloud-native application. It separates concerns into distinct backend microservices that communicate via REST APIs, all consumed by a reactive frontend client. A key feature is the integration of Google's Gemini AI, allowing users to automatically break down large tasks into smaller, actionable steps, enhancing productivity.
The application is fully containerized with Docker and deployed to Google Cloud Run, showcasing a modern DevOps workflow.
- 👤 User Management: Secure user registration, login, and profile management using JWT-based authentication.
- ✅ Full CRUD Operations: Create, read, update, and delete tasks, sub-tasks, and categories.
- ιε Hierarchical Tasks: Break down complex tasks into smaller, manageable sub-tasks.
- ✨ AI-Powered Task Decomposition: Use Google's Gemini AI to automatically generate a list of sub-tasks from a single task description.
- 🗂️ Categorization: Organize tasks with custom, user-defined categories.
- 🔝 Prioritization: Assign priorities (High, Medium, Low) to tasks.
- 📅 Deadlines: Set "finish by" dates for both tasks and sub-tasks.
- ☁️ Cloud-Native Deployment: Containerized services deployed on Google Cloud Run for scalability and resilience.
- 📱 Responsive UI: A clean, modern, and responsive user interface built with React, TypeScript, and Tailwind CSS.
+-----------------+ +------------------------+ +--------------------------+
| |----->| User Service |----->| |
| | | (Handles Auth & Users) | | |
| React Client | +------------------------+ | NeonDB (PostgreSQL) |
| (Frontend) | | (Shared DB) |
| | +------------------------+ | |
| |----->| Todo List Service |----->| |
| | | (Handles Tasks & AI) | | |
+-----------------+ +------------------------+ +--------------------------+
|
|
v
+------------------+
| Google Gemini AI |
+------------------+
frontend: A single-page application built with React and Vite. It communicates with the backend services via REST APIs and is deployed on Netlify.user-service: Manages all user data, including registration, login (issuing JWTs), and profile management.todolist-service: Manages all logic related to tasks, sub-tasks, and categories. It validates JWTs from theuser-serviceto authorize requests. It also communicates with the Google Gemini API for task decomposition.NeonDB: A serverless PostgreSQL database that serves as the persistent data store for both microservices.Google Gemini: The external AI service used for breaking down tasks.
| Category | Technology |
|---|---|
| Backend | Java 21, Spring Boot 3, Spring Security, Spring Data JPA, Hibernate, Lombok |
| Frontend | React 18, TypeScript, Vite, Tailwind CSS, Zustand (State Management), Axios, Lucide React (Icons) |
| Database | NeonDB (Serverless PostgreSQL) |
| AI | Google Gemini Pro |
| DevOps | Docker, Google Cloud Run, Google Artifact Registry, Google Secret Manager, Netlify (Frontend CI/CD) |
| Build | Apache Maven |
| Security | JWT (JSON Web Tokens) |
Follow these instructions to get the project up and running on your local machine for development and testing purposes.
- Java JDK 21 or later
- Node.js v18+ and npm
- Apache Maven 3.8+
- Docker Desktop
- Git
- A local PostgreSQL instance or a cloud-based one like NeonDB.
-
Clone the repository:
git clone https://github.com/your-username/TaskPilot.git cd TaskPilot/backend -
Configure
user-service:- Navigate to
user-service/src/main/resources/application.properties. - Update the
spring.datasource.*properties to point to your database. Create a dedicated database for this service. - Set a secure
jwt.secret. This secret must be identical in both microservices.
- Navigate to
-
Configure
todolist-service:- Navigate to
todolist-service/src/main/resources/application.properties. - Update the
spring.datasource.*properties. It can point to the same database as the user-service (JPA will manage separate tables). - Ensure
jwt.secretis the exact same as in theuser-service. - (Optional) To use the AI feature, provide your
GEMINI_API_KEYandGEMINI_PROJECT_ID.
- Navigate to
-
Run the Microservices:
-
Open two separate terminal windows.
-
In the first terminal, run the
user-service:cd user-service ./mvnw spring-boot:runThe service will start on port
8081. -
In the second terminal, run the
todolist-service:cd todolist-service ./mvnw spring-boot:runThe service will start on port
8082.
-
-
Navigate to the frontend directory:
# From the project root cd frontend/taskpilot
-
Install dependencies:
npm install
-
Run the development server:
npm run dev
The React application will be available at
http://localhost:5173.
For production deployment (and optionally for local setup), the services are configured via environment variables. The backend application.properties files are set up to use these variables with local defaults.
SPRING_DATASOURCE_URL: The full JDBC URL for your PostgreSQL database.SPRING_DATASOURCE_USERNAME: Database username.SPRING_DATASOURCE_PASSWORD: Database password (managed as a secret in production).JWT_SECRET: A long, secure, and random string for signing JWTs (managed as a secret).GEMINI_API_KEY: Your API key for Google Gemini (managed as a secret).GEMINI_PROJECT_ID: Your Google Cloud Project ID for Gemini.
The backend services are designed for deployment on Google Cloud Run. The backend/deploy.sh script automates this process.
To deploy:
- Ensure
gcloudCLI is installed, authenticated, and configured for your project. - Ensure Docker is running.
- Navigate to the
backenddirectory. - Run the script:
# Deploy both services ./deploy.sh # Deploy only the user-service ./deploy.sh user-service
The script will:
- Build a Docker image for the specified service(s).
- Tag the image and push it to Google Artifact Registry.
- Deploy the image to Google Cloud Run, injecting secrets and environment variables as configured in the script.
The frontend is deployed automatically to Netlify on pushes to the main branch.
POST /register: Create a new user account.POST /login: Authenticate a user and receive a JWT.GET /profile: Get the current user's profile information.PUT /profile: Update the current user's profile.GET /health: Health check endpoint.
GET, POST /tasks: Get all tasks or create a new one.GET, PUT, DELETE /tasks/{id}: Manage a specific task.POST /tasks/{id}/toggle-complete: Toggle a task's completion status.GET, POST /categories: Get all categories or create a new one.DELETE /categories/{id}: Delete a category (only if it's not in use).POST /tasks/{taskId}/subtasks: Create a new sub-task.POST /tasks/{taskId}/subtasks/batch: Create multiple sub-tasks at once.DELETE /tasks/{taskId}/subtasks/{subTaskId}: Delete a sub-task.POST /ai/decompose-task: Send a task to the Gemini AI for decomposition.
This project is licensed under the MIT License. See the LICENSE file for details.