Manual Deployment
This guide outlines the steps for manually deploying your Harvide Starter application to a custom server or environment.
Prerequisites
- A server with Node.js (v18.x or later) and Git installed.
- A running PostgreSQL database.
- SSH access to your server.
Steps
-
Clone your repository:
git clone <your-repo-url> cd <your-project-directory>
-
Install dependencies:
bun install --production
-
Configure Environment Variables: Create a
.env
file on your server. Ensure all necessary environment variables are set, includingDATABASE_URL
,NEXT_PUBLIC_CLIENT_URL
,BETTER_AUTH_SECRET
, and any mail service credentials. -
Run Database Migrations:
bun run db:migrate
-
Build the application:
bun run build
-
Start the application: You can use a process manager like PM2 or Systemd to keep your application running.
bun run start
Or with PM2:
pm2 start "bun run start" --name "harvide-starter-app"
Ensure your server’s firewall rules allow access to your application’s port (default 3000). You might also want to set up a reverse proxy with Nginx or Apache for proper domain handling and SSL.