Installation Guide¶
This guide will walk you through installing TradeTally from source.
Prerequisites¶
Before setting up TradeTally, ensure you have the following installed:
Required Software¶
- Node.js (v14.0.0 or higher)
- npm (comes with Node.js)
- PostgreSQL (v16 or higher)
- Git (for cloning the repository)
Operating System Support¶
- macOS (10.15+)
- Windows (10+)
- Linux (Ubuntu 18.04+, CentOS 7+)
Step 1: Install Node.js and npm¶
- Download Node.js from nodejs.org
- Run the installer and follow the setup wizard
- Verify installation:
Step 2: Install PostgreSQL¶
- Download PostgreSQL from postgresql.org
- Run the installer and follow the setup wizard
- Remember the password you set for the postgres user
Step 3: Clone the Repository¶
# Clone the repository
git clone https://github.com/GeneBO98/tradetally.git
cd tradetally
# Repository structure
# tradetally/
# ├── backend/
# ├── frontend/
# └── README.md
Step 4: Database Setup¶
Create Database and User¶
-- Connect to PostgreSQL as superuser
sudo -u postgres psql
-- Create database
CREATE DATABASE tradetally_db;
-- Create user with password
CREATE USER tradetally_user WITH PASSWORD 'your_secure_password';
-- Grant privileges
GRANT ALL PRIVILEGES ON DATABASE tradetally_db TO tradetally_user;
-- Exit PostgreSQL
\q
Run Database Migrations¶
Step 5: Backend Setup¶
# Navigate to backend directory
cd backend
# Install dependencies
npm install
# Copy environment configuration
cp .env.example .env
# Edit .env file with your configuration
nano .env
Configure Environment Variables¶
Edit the .env file with your specific values:
NODE_ENV=development
PORT=3000
# Database Configuration
DB_HOST=localhost
DB_PORT=5432
DB_NAME=tradetally_db
DB_USER=tradetally_user
DB_PASSWORD=your_secure_password
# JWT Configuration
JWT_SECRET=your_super_secret_jwt_key_here_make_it_long_and_random
JWT_EXPIRE=7d
# Registration Control
REGISTRATION_MODE=open
# Frontend URL
FRONTEND_URL=http://localhost:5173
# File Upload (50MB limit for large CSV files)
MAX_FILE_SIZE=52428800
# API Keys (Optional but recommended)
FINNHUB_API_KEY=your_finnhub_api_key
ALPHA_VANTAGE_API_KEY=your_alpha_vantage_api_key
Step 6: Frontend Setup¶
# Navigate to frontend directory
cd ../frontend
# Install dependencies
npm install
# Copy environment configuration (optional)
cp .env.example .env
Frontend Environment Variables (Optional)¶
Step 7: Start the Application¶
Start Backend Server¶
Start Frontend Development Server¶
# In a new terminal, navigate to frontend directory
cd frontend
npm run dev
# Frontend will start on http://localhost:5173
Next Steps¶
- Quick Start Guide - Learn the basics
- API Configuration - Set up API keys for enhanced features
- Importing Trades - Start importing your trades
Troubleshooting¶
Database Connection Error¶
# Check if PostgreSQL is running
sudo systemctl status postgresql
# Check connection
psql -h localhost -U tradetally_user -d tradetally_db -c "SELECT 1;"