Task Genius is a modern Flutter productivity app that leverages AI (OpenRouter/DeepSeek) and Firebase for authentication, with local persistence and a clean, customizable UI. It helps users manage tasks, get AI-powered suggestions, and keep their workflow organized.
-
Clone the Repository
git clone https://github.com/Emmakade/taskgenius.git cd taskgenius -
Install Dependencies
flutter pub get
-
Firebase Setup
- Add your
google-services.json(Android) andGoogleService-Info.plist(iOS) to the respective folders. - Enable Email/Password authentication in Firebase Console.
- Add your
-
API Key Setup
- Create a
.envfile in the project root:OPENROUTER_API_KEY=your_openrouter_api_key
- Never commit your API key to version control.
- Create a
-
Run the App
flutter run
- State Management: Provider
- Data Layer:
- Repositories for tasks, projects, and chat
- Local persistence via sqflite
- Remote AI via OpenRouter/DeepSeek
- Presentation Layer:
- Custom widgets for buttons, text fields, and task cards
- Pages: Home, AI Assistant, Login/Register
- Domain Layer:
- Entities: Task, Project, ChatMessage, TaskSuggestion
- Use cases for business logic
- Error Handling:
- Custom exceptions and error widgets
- Chat/AI:
- Chat history persisted locally
- AI suggestions parsed and actionable
- Endpoint:
POST /chat/completions - Headers:
Authorization: Bearer <API_KEY>Content-Type: application/json
- Request Body Example:
{ "model": "deepseek/deepseek-r1:free", "messages": [ {"role": "system", "content": "...instructions..."}, {"role": "user", "content": "Describe my tasks..."} ] } - Response Example:
{ "choices": [ { "message": { "content": "[{\"title\":\"Task 1\",\"description\":\"...\",\"priority\":\"high\",\"due_date\":\"2025-07-04\"}]" } } ] } - Parsing:
- The app parses the JSON string in
contentto extract task suggestions.
- The app parses the JSON string in
- Email/password sign-in and registration
- Secure user session management
- Tables:
tasks,projects,chat_history,sync_status
- Entities:
- Task: id, title, description, due_date, priority, status, project_id, order, created_at, updated_at
- Project: id, title, description, color, created_at, updated_at
- ChatMessage: id, userMessage, aiResponses (JSON), timestamp
- Launch the app and register a new account or log in with your email/password.
- Tap the "+" button on the Home page.
- Fill in the task details and save.
- Tap the robot icon in the top right.
- Type a natural language description (e.g., "Plan my week with 3 work tasks and 2 personal errands").
- AI suggestions will appear as cards. Tap a card to add it to your task list.
- Tap a task to view details.
- Change status (To Do, In Progress, Completed) directly from the list.
- Reorder tasks with drag-and-drop.
- All user queries and AI responses are saved and shown in the AI Assistant chat.
- Long-press a chat to delete it.
graph TD;
UI[Flutter UI: Home, AI Assistant, Login/Register] -->|Provider| StateMgmt[State Management]
StateMgmt -->|Calls| Repo[Repositories]
Repo -->|Local| DB[(sqflite DB)]
Repo -->|Remote| AI[OpenRouter/DeepSeek API]
Repo -->|Remote| Firebase[Firebase Auth]
DB --> Entities[Entities: Task, Project, ChatMessage]
sequenceDiagram
participant User
participant UI
participant Provider
participant AIService
participant OpenRouter
User->>UI: Enter task description
UI->>Provider: generateTasksFromText()
Provider->>AIService: generateTaskSuggestions()
AIService->>OpenRouter: POST /chat/completions
OpenRouter-->>AIService: JSON response
AIService-->>Provider: List<TaskSuggestion>
Provider-->>UI: Show suggestions
User->>UI: Tap suggestion
UI->>Provider: createTask()
Provider->>DB: Insert task
-
AI Suggestions:
- Handles both single and multiple task suggestions in JSON.
- Robust parsing for Markdown/code block-wrapped JSON.
- All AI responses are logged and saved in chat history.
-
Persistence:
- Chat history and tasks are stored locally for offline access.
- Only the 10 most recent chats are shown for performance.
-
Extensibility:
- Add new providers, repositories, or widgets easily.
- The architecture supports adding more AI models or integrations.
-
Security:
- API keys and sensitive data are never committed.
- Use environment variables and secure storage for production.
-
Testing:
- Run
flutter testto execute all unit and widget tests. - Integration tests can be added in the
test_driver/directory.
- Run
- Found a bug? Open an issue!
- Want to contribute? Fork the repo and submit a PR.
- Questions? Contact dev Nuel or open a discussion.