-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.ps1
More file actions
60 lines (48 loc) · 1.95 KB
/
Copy pathsetup.ps1
File metadata and controls
60 lines (48 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# SYJ Calling CRM — setup script for Windows (PowerShell)
$ErrorActionPreference = "Stop"
Write-Host ""
Write-Host "=== SYJ Calling CRM - Setup (Windows PowerShell) ===" -ForegroundColor Cyan
Write-Host ""
if (-not (Get-Command node -ErrorAction SilentlyContinue)) {
Write-Host "Node.js is required but not found. Install it from https://nodejs.org" -ForegroundColor Red
exit 1
}
if (-not (Get-Command npm -ErrorAction SilentlyContinue)) {
Write-Host "npm is required but not found." -ForegroundColor Red
exit 1
}
Write-Host ("Node version: " + (node -v))
Write-Host ("npm version: " + (npm -v))
Write-Host ""
$RootDir = Split-Path -Parent $MyInvocation.MyCommand.Path
Write-Host "--- Installing backend dependencies ---" -ForegroundColor Yellow
Set-Location "$RootDir\backend"
npm install
if (-not (Test-Path ".env")) {
Copy-Item ".env.example" ".env"
Write-Host "Created backend\.env from .env.example - edit it before production use."
}
Write-Host "--- Generating Prisma client ---" -ForegroundColor Yellow
npm run db:generate
Write-Host "--- Creating SQLite database ---" -ForegroundColor Yellow
npm run db:push
Write-Host "--- Seeding database (default admin + business verticals) ---" -ForegroundColor Yellow
try { npm run db:seed } catch { Write-Host "Seeding skipped or already applied." }
Write-Host ""
Write-Host "--- Installing frontend dependencies ---" -ForegroundColor Yellow
Set-Location "$RootDir\frontend"
npm install
if (-not (Test-Path ".env.local")) {
Copy-Item ".env.example" ".env.local"
Write-Host "Created frontend\.env.local from .env.example"
}
Write-Host ""
Write-Host "=== Setup complete ===" -ForegroundColor Green
Write-Host ""
Write-Host "To run the backend: cd backend; npm run dev"
Write-Host "To run the frontend: cd frontend; npm run dev"
Write-Host ""
Write-Host "Default admin login (change immediately):"
Write-Host " Email: admin@sayanjalinexus.com"
Write-Host " Password: ChangeMe123!"
Write-Host ""