Skip to content

ach206/junkyard-tracker

Repository files navigation

Junk Tracker 3000

A vehicle inventory management system for junkyards. Track different vehicle types (sedans, coupes, mini-vans, motorcycles) with automatic registration and a clean dashboard interface.

What It Does

This app helps junkyards keep track of their vehicle inventory. You can:

  • Add vehicles with type-specific details (wheels, doors, engine status, etc.)
  • Automatically register each vehicle with a unique ID
  • View and filter your inventory
  • See mileage ratings at a glance

Tech Stack

Built with modern web technologies:

  • Next.js - React framework for the frontend and API routes
  • React - UI components
  • TypeScript - Type-safe JavaScript
  • NextAuth.js - Handles user authentication

Getting Started

Prerequisites

  • Node.js 18 or higher

Installation

  1. Install dependencies:

    npm install
  2. Start the development server:

    npm run dev
  3. Open your browser to http://localhost:3000

Project Structure

├── __tests__/      # Test files for core features
├── components/     # Reusable React components (forms, lists, etc.)
├── pages/          # Next.js pages and API endpoints
├── styles/         # Global CSS styles
├── types/          # TypeScript type definitions
└── utils/          # Helper functions (mileage calculations, etc.)

Testing

The project includes comprehensive tests for core features:

  • Utility Functions: Mileage calculations, type guards, vehicle factory, storage service
  • API Routes: Registration endpoint, subscription endpoint with rate limiting
  • Test Coverage: 40+ tests covering critical business logic

Run tests with:

npm test

Test files are located in __tests__/ and follow Jest + React Testing Library best practices.

Development

Available Commands

  • npm run dev - Start the development server (with hot reload)
  • npm run build - Create a production build
  • npm start - Run the production build locally
  • npm test - Run test suite
  • npm test:watch - Run tests in watch mode
  • npm test:coverage - Generate test coverage report

Environment Variables

Optional - App works without env vars. Defaults:

  • Auth: admin / password123
  • Newsletter: Dev mode (logs to console)

For Production (Vercel):

NEXTAUTH_SECRET=your-secret-key-here
RESEND_API_KEY=re_your_api_key_here  # Get from resend.com
RESEND_FROM_EMAIL=noreply@yourdomain.com
NEXT_PUBLIC_SITE_URL=https://your-app.vercel.app

About

Inventory management system for junkyards

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors