Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
209e4c0
Removed setup script
javedh-dev Sep 10, 2025
3721d2a
Restructure Directories
javedh-dev Sep 10, 2025
898864d
Fixed broken links
javedh-dev Sep 10, 2025
0413d9c
Fixed gaps in chart for null mileage
javedh-dev Sep 10, 2025
01541f5
Fixed broken link
javedh-dev Sep 10, 2025
db62981
Changed theme toggle
javedh-dev Sep 10, 2025
33a1f1b
Fixed Authentication screen
javedh-dev Sep 11, 2025
e1ffe1a
Fixed demo mode alert with layouts
javedh-dev Sep 11, 2025
321866e
WIP: UI refresh
javedh-dev Sep 12, 2025
124d2be
WIP: UI refresh
javedh-dev Sep 12, 2025
797aa15
WIP: UI refresh
javedh-dev Sep 13, 2025
48b30af
Fixed graph and fuel log table
javedh-dev Sep 13, 2025
b0b0f11
Making UI consistent and changed chart library
javedh-dev Sep 14, 2025
484c147
Using App Sheet instead of modals
javedh-dev Sep 15, 2025
a7e0901
Added sheets for insurance and pucc as well
javedh-dev Sep 15, 2025
04f69d6
Added sheets for settings
javedh-dev Sep 15, 2025
ae6cf93
Fixed a small issue
javedh-dev Sep 15, 2025
82593a8
Making UI mobile responsive
javedh-dev Sep 15, 2025
3b6e552
Fixed UI loading screens
javedh-dev Sep 17, 2025
de64d56
Fixed config update to refresh screen
javedh-dev Sep 17, 2025
1119176
Fixed calendar issue on mobile devices
javedh-dev Sep 17, 2025
995bbd7
Added support for locale and seperate units for distance and volume
javedh-dev Sep 19, 2025
2da2cc8
Fixed timezone issue
javedh-dev Sep 19, 2025
09812aa
Commenting vehicle image.
javedh-dev Sep 19, 2025
50f9747
Fixed build error
javedh-dev Sep 19, 2025
a51263a
Fixed build error
javedh-dev Sep 20, 2025
311e0cc
Fixed DB migrations and settings
javedh-dev Sep 20, 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
2 changes: 1 addition & 1 deletion app/backend/drizzle.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default defineConfig({
schema: "./src/db/schema",
dialect: "sqlite",
dbCredentials: {
url: `file:${process.env.DATABASE_PATH! || "./tracktor.db"}`,
url: `file:${process.env.DB_PATH! || "./tracktor.db"}`,
},
casing: "snake_case",
});
5 changes: 2 additions & 3 deletions app/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
"dev": "tsx --watch index.ts",
"start": "node dist/index.js",
"preview": "npm run build && npm run start",
"db:migrate": "tsx src/db/migrate.ts migrate",
"db:seed": "tsx src/db/migrate.ts seed",
"db:status": "tsx src/db/status.ts",
"db:generate": "NODE_OPTIONS='--import tsx' drizzle-kit generate --custom",
"db:migrate": "NODE_OPTIONS='--import tsx' drizzle-kit migrate",
"format": "(eslint --fix . || true) && prettier --write .",
"lint": "eslint . && prettier --check .",
"clean": "rm -rf dist && rm -rf tracktor.db",
Expand Down
34 changes: 23 additions & 11 deletions app/backend/src/controllers/MaintenanceLogController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,24 @@ export const addMaintenanceLog = async (req: Request, res: Response) => {
if (!vehicleId) {
throw new MaintenanceLogError(
"Vehicle ID is required.",
Status.BAD_REQUEST,
Status.BAD_REQUEST
);
}
if (!date || !odometer || !serviceCenter || cost === undefined || cost === null) {
if (
!date ||
!odometer ||
!serviceCenter ||
cost === undefined ||
cost === null
) {
throw new MaintenanceLogError(
"Date, Odometer, ServiceCenter, and Cost are required.",
Status.BAD_REQUEST,
Status.BAD_REQUEST
);
}
const result = await maintenanceLogService.addMaintenanceLog(
vehicleId,
req.body,
req.body
);
res.status(201).json(result);
};
Expand All @@ -31,7 +37,7 @@ export const getMaintenanceLogs = async (req: Request, res: Response) => {
if (!vehicleId) {
throw new MaintenanceLogError(
"Vehicle ID is required.",
Status.BAD_REQUEST,
Status.BAD_REQUEST
);
}
const maintenanceLogs =
Expand All @@ -44,7 +50,7 @@ export const getMaintenanceLogById = async (req: Request, res: Response) => {
if (!id) {
throw new MaintenanceLogError(
"Maintenance Log ID is required.",
Status.BAD_REQUEST,
Status.BAD_REQUEST
);
}

Expand All @@ -54,18 +60,24 @@ export const getMaintenanceLogById = async (req: Request, res: Response) => {

export const updateMaintenanceLog = async (req: Request, res: Response) => {
const { id } = req.params;
const { date, odometer, service, cost } = req.body;
const { date, odometer, serviceCenter, cost } = req.body;

if (!id) {
throw new MaintenanceLogError(
"Maintenance Log ID is required.",
Status.BAD_REQUEST,
Status.BAD_REQUEST
);
}
if (!date || !odometer || !service || cost === undefined || cost === null ) {
if (
!date ||
!odometer ||
!serviceCenter ||
cost === undefined ||
cost === null
) {
throw new MaintenanceLogError(
"Date, Odometer, Service, and Cost are required.",
Status.BAD_REQUEST,
Status.BAD_REQUEST
);
}
const result = await maintenanceLogService.updateMaintenanceLog(id, req.body);
Expand All @@ -77,7 +89,7 @@ export const deleteMaintenanceLog = async (req: Request, res: Response) => {
if (!id) {
throw new MaintenanceLogError(
"Maintenance Log ID is required.",
Status.BAD_REQUEST,
Status.BAD_REQUEST
);
}

Expand Down
9 changes: 4 additions & 5 deletions app/backend/src/controllers/VehicleController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const addVehicle = async (req: Request, res: Response) => {
if (!make || !model || !year || !licensePlate) {
new VehicleError(
"Make, Model, Year, and License Plate are required.",
Status.BAD_REQUEST,
Status.BAD_REQUEST
);
}
const result = await vehicleService.addVehicle(req.body);
Expand All @@ -30,13 +30,12 @@ export const getVehicleById = async (req: Request, res: Response) => {
};

export const updateVehicle = async (req: Request, res: Response) => {
const { id } = req.params;
const { make, model, year, licensePlate } = req.body;
const { id, make, model, year, licensePlate } = req.body;

if (!make || !model || !year || !licensePlate) {
if (!id || !make || !model || !year || !licensePlate) {
throw new VehicleError(
"Make, Model, Year, and License Plate are required.",
Status.BAD_REQUEST,
Status.BAD_REQUEST
);
}
if (!id) {
Expand Down
1 change: 1 addition & 0 deletions app/backend/src/db/migrations/20250910072104_init.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
DROP TABLE IF EXISTS `migrations`;
--> statement-breakpoint
DROP TABLE IF EXISTS `config`;
--> statement-breakpoint
CREATE TABLE IF NOT EXISTS `auth` (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
DELETE from `configs` where key = 'unitOfMeasure';
--> statement-breakpoint
INSERT into `configs` values ('unitOfDistance','kilometer','Unit of measure for distance', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
--> statement-breakpoint
INSERT into `configs` values ('unitOfVolume','liter','Unit of measure for volume', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
--> statement-breakpoint
INSERT into `configs` values ('locale','en','Locale for all formatting options', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
--> statement-breakpoint
INSERT into `configs` values ('timezone','UTC','Timezone to be used for all dates', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
Loading
Loading