Galaxy Strike Online - Complete Setup Guide

This comprehensive guide will walk you through setting up the entire Galaxy Strike Online project from scratch.

Table of Contents

  1. Prerequisites
  2. Project Download
  3. Server Setup
  4. Client Setup
  5. Database Setup
  6. Running the Application
  7. Testing
  8. Troubleshooting

1. Prerequisites

Required Software:

Important: Make sure Node.js is version 18.0.0 or higher. Check with node --version

2. Project Download

Option A: Clone from Git Repository

git clone <repository-url>
cd galaxystrikeonline

Option B: Download ZIP File

  1. Download the project ZIP file
  2. Extract to your desired location
  3. Navigate to the project directory

3. Server Setup

Step 1: Navigate to Server Directory

cd Server

Step 2: Install Dependencies

npm install

Step 3: Create Environment File

cp .env.example .env

Step 4: Configure Environment Variables

Edit the .env file with your configuration:

PORT=3001
MONGODB_URI=mongodb://localhost:27017/galaxystrikeonline
JWT_SECRET=your_jwt_secret_key_here
CLIENT_URL=http://localhost:3000
Important: Replace your_jwt_secret_key_here with a secure random string.

Step 5: Database Migration

npm run migrate

Step 6: Seed Database

npm run seed

4. Client Setup

Step 1: Navigate to Website Directory

cd ../Website

Step 2: Install Dependencies

npm install

Step 3: Create Environment File

cp .env.example .env

Step 4: Configure Environment Variables

Edit the .env file:

VITE_API_BASE_URL=http://localhost:3001/api
VITE_SOCKET_URL=http://localhost:3001

6. Running the Application

Step 1: Start MongoDB

Step 2: Start Server

cd Server
npm run dev

Server will start on port 3001

Step 3: Start Client

cd ../Website
npm run dev

Client will start on port 3000

Step 4: Access Application

Open browser and navigate to: http://localhost:3000

8. Troubleshooting

Common Issues:

1. MongoDB Connection Error

2. Port Already in Use

3. Module Installation Errors

Success Indicators: