A modern, single-page Svelte application to track your Python snake's feeding diet. Built with Svelte and Vite, using browser localStorage for data persistence.
- Easy Feeding Logging: Quickly log feedings with date, prey type, and size/weight
- Automatic Interval Calculation: Automatically calculates days between consecutive feedings
- Real-time Updates: Reactive UI updates instantly when new feedings are added
- Persistent Storage: All data is stored locally in your browser using localStorage
- Responsive Design: Works beautifully on desktop, tablet, and mobile devices
- No Backend Required: Fully client-side application with no external dependencies
The app features a clean, modern interface with:
- Prominent header showing your snake's name and last feeding date
- Intuitive form for logging new feedings
- Responsive table displaying the complete feeding history
- Automatic calculation of feeding intervals
- Node.js (v16 or higher recommended)
- pnpm package manager (Install pnpm)
- Clone or download this repository
- Install dependencies:
pnpm installTo start the development server:
pnpm devThe app will be available at http://localhost:5173 (or the next available port).
To create a production build:
pnpm buildThe built files will be in the dist directory. You can preview the production build with:
pnpm preview-
Log a Feeding: Fill in the form with:
- Date (defaults to today)
- Prey Type (e.g., "Rat", "Mouse")
- Prey Size/Weight (e.g., "Medium", "Large", "150g")
- Click "Log Feeding" or press Enter
-
View Feeding History: The table below shows all recorded feedings sorted by date (newest first), including:
- Date of feeding
- Prey type
- Prey size/weight
- Interval in days since the previous feeding
-
Data Persistence: All data is automatically saved to your browser's localStorage. Your feeding log persists across browser sessions.
Edit src/App.svelte and change the SNAKE_NAME constant:
const SNAKE_NAME = "Your Snake's Name";To change the localStorage key used for storing data, modify the STORAGE_KEY constant:
const STORAGE_KEY = 'yourCustomKey';Each feeding entry is stored as:
{
id: string, // Unique identifier (timestamp-based)
date: string, // Date in "YYYY-MM-DD" format
preyType: string, // Type of prey
preySize: string, // Size or weight of prey
timestamp: number // Milliseconds since epoch (for sorting)
}This application works in all modern browsers that support:
- ES6+ JavaScript
- localStorage API
- CSS Grid and Flexbox
- Svelte: Reactive UI framework
- Vite: Fast build tool and dev server
- localStorage: Browser-based data persistence
python-health-hub/
├── src/
│ ├── App.svelte # Main application component
│ └── main.js # Application entry point
├── index.html # HTML template
├── package.json # Project dependencies and scripts
├── vite.config.js # Vite configuration
└── README.md # This file
MIT License - feel free to use this project for your own Python feeding tracking needs!
This is a personal project, but suggestions and improvements are welcome!
- Ensure your browser allows localStorage
- Check browser console for any errors
- Try clearing browser cache and reloading
- Make sure all dependencies are installed:
pnpm install - Check Node.js version compatibility (v16+)
- Delete
node_modulesand reinstall if needed:rm -rf node_modules && pnpm install
If you encounter ERR_INVALID_THIS errors with pnpm 8.0.0 and Node.js v25+, you need to upgrade pnpm:
Option 1: Using npm (if available)
npm install -g pnpm@latestOption 2: Using the standalone installer
curl -fsSL https://get.pnpm.io/install.sh | sh -Option 3: Using corepack (Node.js 16.9+)
corepack enable
corepack prepare pnpm@latest --activateAfter upgrading, verify with pnpm --version and try installing again.
If port 5173 is already in use, Vite will automatically use the next available port. Check the terminal output for the actual port number.