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

Commit e9fcb13

Browse files
committed
latest
1 parent 0b45c21 commit e9fcb13

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+3911
-2116
lines changed

.rest

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
### Create Award Notice
2+
POST http://localhost:5058/api/v1/awards
3+
Content-Type: application/json
4+
5+
{
6+
"title": "Supply of Office Equipment",
7+
"amount": 1500000.00,
8+
"date": "2025-01-15",
9+
"details": "Procurement of various office equipment including printers, computers, and furniture.",
10+
"vendorId": "67df0d270e569b4642aa7e1b",
11+
"poId": "67df10d0c20892aff7d34020"
12+
}
13+
14+
### Get All Award Notices
15+
GET http://localhost:5000/api/v1/awards
16+
17+
18+
###
19+
GET https://backend-log1.axleshift.com/api/v1/warehouseLoc/locations
20+
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2N2UyZGI2MDJlMjg2MTI1YzU1MDJmMGEiLCJyb2xlIjoic3VwZXIgYWRtaW4iLCJlbWFpbCI6IkpvaG5sYXlkYTkyQGdtYWlsLmNvbSIsImlhdCI6MTc0MjkyMTA3NSwiZXhwIjoxNzQyOTI0Njc1fQ.Mj5O1RnMPyxwh1jemOaCcjlJYW-jWY8CSZXZpLi-wAw
21+
x-api-key: 0ad3f5c013c42d2d0537672a260978c71dcd5a7d508019d748f991deee3d65665a477e3523c6bbc83fd6a51a71dd5003
22+
23+
24+
25+
###
26+
GET http://localhost:5058/api/v1/notifications
27+
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2N2RmMGIwOTBlNTY5YjQ2NDJhYTdkZmYiLCJyb2xlIjoic3VwZXIgYWRtaW4iLCJlbWFpbCI6IkNoeXNldjQ3NUBnbWFpbC5jb20iLCJpYXQiOjE3NDMxOTgxMTQsImV4cCI6MTc0MzIwMTcxNH0.s8PmAMKFtuP13nvUANaPUoueYNvoUQpt59XT0EBIoWI

client/.env.example

Lines changed: 0 additions & 6 deletions
This file was deleted.

client/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
"build": "env-cmd -f ./.env vite build",
1717
"lint": "eslint \"src/**/*.js\"",
1818
"lint-fix": "eslint . --fix",
19-
"serve": "vite preview",
20-
"start": "vite"
19+
"serve": "vite preview --port 3000",
20+
"start": "vite --port 3000"
2121
},
2222
"dependencies": {
2323
"@coreui/chartjs": "^4.0.0",
@@ -67,6 +67,6 @@
6767
"postcss": "^8.4.38",
6868
"prettier": "3.3.2",
6969
"sass": "^1.77.5",
70-
"vite": "^6.2.0"
70+
"vite": "^6.2.3"
7171
}
7272
}

