Skip to main content

Installation

This guide will help you install and set up Smart Academic Hub on your local development machine.

Prerequisites​

Before you begin, ensure you have the following installed:

Backend Requirements​

  • PHP 8.2 or higher
  • Composer (latest version)
  • MySQL 8.0 or higher
  • Redis (optional, for queues and caching)

Frontend Requirements​

  • Node.js 20.x or higher
  • npm 10.x or higher

Mobile Requirements​

  • Node.js 20.x or higher
  • npm 10.x or higher
  • Expo CLI
  • iOS Simulator (Mac only) or Android Emulator

Installation Steps​

1. Clone the Repository​

git clone https://github.com/smartacademichub/SmartAcademicHub.git
cd SmartAcademicHub

2. Install Root Dependencies​

npm install

This will install workspace dependencies including concurrently for running multiple dev servers.

3. Setup Backend (Laravel)​

cd backend

# Install Laravel and dependencies
composer create-project laravel/laravel . "12.*"

# Install additional packages
composer require laravel/sanctum
composer require --dev laravel/pint

# Copy environment file
cp .env.example .env

# Generate application key
php artisan key:generate

4. Setup Frontend (React)​

cd ../frontend

# Create Vite project
npm create vite@latest . -- --template react-ts

# Install dependencies
npm install

# Install Tailwind CSS
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p

# Install additional packages
npm install react-router-dom axios @tanstack/react-query zustand
npm install -D @types/node

5. Setup Mobile (Expo)​

cd ../mobile

# Create Expo project
npx create-expo-app@latest . --template blank-typescript

# Install dependencies
npm install

# Install NativeWind
npm install nativewind
npm install --save-dev tailwindcss@3.3.2
npx tailwindcss init

6. Setup Documentation (Docusaurus)​

cd ../documentation

# Install dependencies
npm install

Running the Platform​

Option 1: Run All Services​

From the root directory:

npm run dev

This will start:

Option 2: Run Individual Services​

# Backend only
npm run dev:backend

# Frontend only
npm run dev:frontend

# Mobile only
npm run dev:mobile

# Documentation only
npm run dev:docs

Verify Installation​

  1. Backend: Visit http://localhost:5000/api/v1/health
  2. Frontend: Visit http://localhost:5001
  3. Documentation: Visit http://localhost:3000
  4. Swagger UI: Visit http://localhost:5000/api/documentation

Next Steps​

Common Issues​

Port Already in Use​

If ports 5000, 5001, or 3000 are already in use, you can change them:

  • Backend: Edit .env and add APP_PORT=8001
  • Frontend: Edit vite.config.ts and set server.port
  • Documentation: Edit docusaurus.config.js and set port in start command

Database Connection Error​

Ensure MySQL is running and credentials in .env are correct.

Module Not Found​

Run npm install in the affected directory.

Getting Help​