-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathsetup.html
More file actions
1673 lines (1470 loc) · 56.6 KB
/
setup.html
File metadata and controls
1673 lines (1470 loc) · 56.6 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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Developer Setup · ExerciseDB</title>
<style>
/* ── Design Tokens ──────────────────────────────── */
:root {
--accent: #ff4f00;
--accent-muted: rgba(255,79,0,0.09);
--bg-base: #f4f4f5;
--bg-surface: #ffffff;
--bg-elevated: #f0f0f1;
--border: #e4e4e7;
--border-hover: #c4c4c7;
--text-primary: #111111;
--text-secondary: #71717a;
--text-tertiary: #a1a1aa;
--radius-sm: 6px;
--radius-md: 10px;
--radius-lg: 14px;
--radius-xl: 18px;
--nav-w: 210px;
}
/* ── Reset ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
background: var(--bg-base);
color: var(--text-primary);
min-height: 100vh;
font-size: 14px;
line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
code {
font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
font-size: 12px;
background: var(--bg-elevated);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
padding: 1px 5px;
}
/* ── Header ─────────────────────────────────────── */
.site-header {
background: var(--bg-surface);
border-bottom: 1px solid var(--border);
height: 52px;
display: flex;
align-items: center;
padding: 0 24px;
gap: 20px;
position: sticky;
top: 0;
z-index: 100;
}
.site-logo {
font-size: 17px;
font-weight: 700;
letter-spacing: -0.4px;
color: var(--text-primary);
}
.site-logo span { color: var(--accent); }
.back-link {
display: flex;
align-items: center;
gap: 5px;
font-size: 13px;
color: var(--text-secondary);
border: 1px solid var(--border);
border-radius: var(--radius-md);
padding: 4px 11px;
margin-left: auto;
transition: color .15s, border-color .15s;
}
.back-link:hover { color: var(--text-primary); border-color: var(--border-hover); }
.back-link svg { flex-shrink: 0; }
.header-divider {
width: 1px; height: 20px;
background: var(--border);
}
.header-label {
font-size: 13px;
color: var(--text-secondary);
}
/* ── Shell ───────────────────────────────────────── */
.page-shell {
display: grid;
grid-template-columns: var(--nav-w) 1fr;
max-width: 1160px;
margin: 0 auto;
padding: 0 16px;
gap: 0;
min-height: calc(100vh - 52px);
}
/* ── Left Nav ────────────────────────────────────── */
.page-nav {
position: sticky;
top: 52px;
height: calc(100vh - 52px);
overflow-y: auto;
padding: 32px 0 32px 0;
border-right: 1px solid var(--border);
}
.nav-group-label {
font-size: 11px;
font-weight: 600;
letter-spacing: .06em;
text-transform: uppercase;
color: var(--text-tertiary);
padding: 0 16px 8px 16px;
}
.nav-link {
display: flex;
align-items: center;
gap: 8px;
font-size: 13px;
padding: 7px 16px;
border-radius: 0 var(--radius-md) var(--radius-md) 0;
color: var(--text-secondary);
transition: color .15s, background .15s;
cursor: pointer;
border-left: 2px solid transparent;
margin-right: 12px;
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-elevated); }
.nav-link.active {
color: var(--accent);
background: var(--accent-muted);
border-left-color: var(--accent);
font-weight: 500;
}
.nav-link svg { opacity: .5; flex-shrink: 0; }
.nav-link.active svg { opacity: 1; }
.nav-spacer { height: 20px; }
/* ── Main Content ────────────────────────────────── */
.page-content {
padding: 48px 0 80px 48px;
max-width: 820px;
}
/* ── Section ─────────────────────────────────────── */
.section {
margin-bottom: 72px;
}
.section-header {
display: flex;
align-items: center;
gap: 14px;
margin-bottom: 6px;
}
.section-num {
width: 30px; height: 30px;
background: var(--accent);
color: #fff;
font-size: 14px;
font-weight: 700;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.section-title {
font-size: 22px;
font-weight: 700;
letter-spacing: -0.4px;
}
.section-desc {
font-size: 14px;
color: var(--text-secondary);
margin-bottom: 24px;
padding-left: 44px;
max-width: 620px;
line-height: 1.65;
}
.section-body { padding-left: 44px; }
/* ── DB Tabs ─────────────────────────────────────── */
.tab-bar {
display: flex;
gap: 2px;
border-bottom: 1px solid var(--border);
margin-bottom: 24px;
}
.tab-btn {
font-size: 13px;
font-weight: 500;
padding: 8px 16px;
background: none;
border: none;
border-bottom: 2px solid transparent;
margin-bottom: -1px;
color: var(--text-secondary);
cursor: pointer;
transition: color .15s, border-color .15s;
white-space: nowrap;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
/* ── Steps ───────────────────────────────────────── */
.step-list { display: flex; flex-direction: column; gap: 28px; }
.step {
display: flex;
gap: 16px;
}
.step-num {
width: 24px; height: 24px;
background: var(--accent);
color: #fff;
font-size: 12px;
font-weight: 700;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
margin-top: 1px;
}
.step-body { flex: 1; min-width: 0; }
.step-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.step-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; line-height: 1.6; }
/* ── Code Block ──────────────────────────────────── */
.code-block {
position: relative;
background: #1a1a1a;
border-radius: var(--radius-lg);
overflow: hidden;
}
.code-pre {
font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
font-size: 12px;
line-height: 1.75;
color: #e4e4e7;
padding: 16px 20px;
overflow-x: auto;
white-space: pre;
tab-size: 2;
}
.copy-btn {
position: absolute;
top: 10px;
right: 10px;
font-size: 11px;
font-weight: 500;
padding: 4px 10px;
background: rgba(255,255,255,0.10);
color: #a1a1aa;
border: 1px solid rgba(255,255,255,0.12);
border-radius: var(--radius-sm);
cursor: pointer;
transition: background .15s, color .15s;
}
.copy-btn:hover { background: rgba(255,255,255,0.18); color: #fff; }
.copy-btn.copied { color: #4ade80; border-color: rgba(74,222,128,0.3); }
/* ── Generate Button ─────────────────────────────── */
.generate-btn {
display: inline-flex;
align-items: center;
gap: 7px;
background: var(--accent);
color: #fff;
font-size: 13px;
font-weight: 600;
padding: 9px 18px;
border: none;
border-radius: var(--radius-md);
cursor: pointer;
transition: opacity .15s;
}
.generate-btn:hover { opacity: .88; }
.generate-btn:disabled { opacity: .5; cursor: not-allowed; }
.generate-status {
font-size: 12px;
color: var(--text-secondary);
margin-left: 12px;
}
/* ── URL Input ───────────────────────────────────── */
.url-input-row {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 20px;
background: var(--bg-surface);
border: 1px solid var(--border);
border-radius: var(--radius-md);
padding: 8px 14px;
}
.url-label {
font-size: 12px;
font-weight: 600;
color: var(--text-tertiary);
white-space: nowrap;
}
.url-input {
flex: 1;
border: none;
outline: none;
font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
font-size: 13px;
color: var(--text-primary);
background: transparent;
}
.url-input::placeholder { color: var(--text-tertiary); }
/* ── API Endpoint Cards ──────────────────────────── */
.endpoint-list { display: flex; flex-direction: column; gap: 24px; }
.endpoint-card {
border: 1px solid var(--border);
border-radius: var(--radius-lg);
overflow: hidden;
background: var(--bg-surface);
}
.endpoint-header {
display: flex;
align-items: center;
gap: 10px;
padding: 12px 16px;
border-bottom: 1px solid var(--border);
background: var(--bg-elevated);
}
.method-badge {
font-size: 11px;
font-weight: 700;
padding: 2px 7px;
border-radius: var(--radius-sm);
background: #dcfce7;
color: #166534;
letter-spacing: .04em;
}
.endpoint-path {
font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
font-size: 13px;
font-weight: 500;
color: var(--text-primary);
}
.endpoint-desc {
font-size: 12px;
color: var(--text-secondary);
margin-left: auto;
}
.endpoint-body { position: relative; }
.endpoint-body .code-block { border-radius: 0; }
/* ── LLM Section ─────────────────────────────────── */
.llm-selectors {
display: flex;
gap: 12px;
margin-bottom: 20px;
flex-wrap: wrap;
}
.selector-group { display: flex; flex-direction: column; gap: 5px; }
.selector-label { font-size: 11px; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .06em; }
.selector-tabs { display: flex; gap: 2px; }
.selector-btn {
font-size: 12px;
font-weight: 500;
padding: 5px 12px;
background: var(--bg-elevated);
border: 1px solid var(--border);
border-radius: var(--radius-md);
color: var(--text-secondary);
cursor: pointer;
transition: all .15s;
}
.selector-btn:hover { border-color: var(--border-hover); color: var(--text-primary); }
.selector-btn.active { background: var(--accent-muted); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.llm-prompt-wrap {
position: relative;
}
.llm-prompt-box {
width: 100%;
min-height: 380px;
font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
font-size: 12px;
line-height: 1.75;
background: #1a1a1a;
color: #e4e4e7;
border: none;
border-radius: var(--radius-lg);
padding: 20px;
resize: vertical;
outline: none;
tab-size: 2;
}
.llm-actions {
display: flex;
align-items: center;
gap: 12px;
margin-top: 12px;
}
.copy-prompt-btn {
display: inline-flex;
align-items: center;
gap: 7px;
background: var(--accent);
color: #fff;
font-size: 13px;
font-weight: 600;
padding: 9px 18px;
border: none;
border-radius: var(--radius-md);
cursor: pointer;
transition: opacity .15s;
}
.copy-prompt-btn:hover { opacity: .88; }
.copy-prompt-btn.copied { background: #16a34a; }
.llm-hint {
font-size: 12px;
color: var(--text-tertiary);
}
/* ── Media Note ──────────────────────────────────── */
.media-note {
display: flex;
align-items: flex-start;
gap: 8px;
margin-top: 12px;
padding: 10px 14px;
background: var(--bg-elevated);
border: 1px solid var(--border);
border-radius: var(--radius-md);
font-size: 13px;
color: var(--text-secondary);
line-height: 1.55;
}
.media-note code { font-size: 11px; }
/* ── Misc helpers ────────────────────────────────── */
.inline-badge {
font-size: 11px;
font-weight: 600;
padding: 2px 7px;
border-radius: var(--radius-sm);
background: var(--accent-muted);
color: var(--accent);
}
.divider { height: 1px; background: var(--border); margin: 48px 0; }
/* ── Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }
/* ── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
.page-shell { grid-template-columns: 1fr; }
.page-nav { display: none; }
.page-content { padding: 32px 0 60px 0; }
.section-body { padding-left: 0; }
.section-desc { padding-left: 0; }
}
</style>
</head>
<body>
<!-- Header -->
<header class="site-header">
<div class="site-logo">Exercise<span>DB</span></div>
<div class="header-divider"></div>
<span class="header-label">Developer Setup</span>
<a class="back-link" href="index.html">
<svg width="13" height="13" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
<path d="M10 4L6 8l4 4"/>
</svg>
Back to Browse
</a>
</header>
<!-- Shell -->
<div class="page-shell">
<!-- Left Nav -->
<nav class="page-nav" id="page-nav">
<div class="nav-group-label">Contents</div>
<a class="nav-link active" href="#db-setup" data-section="db-setup">
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
<ellipse cx="8" cy="4" rx="6" ry="2.5"/>
<path d="M2 4v3c0 1.38 2.69 2.5 6 2.5s6-1.12 6-2.5V4"/>
<path d="M2 7v3c0 1.38 2.69 2.5 6 2.5s6-1.12 6-2.5V7"/>
<path d="M2 10v2c0 1.38 2.69 2.5 6 2.5s6-1.12 6-2.5v-2"/>
</svg>
Database Setup
</a>
<div class="nav-spacer"></div>
<a class="nav-link" href="#api-integration" data-section="api-integration">
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
<polyline points="5 4 1 8 5 12"/>
<polyline points="11 4 15 8 11 12"/>
<line x1="8" y1="2" x2="8" y2="14"/>
</svg>
API Integration
</a>
<div class="nav-spacer"></div>
<a class="nav-link" href="#ask-llm" data-section="ask-llm">
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
<path d="M14 2H2a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1h3l3 2 3-2h3a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1z"/>
<path d="M8 6v2M8 10h.01"/>
</svg>
Ask Your LLM
</a>
</nav>
<!-- Main Content -->
<main class="page-content">
<!-- ── SECTION 1: Database Setup ──────────────────── -->
<section class="section" id="db-setup">
<div class="section-header">
<div class="section-num">1</div>
<h2 class="section-title">Database Setup</h2>
</div>
<p class="section-desc">Import all 1,324 exercises into your database in 3 steps. Choose your database engine below.</p>
<div class="section-body">
<!-- DB Tabs -->
<div class="tab-bar" id="db-tabs" role="tablist">
<button class="tab-btn active" data-db="mssql" role="tab">SQL Server</button>
<button class="tab-btn" data-db="postgresql" role="tab">PostgreSQL</button>
<button class="tab-btn" data-db="mysql" role="tab">MySQL</button>
<button class="tab-btn" data-db="sqlite" role="tab">SQLite</button>
</div>
<div class="step-list">
<!-- Step 1 -->
<div class="step">
<div class="step-num">1</div>
<div class="step-body">
<h3 class="step-title">Create Table</h3>
<p class="step-desc">Run this in your database client (SSMS, DBeaver, pgAdmin, TablePlus, etc.):</p>
<div class="code-block">
<button class="copy-btn" id="copy-create-btn">Copy</button>
<pre class="code-pre" id="create-table-sql"></pre>
</div>
</div>
</div>
<!-- Step 2 -->
<div class="step">
<div class="step-num">2</div>
<div class="step-body">
<h3 class="step-title">Import Data</h3>
<p class="step-desc">Generate a <code>.sql</code> file with all 1,324 INSERT statements. The file is built entirely in your browser — nothing is uploaded to any server.</p>
<div style="display:flex;align-items:center;gap:0;">
<button class="generate-btn" id="generate-sql-btn">
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" width="14" height="14">
<path d="M8 2v8M5 7l3 3 3-3"/><path d="M2 12h12"/>
</svg>
Generate INSERT SQL
</button>
<span class="generate-status" id="generate-status"></span>
</div>
</div>
</div>
<!-- Step 3 -->
<div class="step">
<div class="step-num">3</div>
<div class="step-body">
<h3 class="step-title">Media Files</h3>
<p class="step-desc">Download the media archives and place them in your web server root or CDN. The <code>image</code> and <code>gif_url</code> columns store relative paths — prepend your base URL in your app.</p>
<div class="code-block">
<pre class="code-pre">your-server.com/
├── images/ ← 1,324 JPG thumbnails
└── videos/ ← 1,324 GIF animations</pre>
</div>
<div class="media-note">
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" style="flex-shrink:0;margin-top:1px">
<circle cx="8" cy="8" r="6"/><path d="M8 7v4M8 5.5h.01"/>
</svg>
The <code>images/</code> and <code>videos/</code> folders are already included in the repository. After cloning, just copy them to your server or CDN — no separate download needed.
</div>
</div>
</div>
</div>
</div>
</section>
<div class="divider"></div>
<!-- ── SECTION 2: API Integration ─────────────────── -->
<section class="section" id="api-integration">
<div class="section-header">
<div class="section-num">2</div>
<h2 class="section-title">API Integration</h2>
</div>
<p class="section-desc">Client-side code examples showing how to call your backend API from your app. Enter your API base URL below — all examples update live.</p>
<div class="section-body">
<!-- Base URL Input -->
<div class="url-input-row">
<span class="url-label">BASE URL</span>
<input
type="url"
class="url-input"
id="base-url-input"
value="https://api.yourapp.com"
placeholder="https://api.yourapp.com"
spellcheck="false"
/>
</div>
<!-- Language Tabs -->
<div class="tab-bar" id="lang-tabs" role="tablist">
<button class="tab-btn active" data-lang="curl" role="tab">cURL</button>
<button class="tab-btn" data-lang="js" role="tab">JavaScript</button>
<button class="tab-btn" data-lang="python" role="tab">Python</button>
<button class="tab-btn" data-lang="csharp" role="tab">C#</button>
<button class="tab-btn" data-lang="java" role="tab">Java</button>
<button class="tab-btn" data-lang="php" role="tab">PHP</button>
<button class="tab-btn" data-lang="go" role="tab">Go</button>
</div>
<!-- Endpoints -->
<div class="endpoint-list">
<!-- GET /exercises/:id -->
<div class="endpoint-card">
<div class="endpoint-header">
<span class="method-badge">GET</span>
<span class="endpoint-path">/exercises/<span style="color:var(--accent)">:id</span></span>
<span class="endpoint-desc">Fetch a single exercise by ID</span>
</div>
<div class="endpoint-body">
<div class="code-block">
<button class="copy-btn" onclick="copyBlock(this)">Copy</button>
<pre class="code-pre api-code" data-endpoint="getOne" id="code-getOne"></pre>
</div>
</div>
</div>
<!-- GET /exercises?page= -->
<div class="endpoint-card">
<div class="endpoint-header">
<span class="method-badge">GET</span>
<span class="endpoint-path">/exercises<span style="color:var(--text-tertiary)">?page=1&limit=20</span></span>
<span class="endpoint-desc">Paginated list of exercises</span>
</div>
<div class="endpoint-body">
<div class="code-block">
<button class="copy-btn" onclick="copyBlock(this)">Copy</button>
<pre class="code-pre api-code" data-endpoint="getAll" id="code-getAll"></pre>
</div>
</div>
</div>
<!-- GET /exercises?category=&body_part= -->
<div class="endpoint-card">
<div class="endpoint-header">
<span class="method-badge">GET</span>
<span class="endpoint-path">/exercises<span style="color:var(--text-tertiary)">?category=Strength&body_part=Chest</span></span>
<span class="endpoint-desc">Filter by category, body part, equipment</span>
</div>
<div class="endpoint-body">
<div class="code-block">
<button class="copy-btn" onclick="copyBlock(this)">Copy</button>
<pre class="code-pre api-code" data-endpoint="getFiltered" id="code-getFiltered"></pre>
</div>
</div>
</div>
</div>
</div>
</section>
<div class="divider"></div>
<!-- ── SECTION 3: Ask Your LLM ─────────────────────── -->
<section class="section" id="ask-llm">
<div class="section-header">
<div class="section-num">3</div>
<h2 class="section-title">Ask Your LLM</h2>
</div>
<p class="section-desc">
Don't want to write a backend from scratch? Copy this prompt into ChatGPT, Claude, Gemini, or any LLM — it contains everything needed to generate a complete, production-ready API in one shot.
</p>
<div class="section-body">
<div class="llm-selectors">
<div class="selector-group">
<div class="selector-label">Framework</div>
<div class="selector-tabs" id="framework-tabs">
<button class="selector-btn active" data-fw="express">Express.js</button>
<button class="selector-btn" data-fw="fastapi">FastAPI</button>
<button class="selector-btn" data-fw="aspnet">ASP.NET Core</button>
<button class="selector-btn" data-fw="spring">Spring Boot</button>
<button class="selector-btn" data-fw="laravel">Laravel</button>
<button class="selector-btn" data-fw="gin">Gin (Go)</button>
</div>
</div>
<div class="selector-group">
<div class="selector-label">Database</div>
<div class="selector-tabs" id="llm-db-tabs">
<button class="selector-btn active" data-llmdb="postgresql">PostgreSQL</button>
<button class="selector-btn" data-llmdb="mysql">MySQL</button>
<button class="selector-btn" data-llmdb="mssql">SQL Server</button>
<button class="selector-btn" data-llmdb="sqlite">SQLite</button>
</div>
</div>
</div>
<div class="llm-prompt-wrap">
<textarea class="llm-prompt-box" id="llm-prompt" readonly spellcheck="false"></textarea>
</div>
<div class="llm-actions">
<button class="copy-prompt-btn" id="copy-prompt-btn">
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
<rect x="4" y="4" width="9" height="11" rx="1.5"/>
<path d="M11 4V3a1 1 0 0 0-1-1H3a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h1"/>
</svg>
Copy Prompt
</button>
<span class="llm-hint">Paste into ChatGPT, Claude, Gemini, or any LLM</span>
</div>
</div>
</section>
</main>
</div>
<script>
// ══════════════════════════════════════════════════
// ── DB SQL Templates ───────────────────────────────
// ══════════════════════════════════════════════════
const DB_SQL = {
mssql: `CREATE TABLE exercises (
id NVARCHAR(10) PRIMARY KEY,
name NVARCHAR(255) NOT NULL,
category NVARCHAR(100),
body_part NVARCHAR(100),
equipment NVARCHAR(100),
instructions_en NVARCHAR(MAX),
instructions_tr NVARCHAR(MAX),
muscle_group NVARCHAR(100),
secondary_muscles NVARCHAR(MAX), -- JSON array stored as string
target NVARCHAR(100),
image NVARCHAR(500),
gif_url NVARCHAR(500),
created_at DATETIME2
);`,
postgresql: `CREATE TABLE exercises (
id VARCHAR(10) PRIMARY KEY,
name VARCHAR(255) NOT NULL,
category VARCHAR(100),
body_part VARCHAR(100),
equipment VARCHAR(100),
instructions_en TEXT,
instructions_tr TEXT,
muscle_group VARCHAR(100),
secondary_muscles JSONB,
target VARCHAR(100),
image VARCHAR(500),
gif_url VARCHAR(500),
created_at TIMESTAMPTZ
);`,
mysql: `CREATE TABLE exercises (
id VARCHAR(10) PRIMARY KEY,
name VARCHAR(255) NOT NULL,
category VARCHAR(100),
body_part VARCHAR(100),
equipment VARCHAR(100),
instructions_en TEXT,
instructions_tr TEXT,
muscle_group VARCHAR(100),
secondary_muscles JSON,
target VARCHAR(100),
image VARCHAR(500),
gif_url VARCHAR(500),
created_at DATETIME
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;`,
sqlite: `CREATE TABLE exercises (
id TEXT PRIMARY KEY,
name TEXT NOT NULL,
category TEXT,
body_part TEXT,
equipment TEXT,
instructions_en TEXT,
instructions_tr TEXT,
muscle_group TEXT,
secondary_muscles TEXT, -- JSON array stored as string
target TEXT,
image TEXT,
gif_url TEXT,
created_at TEXT
);`
};
// ══════════════════════════════════════════════════
// ── API Code Templates ─────────────────────────────
// ══════════════════════════════════════════════════
const API_TEMPLATES = {
curl: {
getOne: (base) =>
`# GET single exercise by ID
curl -s "${base}/exercises/0001"
# Pretty-print the response (Python 3 built-in)
curl -s "${base}/exercises/0001" | python3 -m json.tool`,
getAll: (base) =>
`# GET all exercises — page 1, 20 per page
curl -s "${base}/exercises?page=1&limit=20"
# Page 2, 50 per page
curl -s "${base}/exercises?page=2&limit=50"
# Response shape:
# {
# "data": [ ...exercises ],
# "total": 1324,
# "page": 1,
# "limit": 20,
# "totalPages": 67
# }`,
getFiltered: (base) =>
`# Filter by category
curl -s "${base}/exercises?category=Strength&page=1&limit=20"
# Filter by body part
curl -s "${base}/exercises?body_part=Chest&page=1&limit=20"
# Combine filters
curl -s "${base}/exercises?category=Strength&body_part=Chest&page=1&limit=20"
# With equipment filter
curl -s "${base}/exercises?equipment=Barbell&target=Pectorals&page=1&limit=20"`,
},
js: {
getOne: (base) =>
`const BASE_URL = '${base}';
// GET /exercises/:id — fetch a single exercise
async function getExercise(id) {
const res = await fetch(\`\${BASE_URL}/exercises/\${id}\`);
if (!res.ok) throw new Error(\`HTTP \${res.status}\`);
return res.json();
}
// Usage
const exercise = await getExercise('0001');
console.log(exercise.name); // "Barbell Bench Press"
console.log(exercise.category); // "Strength"
console.log(exercise.gif_url); // "videos/0001.gif"`,
getAll: (base) =>
`const BASE_URL = '${base}';
// GET /exercises?page=&limit= — paginated list
async function getExercises({ page = 1, limit = 20 } = {}) {
const params = new URLSearchParams({ page, limit });
const res = await fetch(\`\${BASE_URL}/exercises?\${params}\`);
if (!res.ok) throw new Error(\`HTTP \${res.status}\`);
return res.json();
}
// Usage
const result = await getExercises({ page: 1, limit: 20 });
console.log(result.data); // Array of exercises
console.log(result.total); // 1324
console.log(result.page); // 1
console.log(result.totalPages); // 67`,
getFiltered: (base) =>
`const BASE_URL = '${base}';
// GET /exercises with filters
async function getExercisesFiltered({
page = 1,
limit = 20,
category,
bodyPart,
equipment,
target,
} = {}) {
const params = new URLSearchParams({ page, limit });
if (category) params.set('category', category);
if (bodyPart) params.set('body_part', bodyPart);
if (equipment) params.set('equipment', equipment);
if (target) params.set('target', target);
const res = await fetch(\`\${BASE_URL}/exercises?\${params}\`);
if (!res.ok) throw new Error(\`HTTP \${res.status}\`);
return res.json();
}
// Usage
const result = await getExercisesFiltered({
category: 'Strength',
bodyPart: 'Chest',
page: 1,
limit: 20,
});
console.log(result.data[0].name); // e.g. "Barbell Bench Press"`,
},
python: {
getOne: (base) =>
`import requests
BASE_URL = "${base}"
# GET /exercises/:id — fetch a single exercise
def get_exercise(exercise_id: str) -> dict:
res = requests.get(f"{BASE_URL}/exercises/{exercise_id}")
res.raise_for_status()
return res.json()
# Usage
exercise = get_exercise("0001")
print(exercise["name"]) # Barbell Bench Press
print(exercise["category"]) # Strength
print(exercise["gif_url"]) # videos/0001.gif`,
getAll: (base) =>
`import requests
BASE_URL = "${base}"
# GET /exercises?page=&limit= — paginated list
def get_exercises(page: int = 1, limit: int = 20) -> dict:
res = requests.get(f"{BASE_URL}/exercises", params={
"page": page,
"limit": limit,
})
res.raise_for_status()
return res.json()
# Usage
result = get_exercises(page=1, limit=20)
print(result["data"]) # list of exercises
print(result["total"]) # 1324
print(result["page"]) # 1
print(result["totalPages"]) # 67`,
getFiltered: (base) =>
`import requests
BASE_URL = "${base}"
# GET /exercises with filters
def get_exercises_filtered(
page: int = 1,
limit: int = 20,
category: str = None,
body_part: str = None,
equipment: str = None,
target: str = None,
) -> dict:
params = {"page": page, "limit": limit}
if category: params["category"] = category
if body_part: params["body_part"] = body_part
if equipment: params["equipment"] = equipment
if target: params["target"] = target
res = requests.get(f"{BASE_URL}/exercises", params=params)
res.raise_for_status()
return res.json()
# Usage
result = get_exercises_filtered(
category="Strength",
body_part="Chest",
page=1,
limit=20,
)
print(result["data"][0]["name"]) # e.g. Barbell Bench Press`,
},
csharp: {
getOne: (base) =>
`using System.Net.Http.Json;
var client = new HttpClient { BaseAddress = new Uri("${base}") };
// GET /exercises/:id — fetch a single exercise
async Task<Exercise?> GetExerciseAsync(string id)
{
var res = await client.GetAsync($"/exercises/{id}");
res.EnsureSuccessStatusCode();
return await res.Content.ReadFromJsonAsync<Exercise>();
}
// Usage
var exercise = await GetExerciseAsync("0001");