A modern, responsive web application for tracking daily food intake, calories, and nutritional information. Built with TypeScript, Vite, and Appwrite for a seamless food logging experience.
- User Registration & Login: Secure authentication powered by Appwrite
- Session Management: Persistent login sessions with automatic logout
- User Profiles: Personalized experience for each user
- Smart Food Search: Real-time search through comprehensive food database
- Nutritional Information: Track calories, protein, fat, carbs, and fiber
- Custom Portions: Add foods with custom gram amounts
- Food Categories: Organized by food types (proteins, carbs, fats, dairy, etc.)
- Alkaline Tracking: Monitor alkaline vs acidic food balance
- Personalized Goals: Set daily targets for calories and macronutrients
- Progress Tracking: Visual progress indicators for daily goals
- Goal Management: Update and modify nutritional goals anytime
- Date Selection: Navigate through different dates
- Daily Overview: View food entries for any selected date
- Monthly Navigation: Browse through months to track progress
- Responsive Design: Works seamlessly on desktop and mobile devices
- Real-time Updates: Instant feedback and live nutritional calculations
- Keyboard Navigation: Full keyboard support for power users
- Food Editing: Edit or delete previously logged food entries
- TypeScript: Type-safe JavaScript for better development experience
- Vite: Fast build tool and development server
- HTML5 & CSS3: Modern web standards for UI/UX
- SweetAlert: Beautiful and responsive popup alerts
- Appwrite: Backend-as-a-Service for authentication and database
- User authentication and session management
- Document database for food entries and user settings
- Real-time data synchronization
- NPM: Package management
- Git: Version control
- Node.js (v14 or higher)
- NPM or Yarn package manager
- Appwrite server instance (cloud or self-hosted)
Create a .env file in the root directory with:
VITE_APPWRITE_ENDPOINT=your_appwrite_endpoint
VITE_APPWRITE_DBID=your_database_id
VITE_APPWRITE_FOODENTRIESID=your_food_entries_collection_id
VITE_APPWRITE_USERSETTINGSID=your_user_settings_collection_id-
Clone the repository
git clone https://github.com/yourusername/calories-tracker.git cd calories-tracker -
Install dependencies
npm install
-
Set up environment variables
- Copy
.env.exampleto.env - Configure your Appwrite credentials
- Copy
-
Start development server
npm run dev
-
Open in browser
- Navigate to
http://localhost:5173
- Navigate to
# Build the project
npm run build
# Preview the production build
npm run previewcalories-tracker/
βββ src/
β βββ index.ts # Main application entry point
β βββ types.ts # TypeScript type definitions
β βββ appwrite.ts # Appwrite client and database functions
β βββ foodDatabase.ts # Local food database
β βββ HtmlUtil.ts # DOM utility functions
βββ assets/
β βββ manifest.json # PWA manifest
βββ vite.config.js # Vite configuration
βββ package.json # Project dependencies and scripts
βββ README.md # Project documentation
The application includes a comprehensive local food database featuring:
- Categories: Proteins, carbs (high/low), fats, dairy, fruits, leaves
- Nutritional Data: Calories, protein, fat, carbs, fiber per 100g
- Alkaline Classification: Foods marked as alkaline or acidic
- Search Functionality: Name and category-based search with accent support
- User registers or logs in through Appwrite
- Session management maintains login state
- All food entries are tied to authenticated users
- Search for food items in real-time
- Select desired food from search results
- Enter custom portion size (grams)
- Preview nutritional information
- Add to daily food log
- Food Entries: Stored with date, time, and user association
- User Settings: Personalized nutritional goals
- Real-time Sync: All data synchronized with Appwrite backend
The application is fully responsive and optimized for:
- Desktop: Full-featured interface with keyboard shortcuts
- Tablet: Touch-optimized controls and layouts
- Mobile: Streamlined mobile experience
- Secure Authentication: Appwrite handles all authentication securely
- Data Privacy: User data is isolated and protected
- Session Management: Automatic logout and session validation
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the ISC License - see the LICENSE file for details.
- Barcode Scanning: Add foods by scanning barcodes
- Meal Planning: Plan meals in advance
- Export Data: Export nutritional data to CSV/PDF
- Social Features: Share progress with friends
- Recipe Database: Create and track custom recipes
- Weight Tracking: Monitor weight alongside nutrition
Built with β€οΈ for healthy living and mindful eating.