Skip to content

Implement envelope-based budget management application#2

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/create-budget-management-app-again
Draft

Implement envelope-based budget management application#2
Copilot wants to merge 3 commits intomainfrom
copilot/create-budget-management-app-again

Conversation

Copy link
Copy Markdown

Copilot AI commented Jan 17, 2026

Implements a budget management web application using the envelope budgeting method with Next.js, allowing users to track income, fixed expenses, and categorized spending limits.

Implementation

Application Structure

  • Next.js 16 with TypeScript and App Router
  • Tailwind CSS 4 with PostCSS plugin
  • Firebase/Firestore for persistence with localStorage fallback
  • Type definitions for User, Envelope, and Expense entities

Core Components

  • Onboarding.tsx: 3-step wizard for initial setup (salary, fixed expenses, envelope creation)
  • Dashboard.tsx: Main view with budget overview banner and envelope cards grid
  • Budget calculation logic with automatic percentage tracking and remaining amounts

Data Layer

  • Firebase service layer with timeout handling (3s)
  • Automatic localStorage fallback when Firebase unavailable or misconfigured
  • Secure ID generation using crypto.randomUUID()
  • Error handling for corrupted localStorage data
// Budget calculation example
export function calculateBudget(user: User, expenses: Expense[]): BudgetCalculation {
  const remainingToLive = user.monthlySalary - user.fixedExpenses - totalEnvelopeBudget;
  const envelopes = user.envelopes.map(envelope => ({
    spent: expenses.filter(e => e.envelopeId === envelope.id).reduce((sum, e) => sum + e.amount, 0),
    percentage: (spent / envelope.monthlyLimit) * 100,
    // ...
  }));
  return { remainingToLive, envelopes, ... };
}

Screenshots

Onboarding Flow

Step 1: Salary Input
Step 2: Fixed Expenses
Step 3: Envelope Creation

Dashboard Views

Main Dashboard
Add Expense Modal
Dashboard with Active Expenses

Configuration

Firebase optional—configure via .env.local or runs standalone with localStorage. See .env.local.example for setup.

Original prompt

Agis en tant que développeur Full Stack expert en Next.js et Tailwind CSS. Je souhaite créer une application web de gestion de budget basée sur la méthode des enveloppes.

Voici les spécificités de l'application : 1. Structure des données : Un utilisateur a un salaire mensuel et des dépenses récurrentes fixes. Le reste est réparti dans des "Enveloppes" (catégories comme Courses, Essence, Loisirs) avec un montant plafond. 2. Flux d'onboarding : Au premier lancement, l'utilisateur doit saisir son salaire, ses frais fixes, puis créer ses catégories avec leurs limites mensuelles. 3. Dashboard : - En haut : Une bannière affichant le "Reste à vivre" total pour le mois. - Grille de tuiles : Chaque catégorie est une carte affichant le nom, une icône, le montant dépensé / montant total, et une barre de progression en pourcentage. 4. Fonctionnalités : Un bouton "+" pour ajouter une dépense en sélectionnant une catégorie et un montant. 5. Persistance : Utilise Fireblase

Peux-tu me générer le code pour le composant principal Dashboard et la logique de calcul des dépenses ?


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 17, 2026 19:19
…nd CSS, and Firebase

Co-authored-by: jeremyDevios <33576918+jeremyDevios@users.noreply.github.com>
Co-authored-by: jeremyDevios <33576918+jeremyDevios@users.noreply.github.com>
Copilot AI changed the title [WIP] Create budget management application using envelope method Implement envelope-based budget management application Jan 17, 2026
Copilot AI requested a review from jeremyDevios January 17, 2026 19:31
@jeremyDevios jeremyDevios force-pushed the copilot/create-budget-management-app-again branch from d38b5b0 to 78f4fad Compare February 23, 2026 15:31
@jeremyDevios jeremyDevios force-pushed the main branch 2 times, most recently from 10c21df to 5aa8a05 Compare February 23, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants