Skip to content

Feat/azure vercel deployment - #305

Merged
yehiarasheed merged 26 commits into
mainfrom
feat/azure-vercel-deployment
Jan 1, 2026
Merged

yehiarasheed merged 26 commits into
mainfrom
feat/azure-vercel-deployment

Conversation

@yehiarasheed

Copy link
Copy Markdown
Collaborator

Overview

This pull request introduces automated deployment pipelines for both the backend and frontend, along with a frontend refactor that centralizes API base URL configuration. These changes improve deployment reliability, environment flexibility, and long-term maintainability. In addition, .gitignore rules were updated to prevent committing Vercel-generated build artifacts.

Deployment Automation

  • Added azure-deploy.yml GitHub Actions workflow to automate backend deployments to Azure Web App.

    • Triggered on pushes to relevant branches and on changes to backend or workflow-related files.
  • Added vercel-deploy.yml GitHub Actions workflow to automate frontend deployments to Vercel.

    • Triggered on pushes and pull requests that affect frontend or configuration files.

Frontend Configuration Improvements

  • Introduced client/package.json, defining scripts, dependencies, and development tooling required for building, linting, formatting, and running the frontend application.
  • Updated client/.gitignore to exclude the .vercel directory, ensuring Vercel build artifacts are not tracked in version control.

API Base URL Refactor

  • Refactored multiple frontend components to use a centralized getApiBaseUrl utility from @/lib/apiBase instead of hardcoded or duplicated API URLs.
  • This change improves consistency across the codebase and simplifies switching between environments (e.g., local, staging, production).

Updated components include:

  • BazaarList.tsx
  • BigCalendarView.tsx
  • CalendarPopover.tsx
  • CreateEventForm.tsx
  • CreateGymSessionDialog.tsx
  • CreatePrivilegedUserForm.tsx
  • EditGymSessionDialog.tsx
  • EventCard.tsx
  • EventFeedbackDialog.tsx
  • EventListItem.tsx
  • EventSearch.tsx

- Introduced a new utility function `getApiBaseUrl` in `apiBase.ts` to centralize the retrieval of the API base URL.
- Updated all relevant components and pages to use the new `getApiBaseUrl` function instead of directly accessing environment variables.
- This change improves maintainability and consistency in how the API base URL is managed throughout the application.
- Refactor Node.js setup in Azure workflow to use environment variable for version
- Create deployment package for Azure deployment
- Update server's package.json to specify Node.js engine version
- Change default server port from 8080 to 4000
- Add health check endpoint for API monitoring
@yehiarasheed yehiarasheed self-assigned this Jan 1, 2026
@yehiarasheed yehiarasheed added the enhancement New feature or request label Jan 1, 2026
Comment thread client/src/lib/apiBase.ts
export function getApiBaseUrl(): string {
return (
import.meta.env.VITE_API_BASE_URL ||
(import.meta as any).env?.VITE_API_URL ||

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] <@typescript-eslint/no-explicit-any> reported by reviewdog 🐶
Unexpected any. Specify a different type.

Comment thread server/src/app.js
const { hostname } = new URL(first);
if (!hostname.endsWith(".vercel.app")) return null;
return hostname.replace(/\.vercel\.app$/i, "");
} catch (_e) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] <unused-imports/no-unused-vars> reported by reviewdog 🐶
'_e' is defined but never used.

Comment thread server/src/app.js
) {
return callback(null, true);
}
} catch (_e) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] <unused-imports/no-unused-vars> reported by reviewdog 🐶
'_e' is defined but never used.

Comment thread server/src/app.js
if (protocol === "https:" && hostname.endsWith(".vercel.app")) {
return callback(null, true);
}
} catch (_e) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] <unused-imports/no-unused-vars> reported by reviewdog 🐶
'_e' is defined but never used.


if (!logger || typeof logger.info !== "function") {
// Extremely defensive fallback
// eslint-disable-next-line no-console

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] reported by reviewdog 🐶
Unused eslint-disable directive (no problems were reported from 'no-console').

Suggested change
// eslint-disable-next-line no-console

@yehiarasheed
yehiarasheed merged commit fe9eda7 into main Jan 1, 2026
3 checks passed
@yehiarasheed
yehiarasheed deleted the feat/azure-vercel-deployment branch January 1, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant