-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-manual.bat
More file actions
107 lines (98 loc) · 2.9 KB
/
setup-manual.bat
File metadata and controls
107 lines (98 loc) · 2.9 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
@echo off
echo ============================================
echo GoodFood Manual Setup Script (No Docker)
echo ============================================
echo.
echo This script helps you set up GoodFood application
echo for development without Docker.
echo.
echo [Prerequisites Check]
echo Checking for required tools...
where dotnet >nul 2>&1
if %errorlevel% neq 0 (
echo ERROR: .NET 8.0 SDK is not installed or not in PATH
echo Please install .NET 8.0 SDK from: https://dotnet.microsoft.com/download/dotnet/8.0
pause
exit /b 1
)
echo ✓ .NET SDK found
where psql >nul 2>&1
if %errorlevel% neq 0 (
echo WARNING: PostgreSQL client tools (psql) not found in PATH
echo You may need to create the database manually
echo.
) else (
echo ✓ PostgreSQL client tools found
)
echo.
echo [Database Setup]
echo Please ensure PostgreSQL server is running on localhost:5432
echo Default credentials: username=postgres, password=postgres
echo.
set /p continue="Continue with database setup? (y/n): "
if /i not "%continue%"=="y" (
echo Setup cancelled.
pause
exit /b 0
)
echo.
echo Creating database 'goodfood_db_pub'...
psql -h localhost -p 5432 -U postgres -f setup-database.sql
if %errorlevel% neq 0 (
echo.
echo WARNING: Database creation failed or database already exists
echo You can create it manually using pgAdmin or run:
echo createdb -h localhost -p 5432 -U postgres goodfood_db_pub
echo.
)
echo.
echo [EF Core Tools Setup]
echo Installing Entity Framework Core tools...
dotnet tool install --global dotnet-ef
if %errorlevel% neq 0 (
echo EF Core tools may already be installed
)
echo.
echo [Database Migration]
echo Running database migrations...
dotnet ef database update --project src/GoodFood.Infrastructure --startup-project src/GoodFood.Web
if %errorlevel% neq 0 (
echo.
echo ERROR: Migration failed. Please check:
echo 1. PostgreSQL server is running
echo 2. Database 'goodfood_db_pub' exists
echo 3. Connection string in appsettings.Development.json is correct
echo.
pause
exit /b 1
)
echo.
echo ============================================
echo 🎉 Setup Complete! 🎉
echo ============================================
echo.
echo ✅ To run the FULL application you need to start:
echo.
echo 1. 🌐 Web Application:
echo cd src/GoodFood.Web
echo dotnet run
echo.
echo 2. 📧 Email Worker (in separate terminal):
echo cd src/GoodFood.Worker.EmailSender
echo dotnet run
echo.
echo 🚀 The web application will be available at:
echo 👉 https://localhost:7001 (HTTPS)
echo 👉 http://localhost:5000 (HTTP)
echo.
echo 📊 Database connection details:
echo Host: localhost
echo Port: 5432
echo Database: goodfood_db_pub
echo Username: postgres
echo Password: postgres
echo.
echo 💡 TIP: For the best experience, run both services!
echo The email worker handles background email processing.
echo.
pause