A smart to-do list application that uses artificial intelligence to analyze and prioritize your tasks based on urgency, importance, and context. Built with Node.js, Express.js, and modern web technologies.
- Task Management: Add, view, and manage your tasks with a clean, intuitive interface
- AI-Powered Prioritization: Let AI analyze your tasks and return them organized by priority (High, Medium, Low)
- Smart Categorization: Tasks are automatically categorized (Work, Home, Personal, Health, Finance, Social)
- Responsive Design: Works seamlessly on desktop, tablet, and mobile devices
-
Loading States: Visual feedback during AI processing
-
Error Handling: Graceful error handling with user-friendly messages
-
Local Storage: Tasks persist between browser sessions
-
Modern UI: Beautiful, modern interface with smooth animations
- Node.js - JavaScript runtime
- Express.js - Web framework
- Axios - HTTP client for AI API calls
- CORS - Cross-origin resource sharing
- dotenv - Environment variable management
- React 18 - Modern React with TypeScript
- React Router - Client-side routing
- Custom Hooks - State management with useTasks hook
- Axios - HTTP client for API requests
- CSS3 - Modern styling with animations
- Font Awesome - Icons
- Local Storage API - Data persistence
- Groq (fast & free - great for development) llama 8b model used
- Clone the repo
git clone <repository-url>
cd ai-powered-task-prioritization-app- Configure environments
# Backend (AI keys and port)
cp backend/env.example backend/.env
# Set one of: OPENAI_API_KEY / GEMINI_API_KEY / ANTHROPIC_API_KEY / GROQ_API_KEY
# Client (API URL for the backend)
cp client/env.example client/.env
# In client/.env set:
# VITE_API_URL=http://localhost:3000- Install and run both apps
npm install
npm run dev- Open the apps
- Client (Vite): http://localhost:5173
- Backend API: http://localhost:3000
- Health check: http://localhost:3000/api/health
- Prioritize tasks
- Add tasks in the UI and click "Prioritize Tasks".
- Default AI service in
backend/server.jsisgroq. Ensure the matching API key is set inbackend/.env. - You can switch providers by changing
AI_SERVICEinbackend/server.jsand adding the corresponding key in.env.
Before running this application, make sure you have:
- Node.js (version 14 or higher)
- npm (Node Package Manager)
- An AI API Key from one of the supported providers:
- OpenAI API key
- Google Gemini API key
- Anthropic Claude API key
git clone <repository-url>
cd ai-powered-task-prioritization-appnpm installCopy the example environment file and configure your API key:
cp env.example .envEdit the .env file and add your AI API key:
# For OpenAI (recommended)
OPENAI_API_KEY=your_openai_api_key_here
# For Google Gemini (alternative)
# GEMINI_API_KEY=your_gemini_api_key_here
# For Anthropic Claude (alternative)
# ANTHROPIC_API_KEY=your_anthropic_api_key_here
# Server Configuration
PORT=3000# Installs backend and client automatically, then runs both with hot reload
npm install
npm run dev# Build the client from /client and serve separately, or add static hosting via Express
cd client && npm run build && cd ..
# Start backend (ensure it knows where to serve the built assets if you choose to serve from Express)
cd backend && npm startOpen your browser and navigate to:
Client: http://localhost:5173
Backend: http://localhost:3000
The application supports multiple AI providers. To switch between them, modify the AI_SERVICE variable in server.js:
const AI_SERVICE = 'openai'; // Change to 'gemini', 'anthropic', or 'groq'- Visit OpenAI Platform
- Create an account and generate an API key
- Add the key to your
.envfile asOPENAI_API_KEY
- Visit Google AI Studio
- Create a project and generate an API key
- Add the key to your
.envfile asGEMINI_API_KEY
- Visit Anthropic Console
- Create an account and generate an API key
- Add the key to your
.envfile asANTHROPIC_API_KEY
- Visit Groq Console
- Create an account and generate an API key
- Add the key to your
.envfile asGROQ_API_KEY - Note: Groq offers free tier with high-speed inference, great for development!
- Type your task in the input field
- Click "Add Task" or press Enter
- Tasks are automatically saved to your browser's local storage
- Add multiple tasks to your list
- Click the "Prioritize Tasks" button
- Wait for AI analysis (usually 2-5 seconds)
- View your tasks organized by priority and category
- Delete: Click the trash icon next to any task
- Clear All: Remove all tasks at once
- Back to Tasks: Return to the task list from results view
- API Key Protection: AI API keys are stored securely on the backend
- Input Validation: All user inputs are validated and sanitized
- Error Handling: Comprehensive error handling prevents data leaks
- CORS Configuration: Proper cross-origin resource sharing setup
- Responsive Design: Works on all device sizes
- Loading States: Visual feedback during AI processing
- Smooth Animations: Modern, polished user experience
- Keyboard Shortcuts:
Enterto add tasksCtrl/Cmd + Enterto prioritize tasksEscapeto close modals
- Accessibility: Semantic HTML and proper ARIA labels
Prioritizes a list of tasks using AI.
Request Body:
{
"tasks": [
"Finish the monthly report",
"Buy groceries",
"Call the plumber"
]
}Response:
{
"success": true,
"tasks": [
{
"task": "Call the plumber",
"priority": "High",
"category": "Home"
},
{
"task": "Finish the monthly report",
"priority": "High",
"category": "Work"
},
{
"task": "Buy groceries",
"priority": "Medium",
"category": "Home"
}
],
"originalCount": 3,
"processedAt": "2024-01-15T10:30:00.000Z"
}Health check endpoint.
Response:
{
"status": "OK",
"timestamp": "2024-01-15T10:30:00.000Z",
"aiService": "openai"
}-
"AI API key not configured" error
- Ensure your
.envfile exists and contains a valid API key - Check that the API key is correctly named (OPENAI_API_KEY, GEMINI_API_KEY, or ANTHROPIC_API_KEY)
- Ensure your
-
"Failed to prioritize tasks" error
- Verify your API key is valid and has sufficient credits
- Check your internet connection
- Ensure the AI service is operational
-
Tasks not saving
- Check if localStorage is enabled in your browser
- Clear browser cache and try again
-
Server won't start
- Ensure Node.js is installed (version 14+)
- Run
npm installto install dependencies - Check that port 3000 is available
To enable debug logging, set the NODE_ENV environment variable:
NODE_ENV=development npm start- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenAI for providing the GPT API
- Google for the Gemini API
- Anthropic for the Claude API
- Font Awesome for the beautiful icons
- The open-source community for inspiration and tools
If you encounter any issues or have questions:
- Check the troubleshooting section above
- Review the error messages in the browser console
- Ensure all dependencies are properly installed
- Verify your API key configuration
For additional support, please open an issue in the repository.
Happy Task Prioritizing! π―