client/src/_nav.js

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ const _nav = [
4646
role_exclude: ['vendor', 'user', 'staff'],
4747
icon: <FontAwesomeIcon icon={faUsers} className="nav-icon" />,
4848
},
49+
{
50+
component: CNavItem,
51+
name: 'Award Management',
52+
to: '/award',
53+
role_exclude: ['vendor', 'user', 'staff'],
54+
icon: <FontAwesomeIcon icon={faBullhorn} className="nav-icon" />,
55+
},
4956
{
5057
component: CNavTitle,
5158
name: 'Procurement',
@@ -54,24 +61,38 @@ const _nav = [
5461
{
5562
component: CNavItem,
5663
name: 'Procurement request',
57-
to: '/procurement',
64+
to: '/procurement/procurement',
5865
role_exclude: ['vendor', 'staff'],
5966
icon: <FontAwesomeIcon icon={faBox} className="nav-icon" />,
6067
},
6168
{
6269
component: CNavItem,
63-
name: 'RFQ Management',
70+
name: 'PR & RFQ List',
6471
to: '/procurement/rfq-management',
6572
role_exclude: ['vendor', 'staff'],
6673
icon: <FontAwesomeIcon icon={faFileText} className="nav-icon" />,
6774
},
75+
{
76+
component: CNavItem,
77+
name: 'Vendor Quotes',
78+
to: '/procurement/submit-quote',
79+
role_exclude: ['vendor', 'staff'],
80+
icon: <FontAwesomeIcon icon={faBox} className="nav-icon" />,
81+
},
6882
{
6983
component: CNavItem,
7084
name: 'Purchase Order & Payment Tracking',
7185
to: '/procurement/po-payments',
7286
role_exclude: ['vendor', 'user', 'staff'],
7387
icon: <FontAwesomeIcon icon={faFileInvoiceDollar} className="nav-icon" />,
7488
},
89+
{
90+
component: CNavItem,
91+
name: 'Shipment & Delivery Tracking',
92+
to: '/procurement/shipments',
93+
role_exclude: ['vendor', 'user', 'staff'],
94+
icon: <FontAwesomeIcon icon={faTruck} className="nav-icon" />,
95+
},
7596
{
7697
component: CNavItem,
7798
name: 'Product Catalog',
@@ -82,7 +103,7 @@ const _nav = [
82103
{
83104
component: CNavItem,
84105
name: 'Reports & Dashboard',
85-
to: '/analytics',
106+
to: '/procurement/analytics',
86107
role_exclude: ['vendor', 'user', 'staff'],
87108
icon: <FontAwesomeIcon icon={faChartBar} className="nav-icon" />,
88109
},
@@ -93,25 +114,32 @@ const _nav = [
93114
},
94115
{
95116
component: CNavItem,
96-
name: 'RFQ Bidding',
117+
name: 'RFQ Announcements & Bidding',
97118
to: '/vendor/rfqs',
98119
role_exclude: ['user', 'staff'],
99120
icon: <FontAwesomeIcon icon={faBullhorn} className="nav-icon" />,
100121
},
101122
{
102123
component: CNavItem,
103-
name: 'Shipment & Delivery',
104-
to: '/vendor/shipments',
124+
name: 'Quotes Requests',
125+
to: '/vendor/quotes',
105126
role_exclude: ['user', 'staff'],
106-
icon: <FontAwesomeIcon icon={faShippingFast} className="nav-icon" />,
127+
icon: <FontAwesomeIcon icon={faBullhorn} className="nav-icon" />,
107128
},
108129
{
109130
component: CNavItem,
110-
name: 'Order & Invoice',
131+
name: 'Order & Payment',
111132
to: '/vendor/order-payment',
112133
role_exclude: ['user', 'staff'],
113134
icon: <FontAwesomeIcon icon={faReceipt} className="nav-icon" />,
114135
},
136+
{
137+
component: CNavItem,
138+
name: 'Shipment & Delivery',
139+
to: '/vendor/shipments',
140+
role_exclude: ['user', 'staff'],
141+
icon: <FontAwesomeIcon icon={faShippingFast} className="nav-icon" />,
142+
},
115143
{
116144
component: CNavItem,
117145
name: 'Communication Support',
@@ -127,7 +155,7 @@ const _nav = [
127155
{
128156
component: CNavItem,
129157
name: 'Logistics Dashboard',
130-
to: '/logistics',
158+
to: '/logistics/dashboard',
131159
role_exclude: ['vendor', 'user', 'staff'],
132160
icon: <FontAwesomeIcon icon={faTruckLoading} className="nav-icon" />,
133161
},
@@ -144,21 +172,21 @@ const _nav = [
144172
icon: <FontAwesomeIcon icon={faBoxes} className="nav-icon" />,
145173
},
146174
{
147-
component: CNavItem,
148-
name: 'Audit management',
149-
to: '/Audit',
175+
component: CNavTitle,
176+
name: 'ANALYTICS',
150177
role_exclude: ['vendor', 'user', 'staff'],
151-
icon: <FontAwesomeIcon icon={faReceipt} className="nav-icon" />,
152178
},
153179
{
154-
component: CNavTitle,
180+
component: CNavItem,
155181
name: 'Settings',
182+
to: '/settings',
156183
role_exclude: ['vendor', 'user', 'staff'],
184+
icon: <FontAwesomeIcon icon={faCog} className="nav-icon" />,
157185
},
158186
{
159187
component: CNavItem,
160-
name: 'Settings',
161-
to: '/settings',
188+
name: 'General Settings',
189+
to: '/settings/general',
162190
role_exclude: ['vendor', 'user', 'staff'],
163191
icon: <FontAwesomeIcon icon={faCog} className="nav-icon" />,
164192
},

client/src/api/api.js

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,49 @@ const API_URL = import.meta.env.VITE_API_URL
44

55
const api = axios.create({
66
baseURL: API_URL,
7-
withCredentials: true,
7+
withCredentials: true, // Automatically send cookies with requests
88
})
99

10+
// Request Interceptor
11+
api.interceptors.request.use(
12+
(config) => {
13+
if (config.data instanceof FormData) {
14+
config.headers['Content-Type'] = 'multipart/form-data'
15+
} else {
16+
config.headers['Content-Type'] = 'application/json'
17+
}
18+
return config
19+
},
20+
(error) => Promise.reject(error),
21+
)
22+
23+
// Response Interceptor (Handle 401 Unauthorized)
24+
api.interceptors.response.use(
25+
(response) => response,
26+
async (error) => {
27+
console.error('API Error:', error.response?.data?.message || error.message)
28+
29+
if (error.response?.status === 401) {
30+
try {
31+
// Attempt to refresh token automatically
32+
await api.post('/auth/refresh-token')
33+
return api(error.config) // Retry the failed request
34+
} catch (refreshError) {
35+
console.error('Session expired, redirecting to login...')
36+
window.location.href = '/login' // Redirect to login page
37+
}
38+
}
39+
40+
return Promise.reject(error)
41+
},
42+
)
43+
44+
// Reusable API functions
45+
export const apiService = {
46+
get: (url, params, headers = {}) => api.get(url, { params, headers }),
47+
post: (url, data) => api.post(url, data),
48+
put: (url, data) => api.put(url, data),
49+
delete: (url) => api.delete(url),
50+
}
51+
1052
export default api

0 commit comments

Comments
 (0)