Logic + UI upgrade

This commit is contained in:
EdiFarcas
2025-07-07 11:08:29 +03:00
parent 024e5ca656
commit 1e1926539a
14 changed files with 305 additions and 245 deletions
+66 -20
View File
@@ -1,36 +1,82 @@
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
# Car Fuel Tracking App
A modern web application to track your car's fuel fill-ups, mileage, and fuel statistics. Built with Next.js, React, Prisma, and PostgreSQL, it provides a beautiful dashboard for managing your vehicles and analyzing fuel efficiency over time.
## Features
- 🚗 **Multi-car support**: Track multiple vehicles, each with its own stats and history.
-**Fill-up logging**: Record every fuel fill-up with mileage, liters, cost, and currency.
- 🛣️ **Mileage tracking**: Log odometer readings to monitor your driving habits.
- 📊 **Statistics dashboard**: View total distance, fuel used, cost, average consumption, and more.
- 🔒 **Authentication**: Secure login and registration with hashed passwords.
- 🌗 **Responsive & modern UI**: Clean, mobile-friendly design with dark mode support.
## Tech Stack
- [Next.js](https://nextjs.org/) (App Router)
- [React](https://react.dev/)
- [Prisma ORM](https://www.prisma.io/)
- [PostgreSQL](https://www.postgresql.org/)
- [NextAuth.js](https://next-auth.js.org/) (Credentials provider)
- [Tailwind CSS](https://tailwindcss.com/)
- TypeScript
## Getting Started
First, run the development server:
### Prerequisites
- Node.js 18+
- PostgreSQL database
### 1. Clone the repository
```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
git clone <your-repo-url>
cd Car-Fuel-Tracking-App
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
### 2. Install dependencies
```bash
npm install
```
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
### 3. Configure environment variables
Create a `.env` file in the root with the following:
```
DATABASE_URL=postgresql://<user>:<password>@<host>:<port>/<db>
NEXTAUTH_SECRET=your_secret_key
```
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
### 4. Set up the database
Run Prisma migrations to set up the schema:
```bash
npx prisma migrate deploy
# or for development
npx prisma migrate dev
```
## Learn More
### 5. Start the development server
```bash
npm run dev
```
To learn more about Next.js, take a look at the following resources:
Open [http://localhost:3000](http://localhost:3000) in your browser.
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
## Project Structure
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
- `src/app/` — Next.js app directory (routes, pages, API)
- `src/components/` — Reusable UI components
- `prisma/schema.prisma` — Database schema
- `src/lib/` — Auth and Prisma helpers
- `public/` — Static assets
## Deploy on Vercel
## Scripts
- `npm run dev` — Start development server
- `npm run build` — Build for production
- `npm start` — Start production server
- `npm run lint` — Lint code
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
## Database Schema
See [`prisma/schema.prisma`](prisma/schema.prisma) for models: `User`, `Car`, `FillUp`, `MileageEntry`, enums for `FuelType` and `Currency`.
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
---
> Built with passion using Next.js, Prisma, and Tailwind CSS.