Skip to content

Repository files navigation

Calorie Tracker

A full-stack web application for logging meals, tracking daily calorie intake, and monitoring nutrition goals over time. Built with Next.js and TypeScript, with secure user authentication and a persistent database.

Live demo: calorie-tracker-ashy.vercel.app

Overview

Calorie Tracker lets users create an account, log the foods they eat throughout the day, and see their calorie totals against a personal goal. Each user's data is private to their account, persisted in a database, and available across sessions.

The project was built to practice end-to-end application development: designing a data model, wiring up authentication, building a typed frontend, and deploying to production.

Features

  • User authentication — secure sign-up and login via NextAuth
  • Daily food logging — add meals and entries with calorie values
  • Calorie totals & goals — track intake against a personal daily target
  • Per-user data — each account's entries are private and persisted
  • Responsive UI — works across desktop and mobile

Tech Stack

Layer Technology
Framework Next.js (React)
Language TypeScript
Database ORM Prisma
Authentication NextAuth
Deployment Vercel

Getting Started

Prerequisites

  • Node.js (v18 or later)
  • A database supported by Prisma (e.g. PostgreSQL, SQLite)

Installation

  1. Clone the repository:

    git clone https://github.com/rogervera/calorie-tracker.git
    cd calorie-tracker
  2. Install dependencies:

    npm install
  3. Set up environment variables. Create a .env file in the root with:

    DATABASE_URL="your-database-connection-string"
    NEXTAUTH_SECRET="your-nextauth-secret"
    NEXTAUTH_URL="http://localhost:3000"
    
  4. Run database migrations:

    npx prisma migrate dev
  5. Start the development server:

    npm run dev
  6. Open http://localhost:3000 in your browser.

Project Structure

calorie-tracker/
├── prisma/          # Database schema and migrations
├── public/          # Static assets
├── src/             # Application source (pages, components, logic)
└── ...              # Config files

Development Notes

This project was developed with the assistance of AI-based development tools as part of a modern, AI-assisted workflow — used for scaffolding, debugging, and iteration while I directed the architecture, data model, and feature decisions.

License

This project is available for viewing as a portfolio piece.

About

A full-stack web application for logging meals

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages