Skip to content

A comprehensive, free web application for tracking and managing household utilities. Monitor meter readings, manage tariffs, track payments, and gain insights across multiple properties. Built with Next.js, TypeScript, and PostgreSQL. 100% Free, forever. πŸ πŸ“ŠπŸ’‘

License

Notifications You must be signed in to change notification settings

dyachoksa/utilities-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Utilities Tracker

A comprehensive, free web application for tracking and managing household utilities. Monitor meter readings, manage tariffs, track payments, and gain insights into your utility costs across multiple properties.

Features

🏠 Multiple Properties Management

  • Add and manage multiple households or properties
  • Organize utilities by location
  • Track different utility types per property

πŸ“Š Utility Types Support

  • Electricity
  • Gas
  • Water
  • Heating
  • Maintenance fees
  • And more

πŸ“ Meter Readings Tracking

  • Record meter readings with timestamps
  • Automatic consumption calculations
  • Historical data tracking

πŸ’° Smart Tariff Management

  • Counter-based tariffs
  • Fixed-rate tariffs
  • Area-based tariffs
  • Custom tariff configurations

πŸ’³ Payment Tracking

  • Record all utility payments
  • Payment history and analytics
  • Cost tracking over time

πŸ“ˆ Visual Analytics

  • Interactive charts and graphs
  • Cost trends and insights
  • Usage patterns analysis

πŸ”’ Privacy-Focused

  • User data protection
  • Transparent data practices
  • GDPR-compliant

🌍 Multi-Language Support

  • English
  • Ukrainian

Tech Stack

  • Frontend: Next.js 15, React 19, TypeScript
  • Styling: Tailwind CSS, shadcn/ui components
  • API: Hono framework with OpenAPI
  • Database: PostgreSQL with Drizzle ORM
  • Authentication: Better Auth
  • State Management: Zustand, TanStack Query
  • Internationalization: next-intl
  • Charts: Recharts

Getting Started

Prerequisites

  • Node.js 18+
  • PostgreSQL database
  • pnpm package manager

Installation

  1. Clone the repository:
git clone <repository-url>
cd utilities-tracker
  1. Install dependencies:
pnpm install
  1. Set up environment variables:
cp .env.example .env.local

Edit .env.local with your configuration:

BETTER_AUTH_SECRET=your-secret-key
BETTER_AUTH_URL=http://localhost:3000
DATABASE_URL=postgresql://username:password@localhost:5432/utilities_tracker
GITHUB_CLIENT_ID=your-github-client-id
GITHUB_CLIENT_SECRET=your-github-client-secret
LOG_LEVEL=info
NODE_ENV=development
  1. Set up the database:
# Generate and run migrations
pnpm drizzle-kit generate
pnpm drizzle-kit migrate
  1. Start the development server:
pnpm dev

Open http://localhost:3000 in your browser.

Available Scripts

  • pnpm dev - Start development server with Turbopack
  • pnpm build - Build for production
  • pnpm start - Start production server
  • pnpm lint - Run ESLint
  • pnpm lint:fix - Auto-fix ESLint issues
  • pnpm format - Format code with Prettier

Project Structure

src/
β”œβ”€β”€ api/                 # API routes and handlers
β”‚   β”œβ”€β”€ handlers/        # Route handlers
β”‚   β”œβ”€β”€ mappers/         # Data mappers
β”‚   β”œβ”€β”€ middlewares/     # API middlewares
β”‚   └── routes/          # Route definitions
β”œβ”€β”€ app/                 # Next.js app router pages
β”‚   β”œβ”€β”€ (auth)/          # Authentication pages
β”‚   β”œβ”€β”€ (public)/        # Public pages (landing, about, etc.)
β”‚   └── api/             # API route handlers
β”œβ”€β”€ components/          # React components
β”‚   β”œβ”€β”€ blocks/          # Page-specific component blocks
β”‚   β”œβ”€β”€ forms/           # Form components
β”‚   β”œβ”€β”€ ui/              # Reusable UI components
β”‚   └── ...
β”œβ”€β”€ db/                  # Database schemas and migrations
β”œβ”€β”€ hooks/               # Custom React hooks
β”œβ”€β”€ lib/                 # Utility libraries
β”œβ”€β”€ services/            # Business logic services
β”œβ”€β”€ stores/              # Zustand state stores
β”œβ”€β”€ types/               # TypeScript type definitions
└── ...

API Documentation

The API is built with Hono and includes OpenAPI documentation. Available endpoints:

  • Households: /api/households - Manage properties
  • Providers: /api/providers - Utility service providers
  • Tariffs: /api/tariffs - Tariff configurations
  • Payments: /api/payments - Payment records
  • Stats: /api/stats - Analytics and statistics

Authentication

Uses Better Auth for secure authentication with support for:

  • Email/password registration
  • GitHub OAuth
  • Session management

Database Schema

The application uses PostgreSQL with the following main entities:

  • Users (via Better Auth)
  • Households/Properties
  • Providers
  • Tariffs
  • Payments
  • Meter Readings

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/your-feature
  3. Make your changes and run tests
  4. Commit your changes: git commit -m 'Add some feature'
  5. Push to the branch: git push origin feature/your-feature
  6. Open a pull request

Code Quality

  • Linting: ESLint with Next.js and React rules
  • Formatting: Prettier with import sorting
  • TypeScript: Strict mode enabled
  • Code Style: 120 character width, 2-space indentation

Deployment

The application can be deployed to any platform supporting Next.js:

  1. Build the application: pnpm build
  2. Set up production environment variables
  3. Deploy to your preferred platform (Vercel, Netlify, etc.)

License

This project is open source and available under the MIT License.

Support

For questions or support, please open an issue on GitHub.


Utilities Tracker - Track your utilities, save on costs, stay organized. 100% Free, forever.

About

A comprehensive, free web application for tracking and managing household utilities. Monitor meter readings, manage tariffs, track payments, and gain insights across multiple properties. Built with Next.js, TypeScript, and PostgreSQL. 100% Free, forever. πŸ πŸ“ŠπŸ’‘

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages