Skip to content

Native Installation from Source

This guide is for local development or advanced non-Docker installs.

Recommended for most self-hosted users

If you are self-hosting TradeTally for normal use, start with Docker Deployment instead. It is the primary and better-supported installation path.

Prerequisites

  • Node.js 20+
  • pnpm 10.13.1
  • PostgreSQL 16+
  • Git

1. Clone the Repository

git clone https://github.com/GeneBO98/tradetally.git
cd tradetally

2. Install pnpm and Workspace Dependencies

npm install -g [email protected]
pnpm install

3. Create the Database

CREATE DATABASE tradetally_db;
CREATE USER tradetally_user WITH PASSWORD 'your_secure_password';
GRANT ALL PRIVILEGES ON DATABASE tradetally_db TO tradetally_user;

4. Configure the Backend

cp backend/.env.example backend/.env

At minimum, update these values in backend/.env:

DB_HOST=localhost
DB_PORT=5432
DB_NAME=tradetally_db
DB_USER=tradetally_user
DB_PASSWORD=your_secure_password
FRONTEND_URL=http://localhost:5173
CORS_ORIGINS=http://localhost:5173,http://localhost:3000,http://localhost:8080
JWT_SECRET=change_this_to_a_long_random_value

5. Run Database Migrations

pnpm --dir backend run migrate

6. Start the Backend

pnpm --dir backend run dev

The API runs on http://localhost:3000.

7. Start the Frontend

In a second terminal:

pnpm --dir frontend run dev

The frontend runs on http://localhost:5173.

Next Steps

Troubleshooting

Database Connection Errors

psql -h localhost -U tradetally_user -d tradetally_db -c "SELECT 1;"

Port Already in Use

lsof -i :3000
lsof -i :5173