URL: https://networth.techbrohomelab.xyz
This project uses Vite as its build tool, which requires environment variables to be prefixed with VITE_ to be accessible in the client-side code.
- Create a
.envfile in the root of your project - Copy the contents from
.env.example - Update the values as needed for your environment
- Make sure to restart the Vite dev server after making changes to environment variables
VITE_POCKETBASE_URL: Your PocketBase server URL (e.g., http://localhost:8090)
VITE_POCKETBASE_TEST_USER_EMAIL: Test user email for developmentVITE_POCKETBASE_TEST_USER_PASSWORD: Test user password for developmentVITE_USE_MOCK: Set to "true" to use demo data instead of PocketBase
- Make sure you have Node.js installed (LTS version recommended)
- Install dependencies:
npm install- Start the development server:
npm run dev- For production build:
npm run build- To preview production build:
npm run preview- To run type checking:
npm run typecheckIn the codebase, Vite environment variables are accessed like:
const pocketBaseUrl = import.meta.env.VITE_POCKETBASE_URL;
const useMock = import.meta.env.VITE_USE_MOCK === "true";Important: Do not use
process.envas it's not available in Vite client-side code.
This project includes a powerful database exploration and maintenance tool for debugging user data issues and managing the PocketBase database.
The scripts/database.js script provides comprehensive database analysis and maintenance capabilities:
# List all users in the database
node scripts/database.js users
# Complete data exploration for a specific user
node scripts/database.js explore <userId>
# Analyze account values and mappings
node scripts/database.js accounts <userId>
# Analyze net worth history
node scripts/database.js networth <userId>
# Clean up problematic data entries
node scripts/database.js cleanup <userId>For database administration scripts, set these environment variables:
POCKETBASE_URL=your-pocketbase-url
POCKETBASE_ADMIN_EMAIL=admin@example.com
POCKETBASE_ADMIN_PASSWORD=your-admin-password# Explore all data for a user (comprehensive analysis)
node scripts/database.js explore abc123xyz
# Output includes:
# - Account analysis with values and data points
# - Net worth history analysis
# - Data issue identification
# - Expected vs actual net worth comparisonThe database explorer helps identify and resolve common issues like:
- Accounts showing $0 values due to mapping problems
- Net worth charts dropping to zero from problematic entries
- Missing or corrupted historical data
- Data synchronization issues between accounts and net worth history
This project is built with:
- Vite
- TypeScript
- React
- shadcn-ui
- Tailwind CSS
- PocketBase (backend database)