Production project deployment
Prerequisites
- Node.js: Required for package management and running the build server (v18+ recommended).
- npm: Node Package Manager.
- Git: For downloading the source code.
Download & Setup
Clone the Repository Download the project source code to your local machine.
bashgit clone <repository-url> cd united-non-custodial-frontInstall Dependencies Install the required Node.js packages.
bashnpm installEnvironment Configuration Defined in the setup documentation, this interface maps environment variables to internal configuration.
cardsKey: Cryptographic key.cardsIvKey: Initialization vector.environment: Runtime environment name.
The application relies on specific environment variables. You can export them in your shell session before running the application.
bashexport UNITED_CARDS_KEY="your_key_here" export UNITED_CARDS_IV_KEY="your_iv_key_here" export ENVIRONMENT_NAME="production"Production Environment Differences
- Enable Obfuscation.
- Removes all
console.logcalls. - Removes
debuggerstatements. - Removes comments from the output.
Execution
- Production Build To compile and minify the application for deployment (artifacts are saved to
public/directory`):bashnpm run build - Deploy on hosting Copy compiled files and directories from
public/directory to your hosting provider root directory
Example Deploying to Cloudflare Pages
Cloudflare Pages is an excellent alternative for hosting Vite applications.
Prerequisites:
- A Cloudflare account.
- (Optional) Wrangler CLI:
npm install -g wrangler
Option A: Git Integration (Recommended)
- Push your code to a GitHub/GitLab repository.
- Log in to the Cloudflare Dashboard and go to Pages.
- Click Create a project > Connect to Git.
- Select your repository.
- Build Settings:
- Framework Preset: Vite
- Build command:
npm run build(ormake build) - Output directory:
public(Note: Ypu can change or verifyOutput directoryinvite.config.js.).
- Click Save and Deploy.
Option B: Direct Upload (CLI)
- Build the project locally:bash
make build - Deploy using Wrangler:bash
# Assuming 'public' is the build output folder npx wrangler pages deploy public --project-name united-network
