Skip to main content

Overview

Overview (C4 Component)

Routing

AspectExplanation
Router instancecreateRouter() + createWebHistory() with linkActiveClass: 'active'.
Structural decompositionOne file (src/router/index.js) centralises
• route table definition
• global navigation guard
• export of the router instance.
Dynamic root redirectThe / route computes the target at run-time:
if role === 'PROVIDER' → /providers/{opsCode} else `/home``.
Public vs. protected routesRoutes carry meta.requiresAuth. The guard checks authStore.accessToken and authStore.user.
Role-based access control (RBAC)Each protected route lists allowed roles in meta.roles.
The guard compares the user’s first role (roles[0]) and rejects with a root redirect otherwise.
Login / Register bypassIf an authenticated user navigates to /login or /register, the guard forwards them to their role landing page.
Logout edge caseauthStore.isLoggingOut short-circuits the guard to avoid redirect loops during sign-out.
Lazy evaluation of paramsDynamic segments for business identifiers
/rfq/:year/:sequence
/providers/:operationalCode/sngs/edit/:id
Pass props: true where the page expects typed params.
Wildcard fallback/:pathMatch(.*)* → /login ensures unknown URLs go to the login page.

Site Structure

Route namePath patternAllowed roles
(checked in meta.roles)
Responsibility / key behaviour
Root/ (redirect)n/aComputes landing page at run-time: PROVIDER → /providers/{opsCode}; internal users → /home.
LoginPage/loginPublicEmail + password sign-in, loads user profile & pushes role dashboard. Bounces authenticated users away.
RegisterPage/registerPublicSelf-registration; optional provider flag + company name. Shows validation and “user exists” 409 handling.
HomePage/homeES_ADMIN, ES_USERInternal dashboard → provider discovery & RFQ creation wizard. Includes rich filter panel, Pinia filter persistence, base64-encoded tech-spec search.
AdminPanelPage/adminES_ADMINBack-office for pending user registrations. Fetches users & provider codes; embeds UsersTable.
EditProfile/edit-profileAuthenticatedAllows any logged-in user to change password (client-side validation via passwordService).
MyRfqPage/rfqsES_ADMIN, ES_USER, PROVIDERList + filter switch (“My requests”) over all RFQs. Delegates to RequestForQuotationsTable.
RfqCreationPage/rfq/createES_ADMIN, ES_USERMulti-step form that assembles RFQ payload (items table, tech-spec badges). Uses ConfirmationModal before POST.
RFQViewEditPageES/rfq/:year/:sequenceES_ADMIN, ES_USER, PROVIDERFull RFQ CRUD & quoting portal. • Internal users: edit, withdraw, award quotes • Providers: create/view/withdraw own quote.
ProviderCompanyProfile/providers/:operationalCodeall authCompany master-data page (address, contact, countries of operation). Offers navigation to SNG list & evaluations.
SngPage/providers/:code/sngsES_ADMIN, ES_USER, PROVIDERShows all SNG trucks of provider, plus add / edit / soft-delete via SngCard.
SngCreationPage/providers/:code/sngs/create
/providers/:code/sngs/edit/:id
same as aboveLarge form for truck details, antennas & tech specs. Re-used for create and update.
EvaluationPage/providers/:code/evaluationES_ADMIN, ES_USERDisplays average ratings & trend icons; modal to submit new evaluation.

Services & Stores

#Service moduleCore responsibility (wrapped backend end-points)Coupled Pinia store(s)Typical lifecycle in UIWhy it is important
1auth.service.jsPOST /auth/login, POST /registrationRequests, POST /auth/logoutUsed only from auth.store actions login/register/logout.Single source for OAuth2/JWT exchange; keeps page code ignorant of REST details.
2common.service.jsGET /common/countriesCalled ad-hoc by Home, Provider, RFQ & SNG pages for drop-downs. Caches nowhere.Pure utility; no token header → public call so the app still renders unauthenticated screens.
3evaluation.service.jsGET …/evaluations/categories
`GET
POST /providers/{code}/evaluations\auth.store (for token)Fetch on EvaluationPage mount; POST inside modal.Encapsulates complex authorization header logic and hides URL stitching.
4notification.service.jsGET /notifications (+ query)
PATCH /notifications/{id}
auth.storeUsed only by notifications.store.Keeps websocket store “thin”: store focuses on state & STOMP, service on REST persistence.
5password.service.jslocal regex validation helpersUsed client-side only in Register & EditProfile pages.Business rule centralisation (min 8 chars, 1 upper, etc.) – avoids duplication in several forms.
6providers.service.jsCRUD + list/filter for providers (/providers)auth.storeHomePage filter panel → getSortedProviders
ProviderProfile edit → updateProvider
Bridges backend “provider” bounded context; injects token and query params assembling.
7quote.service.jsQuote CRUD, award / withdraw (/quotes & sub-resources)auth.storeRFQViewEditPage (provider view) uses create/update/withdraw
• Same page (ES user) uses awardQuote
Implements full quote state machine on client; pages only deal with returned DTO.
8requestForQuotation.service.jsRFQ CRUD (/requestForQuotations) incl. status PATCHauth.storeRfqCreationPagecreateRfq
MyRfqPage list → getAllRFQs
RFQViewEditPage edit / withdraw
Front-end counterpart of your RFQ backend module; responsible for versioned URL construction.
9sng.service.jsCRUD trucks (/trucks, /providers/{code}/trucks)auth.storeSngPage list
SngCreationPage create/update/delete
Masks slightly different provider-scoped & global URLs; enforces auth header.
10specifications.service.jsGET /technicalSpecificationsauth.storeFetched once by HomePage and SngCreationPage then stored in local component state.Provides master-data for all spec drop-downs ⇒ single call instead of scattering constants.
11users.service.jsPending registration list, PATCH user, GET /users/meauth.store & users.storeAdminPanel polls getPendingRegistrations
auth.store.loadUserProfile() uses getMe
Gives both admin screens and auth-boot sequence the same user DTO source.