Full-stack PWA budgeting app installable on Android via Chrome. Features implemented: - Monthly balance sheet: income sources (monthly/yearly), buffer (fixed $ or % of income) - Buckets: regular, savings-goal, and investment types with custom goals (amount or % of income, monthly or yearly schedule) - Debt tracker: manual or auto-EMI (amortization formula), interest rate, remaining balance tracking, avalanche-method repayment suggestions - Loan calculator: max affordable principal and EMI checker based on remaining income after all expenses - Investment projections: compound interest at monthly/yearly rate, 1/5/10-year projections per bucket - Deposit / withdraw transactions per bucket with balance history - Appwrite self-hosted backend: auth, 5 collections (balance_sheets, incomes, buckets, debts, transactions) - scripts/setup-appwrite.cjs: one-command DB setup via node-appwrite - PWA manifest + service worker (vite-plugin-pwa) for Android install - Dark mobile-first UI with TailwindCSS, Zustand state, React Router v6 https://claude.ai/code/session_01Ny2EMaZYvzk5SSVDAPgxpP
24 lines
567 B
TypeScript
24 lines
567 B
TypeScript
import { ID } from 'appwrite';
|
|
import { account } from './config';
|
|
|
|
export async function register(email: string, password: string, name: string) {
|
|
await account.create(ID.unique(), email, password, name);
|
|
return login(email, password);
|
|
}
|
|
|
|
export async function login(email: string, password: string) {
|
|
return account.createEmailPasswordSession(email, password);
|
|
}
|
|
|
|
export async function logout() {
|
|
return account.deleteSession('current');
|
|
}
|
|
|
|
export async function getCurrentUser() {
|
|
try {
|
|
return await account.get();
|
|
} catch {
|
|
return null;
|
|
}
|
|
}
|