-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathQUICKSTART.txt
More file actions
235 lines (168 loc) · 11.9 KB
/
QUICKSTART.txt
File metadata and controls
235 lines (168 loc) · 11.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
╔════════════════════════════════════════════════════════════════════════════╗
║ ║
║ 🎮 C# TRIVIA Q&A APPLICATION - QUICK START 🎮 ║
║ ║
║ Production-Ready .NET 8.0 Implementation ║
║ ║
╚════════════════════════════════════════════════════════════════════════════╝
📋 SYSTEM REQUIREMENTS
═══════════════════════════════════════════════════════════════════════════
✓ .NET 8.0 SDK or later
✓ Windows, macOS, or Linux
✓ Visual Studio 2022 / VS Code / Rider (optional)
✓ Internet connection (for live version only)
═══════════════════════════════════════════════════════════════════════════
🚀 INSTALLATION (Choose One)
═══════════════════════════════════════════════════════════════════════════
1. VERIFY .NET INSTALLATION
dotnet --version (should show 8.0 or later)
2. RESTORE DEPENDENCIES
dotnet restore
3. BUILD PROJECT
dotnet build
═══════════════════════════════════════════════════════════════════════════
▶️ RUN THE APPLICATION
═══════════════════════════════════════════════════════════════════════════
DEMO VERSION (No Internet Required)
dotnet run --project trivia_app_demo.csproj
LIVE VERSION (Requires Internet)
dotnet run --project trivia_app.csproj
RELEASE MODE (Optimized)
dotnet build -c Release
dotnet run -c Release --project trivia_app.csproj
═══════════════════════════════════════════════════════════════════════════
💻 USING VISUAL STUDIO
═══════════════════════════════════════════════════════════════════════════
1. Open TriviaQA.sln in Visual Studio 2022
2. Select startup project (Set as Startup Project)
3. Press F5 to run
4. Or use Debug > Start Debugging
═══════════════════════════════════════════════════════════════════════════
📁 PROJECT STRUCTURE
═══════════════════════════════════════════════════════════════════════════
TriviaQA.sln - Visual Studio Solution
├── trivia_app.csproj - Live version project
├── trivia_app.cs - Live implementation (450 lines)
├── trivia_app_demo.csproj - Demo version project
├── trivia_app_demo.cs - Demo implementation (350 lines)
└── README.md - Full documentation
═══════════════════════════════════════════════════════════════════════════
🎮 HOW TO PLAY
═══════════════════════════════════════════════════════════════════════════
1. Application loads 10 trivia questions
2. Questions display with category and difficulty
3. Choose your answer (press 1, 2, 3, or 4)
4. See immediate feedback
5. Get final score when done
═══════════════════════════════════════════════════════════════════════════
🔧 USEFUL COMMANDS
═══════════════════════════════════════════════════════════════════════════
# Build debug version
dotnet build
# Build release (optimized)
dotnet build -c Release
# Run demo
dotnet run --project trivia_app_demo.csproj
# Run live
dotnet run --project trivia_app.csproj
# Clean build artifacts
dotnet clean
# Restore NuGet packages
dotnet restore
# Watch mode (auto-recompile on changes)
dotnet watch --project trivia_app_demo.csproj
# Publish for deployment
dotnet publish -c Release -o ./publish
═══════════════════════════════════════════════════════════════════════════
⚙️ CONFIGURATION
═══════════════════════════════════════════════════════════════════════════
Edit in trivia_app.cs:
public static class Config
{
public const string API_ENDPOINT = "https://opentdb.com/api.php?amount=10";
public const int REQUEST_TIMEOUT = 10000; // 10 seconds
public const int MAX_RETRIES = 3; // retry attempts
public const int RETRY_DELAY = 1000; // 1 second between retries
}
CHANGE LOGGING LEVEL:
LogLevel.Debug - Verbose output
LogLevel.Info - Standard output
LogLevel.Warning - Warnings + errors only
LogLevel.Error - Errors only
═══════════════════════════════════════════════════════════════════════════
❓ TROUBLESHOOTING
═══════════════════════════════════════════════════════════════════════════
"dotnet: command not found"
→ Install .NET 8.0 from https://dotnet.microsoft.com/download
"NuGet package restore failed"
→ Run: dotnet restore
"HttpRequestException: Connection refused"
→ Use demo version (no internet needed)
→ Or check internet connection
"TaskCanceledException (timeout)"
→ Try demo version
→ Or increase REQUEST_TIMEOUT in Config
"Invalid input error"
→ Enter numbers 1-4 only
→ Press Enter after each selection
═══════════════════════════════════════════════════════════════════════════
✨ FEATURES
═══════════════════════════════════════════════════════════════════════════
✓ 10 random trivia questions (live) or 5 mock questions (demo)
✓ Multiple-choice answers with randomization
✓ Immediate feedback on each answer
✓ Final score with percentage calculation
✓ Detailed question-by-question results
✓ Automatic retry on network failure
✓ Structured logging and error handling
✓ 100% nullable reference type support
✓ Production-ready architecture
✓ Works with .NET 8.0
═══════════════════════════════════════════════════════════════════════════
📚 WHAT'S INCLUDED
═══════════════════════════════════════════════════════════════════════════
Source Code:
• trivia_app.cs - Main implementation (450 lines)
• trivia_app_demo.cs - Demo with mock data (350 lines)
Project Files:
• trivia_app.csproj - Live project configuration
• trivia_app_demo.csproj - Demo project configuration
• TriviaQA.sln - Visual Studio solution
Documentation:
• README.md - Complete guide (14 KB)
• QUICKSTART.txt - This file
═══════════════════════════════════════════════════════════════════════════
🎯 QUICK COMMANDS
═══════════════════════════════════════════════════════════════════════════
Try Demo (Fastest Way):
dotnet restore
dotnet build
dotnet run --project trivia_app_demo.csproj
Or Open in Visual Studio:
1. Open TriviaQA.sln
2. Select trivia_app_demo as startup project
3. Press F5
═══════════════════════════════════════════════════════════════════════════
📖 FOR MORE INFORMATION
═══════════════════════════════════════════════════════════════════════════
See README.md for:
✓ Full installation instructions
✓ Architecture overview
✓ All configuration options
✓ Extension points and customization
✓ Performance characteristics
✓ Design patterns used
✓ Troubleshooting guide
✓ Future enhancements
═══════════════════════════════════════════════════════════════════════════
🎉 YOU'RE READY TO PLAY!
═══════════════════════════════════════════════════════════════════════════
Choose your mode:
DEMO (No Internet):
dotnet run --project trivia_app_demo.csproj
LIVE (With Internet):
dotnet run --project trivia_app.csproj
═══════════════════════════════════════════════════════════════════════════
Made with ❤️ following enterprise architecture best practices.
Production-Ready C# • .NET 8.0 • Fully Type-Safe • Async/Await
════════════════════════════════════════════════════════════════════════════