Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/EricMartinez758/corpointa-frontend/llms.txt

Use this file to discover all available pages before exploring further.

Corpointa ships with a netlify.toml configuration file that handles the one critical requirement for deploying a single-page application: ensuring that all URL paths serve index.html so that TanStack Router can take over client-side navigation.

netlify.toml

The netlify.toml at the project root configures a catch-all redirect rule:
netlify.toml
[[redirects]]
  from = "/*"
  to = "/index.html"
  status = 200
The status = 200 is important — it tells Netlify to serve index.html as a rewrite (not a redirect), so the URL in the browser’s address bar stays as-is. When a user navigates directly to /inventory/products or refreshes on a deep link, Netlify delivers index.html and TanStack Router reads the path and renders the correct route on the client.

Deploy Steps

1

Push your code to a Git repository

Make sure your project is pushed to a GitHub or GitLab repository. Netlify connects directly to your Git provider to trigger builds on every push.
2

Connect the repository to Netlify

Log in to the Netlify dashboard, click Add new site → Import an existing project, and select your Git provider. Choose the Corpointa repository from the list.
3

Set the build command

In the build settings, enter the following as the Build command:
pnpm build
4

Set the publish directory

Set the Publish directory to:
dist
5

Add environment variables

Go to Site configuration → Environment variables and add any required keys. If you are using Clerk authentication, add:
VITE_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxxx
6

Deploy the site

Click Deploy site. Netlify will clone the repo, install dependencies with pnpm, run tsc -b && vite build, and publish the dist/ folder. The deployment URL will be shown in the dashboard once the build completes.

CORS Configuration

Because the Corpointa frontend is served from a Netlify domain (e.g., https://corpointa.netlify.app) while your backend API lives on a different origin, you must configure CORS on the backend to allow requests from that Netlify domain. Add the deployed Netlify URL to your API’s allowed-origins list. If you use a custom domain, add that instead. Without the correct CORS headers, all API calls from the browser will be blocked, even though the frontend itself loads fine.

Alternative Platforms

Corpointa can be deployed to any static hosting platform that supports SPA redirect rules. Each platform has its own convention for this configuration:

Vercel

Add a vercel.json file to the project root with rewrite rules:
vercel.json
{
  "rewrites": [
    { "source": "/(.*)", "destination": "/index.html" }
  ]
}

Cloudflare Pages

Add a _redirects file inside the dist/ output directory (or the project root, depending on your build setup):
/* /index.html 200

AWS S3 + CloudFront

In your S3 static website hosting settings, set the Error document to index.html. In CloudFront, configure a custom error response: HTTP 403/404 → return index.html with HTTP 200.
Enable Netlify Deploy Previews in your repository settings. Every pull request will get its own unique preview URL, letting you test UI changes in a production-identical environment before merging to your main branch.

Build docs developers (and LLMs) love