Skip to content

Commit a463a3c

Browse files
Sync from CodeSignal container and Dockerize backend
1 parent 176e618 commit a463a3c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+3265
-10938
lines changed

.gitignore

100644100755
Lines changed: 2 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,3 @@
1-
# compiled output
2-
/dist
3-
/node_modules
4-
/build
5-
6-
# Logs
7-
logs
8-
*.log
9-
npm-debug.log*
10-
pnpm-debug.log*
11-
yarn-debug.log*
12-
yarn-error.log*
13-
lerna-debug.log*
14-
15-
# OS
16-
.DS_Store
17-
18-
# Tests
19-
/coverage
20-
/.nyc_output
21-
22-
# IDEs and editors
23-
/.idea
24-
.project
25-
.classpath
26-
.c9/
27-
*.launch
28-
.settings/
29-
*.sublime-workspace
30-
31-
# IDE - VSCode
32-
.vscode/*
33-
!.vscode/settings.json
34-
!.vscode/tasks.json
35-
!.vscode/launch.json
36-
!.vscode/extensions.json
37-
38-
# dotenv environment variable files
1+
node_modules
2+
dist
393
.env
40-
.env.development.local
41-
.env.test.local
42-
.env.production.local
43-
.env.local
44-
45-
# temp directory
46-
.temp
47-
.tmp
48-
49-
# Runtime data
50-
pids
51-
*.pid
52-
*.seed
53-
*.pid.lock
54-
55-
# Diagnostic reports (https://nodejs.org/api/report.html)
56-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

.server_pid

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ COPY --from=build /app/public ./public
3131

3232
EXPOSE 3001
3333
# Because tsconfig includes project root, compiled entry is dist/src/main.js
34-
CMD ["node", "dist/src/main.js"]
34+
CMD ["node", "dist/main.js"]

build.out

Whitespace-only changes.

course6-curl-results.txt

Lines changed: 251 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,251 @@
1+
== Course 6: Advanced Filtering, Aggregation, and Sorting — Test CURLs ==
2+
-- Public: books --
3+
{
4+
"items": [
5+
{
6+
"id": "b772cd76-d5b2-4c93-97bd-c423593171c6",
7+
"title": "The Hobbit",
8+
"author": "J.R.R. Tolkien",
9+
"totalPages": 310,
10+
"publishDate": "1937-09-21",
11+
"uploadedAt": "2025-09-29T08:10:09.120Z"
12+
},
13+
{
14+
"id": "d0678180-2ddd-425c-a36b-babf2ad9d1f7",
15+
"title": "Dune",
16+
"author": "Frank Herbert",
17+
"totalPages": 412,
18+
"publishDate": "1965-08-01",
19+
"uploadedAt": "2025-09-29T08:10:09.120Z"
20+
},
21+
{
22+
"id": "a6d78ef3-e52e-4ea3-b328-b71d4cf9adaf",
23+
"title": "Clean Code",
24+
"author": "Robert C. Martin",
25+
"totalPages": 464,
26+
"publishDate": "2008-08-01",
27+
"uploadedAt": "2025-09-29T08:10:09.120Z"
28+
},
29+
{
30+
"id": "8a42ae3e-b20e-4535-bbc1-3e1e43ab26da",
31+
"title": "The Pragmatic Programmer",
32+
"author": "Andrew Hunt",
33+
"totalPages": 352,
34+
"publishDate": "1999-10-30",
35+
"uploadedAt": "2025-09-29T08:10:09.120Z"
36+
},
37+
{
38+
"id": "b01d73bb-abaa-48f5-93ee-e357ab46f3ff",
39+
"title": "1984",
40+
"author": "George Orwell",
41+
"totalPages": 328,
42+
"publishDate": "1949-06-08",
43+
"uploadedAt": "2025-09-29T08:10:09.120Z"
44+
},
45+
{
46+
"id": "7ad28510-0f49-40a7-a8d1-f74b3c530621",
47+
"title": "To Kill a Mockingbird",
48+
"author": "Harper Lee",
49+
"totalPages": 281,
50+
"publishDate": "1960-07-11",
51+
"uploadedAt": "2025-09-29T08:10:09.120Z"
52+
},
53+
{
54+
"id": "94a497d7-1341-4974-9b79-b7fb6407b80e",
55+
"title": "The Name of the Wind",
56+
"author": "Patrick Rothfuss",
57+
"totalPages": 662,
58+
"publishDate": "2007-03-27",
59+
"uploadedAt": "2025-09-29T08:10:09.120Z"
60+
},
61+
{
62+
"id": "40162d55-9413-4357-85ae-a55d98c44cbe",
63+
"title": "Sapiens",
64+
"author": "Yuval Noah Harari",
65+
"totalPages": 443,
66+
"publishDate": "2011-01-01",
67+
"uploadedAt": "2025-09-29T08:10:09.120Z"
68+
}
69+
],
70+
"page": 1,
71+
"pageSize": 20,
72+
"total": 8
73+
}
74+
-- Public: users --
75+
[
76+
{
77+
"id": "5cf92552-0d0b-46b8-812d-3530173c594d",
78+
"name": "Admin",
79+
"username": "admin",
80+
"passwordHash": "$2b$10$HLxs7wtjtkP39j8NHpsiT.UY.iusbzbr1U39m21tl.HF208oVqsIe",
81+
"role": "admin",
82+
"friendIds": []
83+
},
84+
{
85+
"id": "c55d289a-78b0-40a6-8af0-9944d4dc2a7d",
86+
"name": "Alice",
87+
"username": "alice",
88+
"passwordHash": "$2b$10$kaR.oWKQE8qeP3o80Q/6tuSiJlHqTdH09ca6LtYUO0qXV28DPLk0i",
89+
"role": "user",
90+
"friendIds": []
91+
}
92+
]
93+
ADMIN_TOKEN: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1Y2Y5MjU1Mi0wZDBiLTQ2YjgtODEyZC0zNTMwMTczYzU5NGQiLCJyb2xlIjoiYWRtaW4iLCJpYXQiOjE3NTkxMzM2MDIsImV4cCI6MTc1OTEzNzIwMn0.and0LXNlY3JldC5leUpoYkdjaU9pSklVekkxTmlJc0luUjVjQ0k2SWtwWFZDSjkuZXlKemRXSWlPaUkxWTJZNU1qVTFNaTB3WkRCaUxUUTJZamd0T0RFeVpDMHpOVE13TVRjell6VTVOR1FpTENKeWIyeGxJam9pWVdSdGFXNGlMQ0pwWVhRaU9qRTNOVGt4TXpNMk1ESXNJbVY0Y0NJNk1UYzFPVEV6TnpJd01uMA
94+
-- Create: Clean Code --
95+
{"data":{"id":"7d9577cf-590a-43a9-96d2-37a52808e5ba","title":"Clean Code","author":"Robert C. Martin","totalPages":464,"publishDate":"2008-08-01","uploadedAt":"2025-09-29T08:13:22.232Z"},"meta":{"timestamp":"2025-09-29T08:13:22.232Z"}}
96+
-- Create: The Pragmatic Programmer --
97+
{"data":{"id":"27a66250-d214-4975-b338-8b5ee0ca96ab","title":"The Pragmatic Programmer","author":"Andrew Hunt","totalPages":352,"publishDate":"1999-10-30","uploadedAt":"2025-09-29T08:13:22.240Z"},"meta":{"timestamp":"2025-09-29T08:13:22.240Z"}}
98+
-- Search q='the' sorted by publishDate desc, page 1 size 2 --
99+
{
100+
"items": [
101+
{
102+
"id": "94a497d7-1341-4974-9b79-b7fb6407b80e",
103+
"title": "The Name of the Wind",
104+
"author": "Patrick Rothfuss",
105+
"totalPages": 662,
106+
"publishDate": "2007-03-27",
107+
"uploadedAt": "2025-09-29T08:10:09.120Z"
108+
},
109+
{
110+
"id": "8a42ae3e-b20e-4535-bbc1-3e1e43ab26da",
111+
"title": "The Pragmatic Programmer",
112+
"author": "Andrew Hunt",
113+
"totalPages": 352,
114+
"publishDate": "1999-10-30",
115+
"uploadedAt": "2025-09-29T08:10:09.120Z"
116+
}
117+
],
118+
"page": 1,
119+
"pageSize": 2,
120+
"total": 4
121+
}
122+
ALICE_TOKEN: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJjNTVkMjg5YS03OGIwLTQwYTYtOGFmMC05OTQ0ZDRkYzJhN2QiLCJyb2xlIjoidXNlciIsImlhdCI6MTc1OTEzMzYwMiwiZXhwIjoxNzU5MTM3MjAyfQ.and0LXNlY3JldC5leUpoYkdjaU9pSklVekkxTmlJc0luUjVjQ0k2SWtwWFZDSjkuZXlKemRXSWlPaUpqTlRWa01qZzVZUzAzT0dJd0xUUXdZVFl0T0dGbU1DMDVPVFEwWkRSa1l6SmhOMlFpTENKeWIyeGxJam9pZFhObGNpSXNJbWxoZENJNk1UYzFPVEV6TXpZd01pd2laWGh3SWpveE56VTVNVE0zTWpBeWZR
123+
BOOK1 Hobbit: b772cd76-d5b2-4c93-97bd-c423593171c6 BOOK2 CleanCode: a6d78ef3-e52e-4ea3-b328-b71d4cf9adaf ALICE_ID: c55d289a-78b0-40a6-8af0-9944d4dc2a7d
124+
{"data":{"userId":"c55d289a-78b0-40a6-8af0-9944d4dc2a7d","bookId":"b772cd76-d5b2-4c93-97bd-c423593171c6","currentPage":0,"status":"want-to-read","updatedAt":"2025-09-29T08:13:22.473Z"},"meta":{"timestamp":"2025-09-29T08:13:22.473Z"}}
125+
{"data":{"userId":"c55d289a-78b0-40a6-8af0-9944d4dc2a7d","bookId":"a6d78ef3-e52e-4ea3-b328-b71d4cf9adaf","currentPage":120,"status":"in-progress","updatedAt":"2025-09-29T08:13:22.482Z"},"meta":{"timestamp":"2025-09-29T08:13:22.482Z"}}
126+
[
127+
{
128+
"bookId": "a6d78ef3-e52e-4ea3-b328-b71d4cf9adaf",
129+
"title": "Clean Code",
130+
"author": "Robert C. Martin",
131+
"totalPages": 464,
132+
"currentPage": 120,
133+
"status": "in-progress",
134+
"progress": 0.25862068965517243,
135+
"updatedAt": "2025-09-29T08:13:22.482Z"
136+
},
137+
{
138+
"bookId": "d0678180-2ddd-425c-a36b-babf2ad9d1f7",
139+
"title": "Dune",
140+
"author": "Frank Herbert",
141+
"totalPages": 412,
142+
"currentPage": 100,
143+
"status": "in-progress",
144+
"progress": 0.24271844660194175,
145+
"updatedAt": "2025-09-29T08:10:09.120Z"
146+
}
147+
]
148+
-- Catalog sorted by avgProgress desc --
149+
{
150+
"items": [
151+
{
152+
"id": "8a42ae3e-b20e-4535-bbc1-3e1e43ab26da",
153+
"title": "The Pragmatic Programmer",
154+
"author": "Andrew Hunt",
155+
"totalPages": 352,
156+
"publishDate": "1999-10-30",
157+
"uploadedAt": "2025-09-29T08:10:09.120Z"
158+
},
159+
{
160+
"id": "a6d78ef3-e52e-4ea3-b328-b71d4cf9adaf",
161+
"title": "Clean Code",
162+
"author": "Robert C. Martin",
163+
"totalPages": 464,
164+
"publishDate": "2008-08-01",
165+
"uploadedAt": "2025-09-29T08:10:09.120Z"
166+
},
167+
{
168+
"id": "d0678180-2ddd-425c-a36b-babf2ad9d1f7",
169+
"title": "Dune",
170+
"author": "Frank Herbert",
171+
"totalPages": 412,
172+
"publishDate": "1965-08-01",
173+
"uploadedAt": "2025-09-29T08:10:09.120Z"
174+
},
175+
{
176+
"id": "b772cd76-d5b2-4c93-97bd-c423593171c6",
177+
"title": "The Hobbit",
178+
"author": "J.R.R. Tolkien",
179+
"totalPages": 310,
180+
"publishDate": "1937-09-21",
181+
"uploadedAt": "2025-09-29T08:10:09.120Z"
182+
},
183+
{
184+
"id": "b01d73bb-abaa-48f5-93ee-e357ab46f3ff",
185+
"title": "1984",
186+
"author": "George Orwell",
187+
"totalPages": 328,
188+
"publishDate": "1949-06-08",
189+
"uploadedAt": "2025-09-29T08:10:09.120Z"
190+
},
191+
{
192+
"id": "7ad28510-0f49-40a7-a8d1-f74b3c530621",
193+
"title": "To Kill a Mockingbird",
194+
"author": "Harper Lee",
195+
"totalPages": 281,
196+
"publishDate": "1960-07-11",
197+
"uploadedAt": "2025-09-29T08:10:09.120Z"
198+
},
199+
{
200+
"id": "94a497d7-1341-4974-9b79-b7fb6407b80e",
201+
"title": "The Name of the Wind",
202+
"author": "Patrick Rothfuss",
203+
"totalPages": 662,
204+
"publishDate": "2007-03-27",
205+
"uploadedAt": "2025-09-29T08:10:09.120Z"
206+
},
207+
{
208+
"id": "40162d55-9413-4357-85ae-a55d98c44cbe",
209+
"title": "Sapiens",
210+
"author": "Yuval Noah Harari",
211+
"totalPages": 443,
212+
"publishDate": "2011-01-01",
213+
"uploadedAt": "2025-09-29T08:10:09.120Z"
214+
},
215+
{
216+
"id": "7d9577cf-590a-43a9-96d2-37a52808e5ba",
217+
"title": "Clean Code",
218+
"author": "Robert C. Martin",
219+
"totalPages": 464,
220+
"publishDate": "2008-08-01",
221+
"uploadedAt": "2025-09-29T08:13:22.232Z"
222+
},
223+
{
224+
"id": "27a66250-d214-4975-b338-8b5ee0ca96ab",
225+
"title": "The Pragmatic Programmer",
226+
"author": "Andrew Hunt",
227+
"totalPages": 352,
228+
"publishDate": "1999-10-30",
229+
"uploadedAt": "2025-09-29T08:13:22.240Z"
230+
}
231+
],
232+
"page": 1,
233+
"pageSize": 10,
234+
"total": 10
235+
}
236+
-- Stats for The Hobbit --
237+
{
238+
"bookId": "b772cd76-d5b2-4c93-97bd-c423593171c6",
239+
"readers": 2,
240+
"avgCurrentPage": 25,
241+
"completionRate": 0,
242+
"avgProgressPct": 0.08064516129032258
243+
}
244+
{
245+
"userId": "c55d289a-78b0-40a6-8af0-9944d4dc2a7d",
246+
"totalPagesRead": 220,
247+
"booksInShelf": 3,
248+
"booksCompleted": 0,
249+
"avgProgressPct": 0.18549747048903878
250+
}
251+
== Done ==

main.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
cd /usercode/FILESYSTEM
4+
5+
bash .codesignal/run_solution.sh

0 commit comments

Comments
 (0)