Skip to content

D35P4C1T0/PythonHealthHub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PythonHealthHub - Python Feeding Tracker

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.

Features

  • 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

Screenshots

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

Prerequisites

  • Node.js (v16 or higher recommended)
  • pnpm package manager (Install pnpm)

Installation

  1. Clone or download this repository
  2. Install dependencies:
pnpm install

Development

To start the development server:

pnpm dev

The app will be available at http://localhost:5173 (or the next available port).

Building for Production

To create a production build:

pnpm build

The built files will be in the dist directory. You can preview the production build with:

pnpm preview

Usage

  1. 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
  2. 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
  3. Data Persistence: All data is automatically saved to your browser's localStorage. Your feeding log persists across browser sessions.

Customization

Changing the Snake's Name

Edit src/App.svelte and change the SNAKE_NAME constant:

const SNAKE_NAME = "Your Snake's Name";

Changing Storage Key

To change the localStorage key used for storing data, modify the STORAGE_KEY constant:

const STORAGE_KEY = 'yourCustomKey';

Data Structure

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)
}

Browser Compatibility

This application works in all modern browsers that support:

  • ES6+ JavaScript
  • localStorage API
  • CSS Grid and Flexbox

Technologies Used

  • Svelte: Reactive UI framework
  • Vite: Fast build tool and dev server
  • localStorage: Browser-based data persistence

Project Structure

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

License

MIT License - feel free to use this project for your own Python feeding tracking needs!

Contributing

This is a personal project, but suggestions and improvements are welcome!

Troubleshooting

Data Not Persisting

  • Ensure your browser allows localStorage
  • Check browser console for any errors
  • Try clearing browser cache and reloading

Build Errors

  • Make sure all dependencies are installed: pnpm install
  • Check Node.js version compatibility (v16+)
  • Delete node_modules and reinstall if needed: rm -rf node_modules && pnpm install

pnpm Installation Errors (ERR_INVALID_THIS)

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@latest

Option 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 --activate

After upgrading, verify with pnpm --version and try installing again.

Port Already in Use

If port 5173 is already in use, Vite will automatically use the next available port. Check the terminal output for the actual port number.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors