Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
3bec13c
Added different categories of configs
Dec 19, 2025
1d605eb
Added support for custom styling
Dec 19, 2025
d2c9119
Added id and classes to add custom styles
Dec 19, 2025
ed34723
Refactor FilePreviewModal and ThemeToggle for improved class handling…
Dec 19, 2025
fdf453d
Added Feature flag based enable/disable
Dec 19, 2025
b545c5f
Updated README and docs
Dec 19, 2025
eee16ad
Added these support
Dec 19, 2025
08aa791
Enhanced Mobile UI for Tabs
Dec 19, 2025
5a11f27
Refactor FileDropZone and ThemeToggle for improved styling; reintrodu…
Dec 19, 2025
a8a5e97
Fixed file drop zone id bug
Dec 19, 2025
fc7051d
Fixed Mobile file preview
Dec 19, 2025
47656e4
fix(vehicle): preserve image on edit; stop sending image=null
javedh-dev Dec 20, 2025
4815988
Merge pull request #139 from javedh-dev/fix/issue-137-vehicle-image-edit
javedh-dev Dec 20, 2025
3b85c10
Added support for custom fiels in vehicle
Dec 20, 2025
95efc98
Added default image
Dec 20, 2025
794d623
feat(vehicle): add option to remove existing image on save
Dec 20, 2025
55b629c
Fixed Diabled Auth issue
Dec 20, 2025
60e9de2
Ensure App Dirs on Startup and Bump Deps
Dec 28, 2025
f230cc6
Add precomposed Apple touch icon
Dec 28, 2025
8e1e8d0
Add recurrence support for insurances, PUCC and reminders
Dec 29, 2025
e1b7f14
feat: add next due date calculation for insurances and pollution cert…
Dec 29, 2025
b635563
Merge branch 'main' into dev
Dec 29, 2025
4d66f57
Added support for import fuel logsusing CSV file
Dec 29, 2025
86c8640
Added support for i18n
Dec 29, 2025
0bdd1ec
Refactor fuel and overview components to utilize message functions fo…
Dec 29, 2025
dee0929
Refactor maintenance, pollution, and reminder components to use local…
Dec 30, 2025
e2f6493
Add delete confirmation dialog messages for localization
Dec 30, 2025
06683fe
Enhance localization support across multiple components and JSON file…
Dec 30, 2025
7c05eb9
Enhance localization support by adding recurrence and reminder labels…
Dec 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@ Thumbs.db
temp/
**/*.db-journal

uploads/
uploads/

# Paraglide
src/lib/paraglide
project.inlang/cache/
30 changes: 20 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@

## ✨ Features

- 🚗 **Vehicle Management:** Add, edit, and manage multiple vehicles.
- 🚗 **Vehicle Management:** Add, edit, and manage multiple vehicles with support for different fuel types.
- ⛽ **Fuel Tracking:** Log fuel refills and monitor fuel efficiency over time.
- 🛠️ **Maintenance Log:** Record and view maintenance history for each vehicle.
- 📄 **Document Tracking:** Track insurance, pollution certificates, and other important documents.
- 📊 **Dashboard:** Visualize key metrics and upcoming renewals.
- 📄 **Document Tracking:** Track insurance and pollution certificates with renewal dates.
- 🔔 **Reminders:** Set and manage reminders for maintenance, renewals, and other vehicle events.
- 📊 **Dashboard:** Visualize key metrics, analytics, and upcoming renewals.
- 🔒 **User Authentication:** Secure username/password authentication with session management.
- 🎨 **Feature Toggles:** Enable or disable specific features based on your needs.

## 🖼️ images
## 🖼️ Screenshots

<p align="center">
<h3>🔐 Login Page</h3><br>
Expand Down Expand Up @@ -82,20 +84,28 @@

## 🛠️ Tech Stack

- 🎨 **Frontend:** SvelteKit, Tailwind CSS
- 🖥️ **Backend:** Node.js, Express.js
- 🗄️ **Database:** SQLite, sequelize ORM
- 🐳 **Containerization:** Docker & Docker Compose
- 🎨 **Frontend:** SvelteKit, Tailwind CSS, Svelte 5
- 🖥️ **Backend:** SvelteKit Server Routes
- 🗄️ **Database:** SQLite with Drizzle ORM
- 🐳 **Deployment:** Docker & Docker Compose

## 🚀 Getting Started

Please check the [installation guide](./docs/installation.md) for detailed instructions on setting up the project.
Refer to the [installation guide](./docs/installation.md) for setup instructions.

## 📚 Documentation

- [Installation Guide](./docs/installation.md) - Setup instructions for Docker, local development, and Proxmox LXC
- [Authentication](./docs/authentication.md) - User authentication and session management
- [Environment Variables](./docs/environment.md) - Configuration options
- [Feature Toggles](./docs/feature-toggles.md) - Customizing enabled features
- [Contributing](./docs/contributing.md) - Guidelines for contributing

## 🤝 Contributing

Contributions are welcome! Please read the [contributing guidelines](./docs/contributing.md) before submitting a pull request.

Please consider supporting this project by giving it a star! ⭐ or [sponsoring](https://github.com/sponsors/javedh-dev).
Consider supporting this project by giving it a star ⭐ or [sponsoring](https://github.com/sponsors/javedh-dev).

## 📄 License

Expand Down
91 changes: 34 additions & 57 deletions docs/authentication.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,30 @@
# Authentication System
# Authentication

Tracktor uses a modern username/password authentication system with session management for secure access to your vehicle data.
Tracktor uses username/password authentication with session management for secure access.

## Overview
## Features

The authentication system has been migrated from PIN-based authentication to a more robust username/password system with the following features:
- **Username/Password Authentication**: Secure login credentials
- **Session Management**: HTTP-only secure session cookies
- **User Registration**: First time account creation through web interface
- **Password Hashing**: Bcrypt-based password security
- **Session Expiration**: Automatic expiration after 30 days of inactivity

- **Username/Password Authentication**: Secure login with username and password
- **Session Management**: Uses secure session cookies for maintaining login state
- **User Registration**: Create new user accounts
- **Password Hashing**: Passwords are securely hashed using bcrypt
- **Session Expiration**: Sessions automatically expire after 30 days of inactivity
## Creating User Accounts

## Creating Your First User

When you first set up Tracktor, you'll need to create a user account. You can do this in two ways:

### Method 1: Through the Web Interface
### Web Interface

1. Navigate to the login page
2. If no users exist, you'll see a registration form
3. Enter your desired username and password
2. If no users exist, a registration form will be displayed
3. Enter username and password
4. Click "Create Account"
˝

### Method 2: Using the Command Line Script

```bash
pnpm tsx scripts/create-user.ts <username> <password>
```

Example:

```bash
pnpm tsx scripts/create-user.ts admin mypassword123
```

## API Authentication

For API access, the system uses session-based authentication:
## API Endpoints

### Login

```bash
```http
POST /api/auth
Content-Type: application/json

Expand All @@ -53,50 +36,44 @@ Content-Type: application/json

### Logout

```bash
```http
DELETE /api/auth
```

### Check Authentication Status

```bash
```http
GET /api/auth
```

## Session Management

- Sessions are stored in the database and linked to user accounts
- Session cookies are HTTP-only and secure (in production)
- Sessions automatically refresh when they're close to expiring
- Sessions are invalidated on logout

## Security Features

- **Password Hashing**: All passwords are hashed using bcrypt with salt rounds
- **Session Tokens**: Cryptographically secure session tokens
- **Automatic Cleanup**: Expired sessions are automatically removed
- **CSRF Protection**: Session cookies include CSRF protection
- Sessions stored in database and linked to user accounts
- HTTP-only secure cookies (in production)
- Automatic session refresh when approaching expiration
- Sessions invalidated on logout

## Migration from PIN Authentication
## Security

If you're upgrading from a PIN-based system:
- **Password Hashing**: Bcrypt with salt rounds
- **Session Tokens**: Cryptographically secure tokens
- **Automatic Cleanup**: Expired sessions removed automatically
- **CSRF Protection**: Built-in session cookie protection

1. The old PIN authentication table is preserved for backward compatibility
2. Create new user accounts using the registration system
3. The old PIN endpoints are still available but deprecated
4. Consider migrating to the new authentication system for better security
## Configuration

## Environment Variables
**Environment Variable**: `TRACKTOR_DISABLE_AUTH`

- `TRACKTOR_DISABLE_AUTH`: Set to 'true' to disable authentication (not recommended for production)
- Set to `true` to disable authentication (not recommended for production)
- Default: `false`

## Troubleshooting

### Can't Login
**Login Issues**:

- Ensure you've created a user account
- Check that your username and password are correct
- Clear your browser cookies if you're having session issues
- Verify user account exists
- Confirm username and password are correct
- Clear browser cookies if experiencing session issues

### Session Expired

Expand Down
57 changes: 42 additions & 15 deletions docs/contributing.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,49 @@
# Contributing

We welcome contributions from the community! If you'd like to contribute to this project, please follow these steps:
Contributions are welcome! Follow these guidelines to contribute to Tracktor.

1. Fork the repository on GitHub.
2. Clone your forked repository to your local machine.
3. Create a new branch for your feature or bug fix.
4. Make your changes and commit them with clear messages.
5. Run tests to ensure everything works as expected.
6. Run the linter to ensure code quality.
7. Push your changes to your forked repository.
8. Open a pull request against the main repository's master branch.
Please ensure your code adheres to the project's coding standards and includes appropriate tests. We appreciate your
contributions and look forward to collaborating with you!
## Getting Started

# License
1. Fork the repository on GitHub
2. Clone your forked repository to your local machine
3. Create a new branch for your feature or bug fix
4. Make your changes with clear, descriptive commit messages
5. Run tests to ensure everything works
6. Run the linter to maintain code quality
7. Push your changes to your forked repository
8. Open a pull request against the dev repository

This project is licensed under the MIT License. See the LICENSE file for details.
## Development Workflow

# Contact
### Running Tests

If you have any questions or need further assistance, feel free to reach out to the project maintainer at [[email protected]](mailto:[email protected])
```bash
pnpm run test
```

### Linting and Formatting

```bash
pnpm run lint
pnpm run format
```

## Guidelines

- Follow the project's coding standards
- Include appropriate tests for new features
- Write clear commit messages
- Update documentation when necessary
- Ensure all tests pass before submitting a pull request

## Code Quality

All contributions should maintain or improve code quality. Run linting and formatting tools before committing changes.

## License

This project is licensed under the MIT License. See the [LICENSE](../LICENSE) file for details.

## Contact

For questions or assistance, contact the project maintainer at [[email protected]](mailto:[email protected]).
Loading