Skip to main content

Quick Start

Get Smart Academic Hub up and running in minutes!

All-in-One Setup

Once you've completed the installation, start all services:

# From root directory
npm run dev

This starts:

Individual Services

Start Backend Only

npm run dev:backend

Access at: http://localhost:5000

Start Frontend Only

npm run dev:frontend

Access at: http://localhost:5001

Start Mobile Only

npm run dev:mobile

Then use Expo Go app on your phone or emulator.

Start Documentation Only

npm run dev:docs

Access at: http://localhost:3000

Create Your First Academy

1. Register a User

curl -X POST http://localhost:5000/api/v1/auth/register \
-H "Content-Type: application/json" \
-d '{
"name": "John Doe",
"email": "john@example.com",
"password": "password123",
"password_confirmation": "password123"
}'

2. Login

curl -X POST http://localhost:5000/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "john@example.com",
"password": "password123"
}'

Save the returned token!

3. Create an Academy

curl -X POST http://localhost:5000/api/v1/academies \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {your-token}" \
-d '{
"name": "ABC Tuition Centre",
"type": "tuition",
"email": "info@abctuition.com"
}'

Using Swagger UI

Navigate to http://localhost:5000/api/documentation

  1. Click Authorize
  2. Enter: Bearer {your-token}
  3. Click Authorize again
  4. Try out any endpoint!

Next Steps

Troubleshooting

Port Already in Use

# Backend (5000)
# Kill process: netstat -ano | findstr :5000
# Then: taskkill /PID {process-id} /F

# Frontend (5001)
# Kill process or change port in vite.config.ts

Database Connection Error

Check your .env file:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=smart_academic_hub
DB_USERNAME=root
DB_PASSWORD=your_password

NPM Install Fails

# Clear cache
npm cache clean --force

# Delete node_modules and reinstall
rm -rf node_modules package-lock.json
npm install

Composer Install Fails

# Clear cache
composer clear-cache

# Update Composer
composer self-update

# Reinstall
rm -rf vendor composer.lock
composer install