Skip to content
This repository was archived by the owner on Nov 23, 2025. It is now read-only.
Merged

Dev #18

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
9a0f0fa
Update admin dashboard pages
mehara-rothila Nov 6, 2025
a67c8ed
Update user dashboard pages and layout
mehara-rothila Nov 6, 2025
bc8d90a
Update vehicle form component and API client
mehara-rothila Nov 6, 2025
4e0fca5
Update service layer implementations
mehara-rothila Nov 6, 2025
cc78164
Update TypeScript type definitions
mehara-rothila Nov 6, 2025
e3188b7
Update package dependencies
mehara-rothila Nov 6, 2025
fb852a5
Integrate PayHere payment gateway on invoice page
mehara-rothila Nov 9, 2025
60c5f14
Fix TimeLog property names in EmployeeDashboard
mehara-rothila Nov 9, 2025
96f1d8a
feat: Implement runtime configuration for API base URL and update api…
RandithaK Nov 9, 2025
881056e
feat: Add entrypoint script to generate runtime configuration and sta…
RandithaK Nov 9, 2025
416d4cc
refactor: Remove hardcoded API base URL from build process
RandithaK Nov 9, 2025
57b3852
Merge pull request #17 from TechTorque-2025/devOps
RandithaK Nov 9, 2025
f2c1c3e
Notification UI
DinithEdirisinghe Nov 9, 2025
e89e7a0
Merge pull request #19 from TechTorque-2025/dinith-notifications
mehara-rothila Nov 9, 2025
b525e6d
Update appointment types with username field
mehara-rothila Nov 10, 2025
1c29c6a
Add project status and approval types
mehara-rothila Nov 10, 2025
b885aff
Implement part-payment types for 50-50 deposit system
mehara-rothila Nov 10, 2025
ff87b4e
Update appointment service for username-based assignment
mehara-rothila Nov 10, 2025
28fd2c1
Add project approval and rejection endpoints
mehara-rothila Nov 10, 2025
d31dae7
Enhance appointment detail page with username input
mehara-rothila Nov 10, 2025
7b91ab5
Add approval/rejection UI to project detail page
mehara-rothila Nov 10, 2025
1b7f35e
Improve user management interface
mehara-rothila Nov 10, 2025
6845b69
Optimize component rendering performance
mehara-rothila Nov 10, 2025
db3063a
Add peer dependency flag to multiple packages in package-lock.json
RandithaK Nov 10, 2025
e436d19
Refactor registration request to use 'fullName' instead of 'username'…
RandithaK Nov 10, 2025
585d12e
Merge branch 'dev' into MRR-Integration
RandithaK Nov 10, 2025
265f86d
Merge pull request #21 from TechTorque-2025/MRR-Integration
RandithaK Nov 10, 2025
0d1b538
chore: commit all changes (automated)
RandithaK Nov 11, 2025
f29671f
style: improve NotificationBell component layout and styling
RandithaK Nov 11, 2025
83a5ea0
feat: implement RoleSwitcher component and integrate role management …
RandithaK Nov 11, 2025
ce2237f
feat: enhance ServiceTypesPage with create, edit, delete, and toggle …
RandithaK Nov 11, 2025
b4df449
feat: add user activation/deactivation functionality with confirmatio…
RandithaK Nov 11, 2025
cd75020
feat: update service type fetching to retrieve only active service types
RandithaK Nov 11, 2025
d96438e
feat: implement time tracking functionality with clock in/out feature…
RandithaK Nov 11, 2025
838e6fd
feat: Add role-based access control for user role management and upda…
Akith-002 Nov 11, 2025
7b79b1c
refactor: Change service type deletion from soft delete to hard delet…
Akith-002 Nov 11, 2025
ba9415a
feat: Add customer confirmation for appointment completion and update…
Akith-002 Nov 11, 2025
c7a9fea
refactor: Remove unused imports and clean up appointment service code
Akith-002 Nov 11, 2025
722ae77
feat: Add clock-in functionality to appointment service and update ap…
RandithaK Nov 11, 2025
5c3f926
refactor: Update notification callback type to unknown and improve We…
RandithaK Nov 11, 2025
f02ffc0
feat: Add git hooks for linting and build checks; include setup scrip…
RandithaK Nov 11, 2025
2258fe0
refactor: Remove unused state variables and improve vehicle loading l…
RandithaK Nov 11, 2025
0ecf060
Merge pull request #23 from TechTorque-2025/randitha-superbranch
RandithaK Nov 11, 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
19 changes: 19 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# Git pre-commit hook to run ESLint
# This hook runs on every commit to ensure code quality

echo "🔍 Running ESLint check..."

# Run lint check
npm run lint

# Check the exit status
if [ $? -ne 0 ]; then
echo "❌ ESLint failed. Please fix the linting errors before committing."
echo "💡 Run 'npm run lint' to see the issues"
exit 1
fi

echo "✅ ESLint passed! Commit is proceeding..."
exit 0
19 changes: 19 additions & 0 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# Git pre-push hook to run build check
# This hook runs before pushing to ensure the project builds successfully

echo "🏗️ Running build check before push..."

# Run build check
npm run build

# Check the exit status
if [ $? -ne 0 ]; then
echo "❌ Build failed. Please fix the build errors before pushing."
echo "💡 Run 'npm run build' to see the issues"
exit 1
fi

echo "✅ Build passed! Push is proceeding..."
exit 0
4 changes: 0 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ jobs:
run: npm run lint

- name: Build production bundle
env:
NEXT_PUBLIC_API_BASE_URL: https://api.techtorque.randitha.net
run: npm run build

- name: Run a minimal start for smoke test (background)
Expand Down Expand Up @@ -106,5 +104,3 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
NEXT_PUBLIC_API_BASE_URL=https://api.techtorque.randitha.net
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static

# Copy entrypoint script
COPY entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh

# Change ownership to nextjs user
RUN chown -R nextjs:nodejs /app

Expand All @@ -57,5 +61,5 @@ EXPOSE 3000
ENV HOSTNAME="0.0.0.0"
ENV PORT=3000

# Start the Next.js server
CMD ["node", "server.js"]
# Start via entrypoint script (generates runtime config)
CMD ["/app/entrypoint.sh"]
61 changes: 61 additions & 0 deletions GIT_HOOKS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Git Hooks

This project uses git hooks to maintain code quality and ensure builds pass before commits and pushes.

## Hooks Installed

- **pre-commit**: Runs `npm run lint` before each commit
- Prevents commits if ESLint errors are found
- Ensures code follows the project's linting standards

- **pre-push**: Runs `npm run build` before each push
- Prevents pushes if the build fails
- Ensures the project compiles successfully before sharing changes

## Setup

Run the setup script to configure git hooks:

```bash
./setup-hooks.sh
```

Or manually configure:

```bash
chmod +x .githooks/pre-commit .githooks/pre-push
git config core.hooksPath .githooks
```

## Bypassing Hooks

Sometimes you may need to bypass hooks (use sparingly):

```bash
# Skip pre-commit hook
git commit --no-verify -m "your message"

# Skip pre-push hook
git push --no-verify
```

## Hook Details

### Pre-commit Hook
- Runs automatically on `git commit`
- Executes `npm run lint`
- Exits with error code if linting fails
- Shows helpful error messages

### Pre-push Hook
- Runs automatically on `git push`
- Executes `npm run build`
- Exits with error code if build fails
- Prevents pushing broken code to remote repository

## Benefits

✅ **Code Quality**: Ensures all committed code passes linting standards
✅ **Build Safety**: Prevents pushing code that doesn't compile
✅ **Team Consistency**: All developers follow the same quality checks
✅ **CI/CD Friendly**: Reduces failed builds in CI/CD pipelines
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,9 @@ This repository contains the source code for the TechTorque 2025 customer and em

3. **Access Application:**
Open [http://localhost:3000](http://localhost:3000) in your browser.

4. **Setup Git Hooks (Recommended):**
```bash
npm run setup-hooks
```
This configures automatic linting on commit and build checking on push. See [GIT_HOOKS.md](GIT_HOOKS.md) for details.
15 changes: 15 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh
# entrypoint.sh - Generate runtime config and start Next.js

# Generate runtime configuration file
cat > /app/public/runtime-config.js <<EOF
window.__RUNTIME_CONFIG__ = {
NEXT_PUBLIC_API_BASE_URL: "${NEXT_PUBLIC_API_BASE_URL:-http://localhost:8080}"
};
EOF

echo "Runtime configuration generated:"
cat /app/public/runtime-config.js

# Start Next.js server
exec node server.js
Loading