Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ Planner + Calendar Update
- SQLite-based local database
- Structured task + subject mapping

### 📥 Data Export
- Export your study plan to CSV
- Includes task details, subjects, and deadlines
- Compatible with Excel, Google Sheets, and other tools

---

## 🧠 System Architecture
Expand Down
4 changes: 2 additions & 2 deletions backend/controllers/csvDownload.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ async function downloadData(req, res) {
task.status,
task.priority,
task.confidence_score,
`"${(task.notes || '').replace(/"/g, '""')}"`
])
task.notes || ''
].map(val => `"${String(val).replace(/"/g, '""')}"`))
];

const csvString = rows.map(row => row.join(',')).join('\n');
Expand Down
2 changes: 0 additions & 2 deletions css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -794,8 +794,6 @@ body {
#new-subject-modal .subject-color-swatch--selected {
box-shadow: 0 0 0 2px #0f172a, 0 0 0 4px #a5b4fc;
}
/* css/index.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
--color-background-primary: #ffffff;
Expand Down
72 changes: 41 additions & 31 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@ function generateSummary(tasks, subjects) {
let weekCount = 0;
let subjectCount = {};

tasks.forEach(t => {
if (t.archived || t.status === 'Done' || !t.due_at) return;
// Progress calculation
const activeTasks = tasks.filter(t => !t.archived);
const totalActive = activeTasks.length;
const completedTasks = activeTasks.filter(t => t.status === 'Done').length;
const completionPercentage = totalActive > 0 ? Math.round((completedTasks / totalActive) * 100) : 0;

activeTasks.forEach(t => {
if (t.status === 'Done' || !t.due_at) return;

const d = new Date(t.due_at);

Expand All @@ -41,6 +47,14 @@ function generateSummary(tasks, subjects) {
: 'no specific subject';

return `
<strong>📊 Overall Progress</strong><br>
<div class="progress-container" style="background: var(--color-border-tertiary); height: 8px; border-radius: 4px; margin: 8px 0; overflow: hidden;">
<div class="progress-bar" style="width: ${completionPercentage}%; height: 100%; background: var(--color-text-success); transition: width 0.3s ease;"></div>
</div>
<div style="font-size: 12px; color: var(--color-text-secondary); margin-bottom: 16px;">
${completionPercentage}% completed (${completedTasks}/${totalActive} tasks)
</div>

<strong>📅 Daily</strong><br>
Today you have <b>${todayCount}</b> task(s).<br>
Focus on <b>${topSubject}</b>.<br><br>
Expand Down Expand Up @@ -123,7 +137,7 @@ function renderSidebarSubjects() {
countBySubject[s.id] = 0;
});
tasks.forEach(t => {
if (t.archived || !t.subject_id || countBySubject[t.subject_id] === undefined) return;
if (t.archived || t.status === 'Done' || !t.subject_id || countBySubject[t.subject_id] === undefined) return;
countBySubject[t.subject_id]++;
});

Expand Down Expand Up @@ -397,7 +411,9 @@ function renderTasks() {
// Update badges
const allTasksBadge = document.querySelector('#all-tasks-btn .badge');
if (allTasksBadge) {
allTasksBadge.textContent = activeTasks.length;
const pendingCount = activeTasks.filter(t => t.status !== 'Done').length;
allTasksBadge.textContent = pendingCount;
allTasksBadge.setAttribute('aria-label', `${pendingCount} pending tasks`);
}
const archivedBadge = document.querySelector('#archived-tasks-btn .badge');
if (archivedBadge) {
Expand Down Expand Up @@ -562,7 +578,7 @@ function renderTasks() {
: '';

tasksSection.innerHTML = actionBar +
renderGroup(titlePrefix + '⚠ Due soon', dueSoon, 'var(--color-text-danger)', true)
renderGroup(titlePrefix + '⚠ Due soon', dueSoon, 'var(--color-text-danger)', true) +
renderGroup(titlePrefix + 'This week', thisWeek, 'var(--color-text-secondary)', true) +
renderGroup(titlePrefix + 'Completed', completed, 'var(--color-text-tertiary)') +
emptyState;
Expand Down Expand Up @@ -663,9 +679,11 @@ function renderTasks() {
}


const summaryBox = document.getElementById('summary-box');
if (summaryBox) {
summaryBox.innerHTML = generateSummary(store.tasks, store.subjects);
function renderSummary() {
const summaryBox = document.getElementById('summary-box');
if (summaryBox) {
summaryBox.innerHTML = generateSummary(store.tasks, store.subjects);
}
}

function renderCalendar() {
Expand Down Expand Up @@ -855,6 +873,7 @@ store.subscribe(renderExtraction);
store.subscribe(renderCalendar);
store.subscribe(renderFocusTasks);
store.subscribe(renderSidebarSubjects);
store.subscribe(renderSummary);

document.addEventListener('DOMContentLoaded', () => {
if (newSubjectColorsEl) {
Expand Down Expand Up @@ -971,9 +990,8 @@ document.addEventListener('DOMContentLoaded', () => {
renderCalendar();
});


//NEw Task addition event listeners
newTaskBtn.addEventListener('click', () => {
// New Task addition event listeners
newTaskBtn.addEventListener('click', () => {

if (!store.subjects || store.subjects.length === 0) {
alert('Subjects are still loading. Please try again in a moment.');
Expand Down Expand Up @@ -1036,15 +1054,6 @@ newTaskSave.addEventListener('click', async () => {
newTaskModal.style.display = 'none';
});

addItemsBtn.addEventListener('click', () => {
if (store.currentPaste) {
store.addTasks(store.currentPaste);
store.clearExtracted();
pasteInput.value = '';
}
});
});

extractBtn.addEventListener('click', async () => {
const text = pasteInput.value;
if (!text.trim()) return;
Expand All @@ -1060,19 +1069,20 @@ extractBtn.addEventListener('click', async () => {
store.setExtracted(items);
});

clearBtn.addEventListener('click', () => {
pasteInput.value = '';
store.clearExtracted();
});

addItemsBtn.addEventListener('click', () => {
if (store.currentPaste) {
store.addTasks(store.currentPaste);
store.clearExtracted();
clearBtn.addEventListener('click', () => {
pasteInput.value = '';
}
});
store.clearExtracted();
});

addItemsBtn.addEventListener('click', () => {
if (store.currentPaste) {
store.addTasks(store.currentPaste);
store.clearExtracted();
pasteInput.value = '';
}
});

downloadBtn.addEventListener('click', () => {
downloadData();
});
}); // Close DOMContentLoaded event listener
13 changes: 0 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ Each object must have: title (string), subject_name (string), due_at (ISO 8601 d
Text: "${text}"
`;
const response = await ai.models.generateContent({
model: 'gemini-2.5-flash',
model: 'gemini-1.5-flash',
contents: prompt
});

Expand Down Expand Up @@ -456,7 +456,7 @@ app.post('/api/auth/signup', (req, res) => {
return res.status(400).json({ error: 'User already exists' });
}
users[email] = { email, password };
res.json({ success: true, message: 'Account created successfully' });
res.json({ success: true, email: email, message: 'Account created successfully' });
});

app.post('/api/auth/login', (req, res) => {
Expand Down