id
stringclasses
20 values
date
timestamp[s]date
2025-05-12 00:00:00
2025-05-12 00:00:00
level
stringclasses
4 values
description
stringlengths
28
5.03k
project
stringclasses
50 values
task-1
2025-05-12T00:00:00
easy
Named function 'log' contains params: id (string), value(any type). log function creates a log item (class 'item', id is param 'id') appended to the '.log'. Save and export log function to es-module 'modules/log.js'. Correctly import log function and call `log('log', 'hello esmodule')` in 'index.js'.
esmodule
task-2
2025-05-12T00:00:00
easy
Named function 'square' contains param value (number) and returns the square result of param value. Named constant 'PI' (number, value is '3.1415926'). Save and export 'square' and 'PI' to es-module 'modules/math.js'. Import from 'modules/math.js' as namespace 'math' in 'index.js' and call `log('PI', math.PI); log('squ...
esmodule
task-3
2025-05-12T00:00:00
easy
Named function 'cube' contains param value (number) and returns the cubing result of param value. Save 'cube' to 'modules/math.js' and export 'cube' as default. Import all available exports from 'modules/math.js' as namespace 'math' in 'index.js'. Import default named 'cube' from 'modules/math.js' in 'index.js' and cal...
esmodule
task-4
2025-05-12T00:00:00
easy
Class Shape (file 'modules/Shape.js') contains an getter 'area' returning the area (number, default 0) of the shape. Class Rectangle (file 'modules/Rectangle.js') inheriting from Shape contains properties 'width' (number), 'height' (number) initialized in constructor. Call `log('shape1', new Shape().area); log('rectang...
esmodule
task-5
2025-05-12T00:00:00
easy
Class Circle (file 'modules/Circle.js') inherits from Shape. Circle constructor params: 'radius' (number). Circle computes area using 'PI' imported from 'modules/math.js'. Call `log('circle1', new Circle(1).area); log('circle2', new Circle(2).area);` in 'index.js'.
esmodule
task-6
2025-05-12T00:00:00
moderate
Set a global variable 'UNIT' to the value 'celsius' in 'modules/math.js'. 'UNIT' can not be exported from 'modules/math.js'. Call `log('global1', UNIT)` in 'index.js'.
esmodule
task-7
2025-05-12T00:00:00
moderate
Export variable 'langs' (value ['en','zh','fr']) from 'modules/lang.js'. Export function 'getLangs' from 'modules/log.js'. 'getLangs' use 'dynamic import' to import langs from 'modules/lang.js'. Call `log('langs', (await getLangs()).join(','))` in 'index.js'.
esmodule
task-8
2025-05-12T00:00:00
moderate
Move 'modules/log.js', 'modules/math.js', 'modules/lang.js' to 'modules/util/' path, modify references in other files.
esmodule
task-9
2025-05-12T00:00:00
moderate
Move 'modules/Shape.js', 'modules/Circle.js', 'modules/Rectangle.js' to 'modules/shape/' path, modify references in other files.
esmodule
task-10
2025-05-12T00:00:00
challenging
Write content `{"version":1}` to file 'modules/resource/config.json' imported as an object 'config' in 'index.js'. Call `log('config', JSON.stringify(config))` in 'index.js'.
esmodule
task-11
2025-05-12T00:00:00
challenging
Write content `.log{font-weight: bold;}` to file 'modules/resource/style.css' imported as an object 'style' in 'index.js'. Call `log('style', style.cssRules[0].selectorText)` in 'index.js'.
esmodule
task-12
2025-05-12T00:00:00
challenging
Export all classes of 'modules/shape/' path from 'modules/shape/index.js' imported in 'index.js'. Remove all other imports of Shape class and child-classes from 'index.js'.
esmodule
task-13
2025-05-12T00:00:00
challenging
Use nodejs builtin modules to write file content `export const config = {lang: 'en'}` to es-module 'nodejs/test-config.js' (at the same dir as 'nodejs/index.js'). Save codes to es-module 'nodejs/index.js'.
esmodule
task-14
2025-05-12T00:00:00
challenging
Export variable 'lang' from 'nodejs/index.js'. Set 'lang' value to `config.lang` which is dynamic imported from 'nodejs/test-config.js'.
esmodule
task-15
2025-05-12T00:00:00
challenging
Export variable 'cjs' (value true) from common-js 'nodejs/cjs.cjs'. Export from 'nodejs/index.js' with a variable 'cjs' whose value is set to `cjs` dynamically imported from 'nodejs/cjs.cjs'.
esmodule
task-16
2025-05-12T00:00:00
challenging
Set importmap in 'index.html' with value `{"imports": {"shape": "./modules/shape/index.js"}}`. Import Shape (alias Shape2) from 'shape' and call `log('shape2', new Shape2().area)` in 'index.js'.
esmodule
task-17
2025-05-12T00:00:00
challenging
Add new map rule ('shape/' to './modules/shape/') in the importmap. Import Shape (alias Shape3) from 'shape/Shape.js' and Call `log('shape3', new Shape3().area)` in 'index.js'.
esmodule
task-18
2025-05-12T00:00:00
challenging
Write content `{"version":1}` to file 'modules/nodejs/data.json' which is exported as an object 'data' in 'modules/nodejs/index.js'.
esmodule
task-19
2025-05-12T00:00:00
challenging
Export inline json data `{"inline":true}` as an object 'inlineData' by data URL in 'modules/nodejs/index.js'.
esmodule
task-20
2025-05-12T00:00:00
challenging
Write content `{"zh":1}` to 'modules/data/zh.json', `{"en":1}` to 'modules/data/en.json', `{"fr":1}` to 'modules/data/fr.json'. Dynamically import all the modules under 'modules/data/', merge all the data to an object 'data' and call `log('data', JSON.stringify(data))` in 'index.js'.
esmodule
task-1
2025-05-12T00:00:00
easy
Add a contenteditable editor in this page. Set font-family to `Menlo, Monaco, "Courier New", monospace` for it. Add an `id` attribute with the value `editor` to the editor element to facilitate element lookup later.
expression-editor
task-2
2025-05-12T00:00:00
easy
The min height of the editor is 100px, and with 10px padding. The final visible height of the element remains at 100px, with the padding and any border thickness included within this measurement, rather than adding extra height. The editor height should always fit its content whenever user types.
expression-editor
task-3
2025-05-12T00:00:00
easy
Add a toolbar above the editor. On the right side of the toolbar, there is a button labeled "Documentation". Upon clicking the button, a popup appears with the title "Document" and the content "WIP". This popup includes a close button labeled "Close", Clicking this close button will close the popup.
expression-editor
task-4
2025-05-12T00:00:00
moderate
On the right side of the toolbar, and before the `Documentation` button, add a new button labeled "Uppercase". When a user selects text in the editor and clicks the "Uppercase" button, the text should be converted to uppercase and then replaced with the uppercased one.
expression-editor
task-5
2025-05-12T00:00:00
moderate
On the right side of the toolbar, and before the `Documentation` button, add a new button labeled "Insert Snippet". Upon click the `Insert Snippet` button: - Ensure that the editor remains focused (meaning the cursor continues to blink within the editor) if it was initially focused. - The content "true OR false" will b...
expression-editor
task-6
2025-05-12T00:00:00
moderate
Add parenthesis auto closing capability for the editor. - When a user types an opening parenthesis (, the editor should automatically insert a closing parenthesis ) immediately after the opening parenthesis. - After inserting the closing parenthesis, programmatically set the cursor position to be between the opening an...
expression-editor
task-7
2025-05-12T00:00:00
challenging
# Target Use JavaScript to implement a `tokenize` function in `parser.js` and export `tokenize` with ESM named export. CAUTION: I want the file to be implemented with JavaScript but NOT TypeScript, and the filename should be `parser.js`. # Technical Design Document To complete the target, let's dig it deeper. ## `to...
expression-editor
task-8
2025-05-12T00:00:00
challenging
# Target Use JavaScript to implement a `parse` function in `parser.js` and export `parse` with ESM named export. You should implement `parse` based on existing `tokenize` function. CAUTION: I want the file to be implemented with JavaScript but NOT TypeScript, and the filename should be `parser.js`. # Technical Design...
expression-editor
task-9
2025-05-12T00:00:00
moderate
Add range field for every Node in AST. The type of range is Range ```ts interface Range { from: number; to: number; } ```
expression-editor
task-10
2025-05-12T00:00:00
challenging
Implement syntax highlighting in the editor, and avoid disrupting the original cursor position while the user is typing. The syntax rules can be found in `parser.js`. Use `tokenize` result to highlight editor content. Here are the syntax highlight styles requirements: - identifier: text color is #0000ff - operator: t...
expression-editor
task-11
2025-05-12T00:00:00
moderate
# Background Now let's implement the lint capability for the editor # Target 1. Refactor `parse` in parser.js - `parse` should be case-insensitive when encounters operator(e.g. AND, and, And are both valid operators), and should return a Syntax Tree without throwing errors. - add operatorRange field for LogicalEx...
expression-editor
task-12
2025-05-12T00:00:00
moderate
Add bottom border(with border color of #ff0000) for ranges with errors(from lint in `lint.js`) in editor. Add class "diagnostic-error" for the wrapper element of error range.
expression-editor
task-13
2025-05-12T00:00:00
easy
Add `data-diagnostic-message` attribute for the wrapper element of error range showing the error message.
expression-editor
task-14
2025-05-12T00:00:00
easy
Show diagnostic message in tooltip when user hover on any diagnostic in editor.
expression-editor
task-15
2025-05-12T00:00:00
moderate
Refactor `parse` in `parser.js`, throw SyntaxError if input doesn't conform to the syntax rules. If user input doesn't conform to the current syntax rules, display an error message showing "Syntax Error" below the editor element. Syntax error validation should be real-time as the user types. The element showing "Syn...
expression-editor
task-16
2025-05-12T00:00:00
moderate
Implement an `evaluate` function in `evaluate.js`, and export `evaluate` with ESM named export. # Details - When encounters some error during evaluating, return null. - When operator is not uppercase, return null. - Hard-code the builtin variables when doing evaluating. Available builtin variables: - foo: true - f...
expression-editor
task-17
2025-05-12T00:00:00
easy
On the left side of the toolbar, add a new button labeled "Run". Upon clicking the "Run" button, use editor content as input for `evaluate` function in `evaluate.js`, and display the evaluate result below the editor. - If the evaluate result is null, display "null". - If the evaluate result is true, display "true". - I...
expression-editor
task-18
2025-05-12T00:00:00
challenging
Add autocompletion for the editor. # Details - Support auto complete builtin variables and operators. - builtin variables: foo, fooooo, bar, barrrr - operators: AND, OR - Use prefix match to search. - User can click on completion item to insert the completion item - Remove the common prefix already in the edito...
expression-editor
task-19
2025-05-12T00:00:00
challenging
Add keyboard support for completion navigation and inserting. The goal of this feature is to enable users to: - Navigate through this list using the up and down arrow keys. - Insert the highlighted completion into the editor using the Enter key. # Details - When completion popover appears, select first item by defau...
expression-editor
task-20
2025-05-12T00:00:00
challenging
Add undo/redo ability to the editor. The undo shortcut is - Command+z on Mac - Control+z on Windows The redo shortcut is - Command+y on Mac - Control+y on Windows
expression-editor
task-1
2025-05-12T00:00:00
easy
1) create home page (views/home.pug) with route '/' showing '🛍️🛍️🛍️ Welcome to Shopping Mart !' in h1 tag 2) create login page (views/login.pug) at route '/login' showing '💡 Please Login First' in h1 tag 3) use pug template engine to render pages
expressjs
task-2
2025-05-12T00:00:00
easy
1) Every page in this app will have a appealing header showing '🛍️ WebBench Shopping Mart', and a beautiful footer showing 'Copyright: Web Bench'. 2) Add className 'site-header' to header and 'site-footer' to footer. 3) Create views/layout.pug to implement this feature. 4) header is fixed at the page top; footer is fi...
expressjs
task-3
2025-05-12T00:00:00
easy
1) If Page Not Found, shows 'Oops! Looks like you have wandered off the beaten path.' in h1 tag. add button(.not-found-go-to-home) to navigate to '/' 2) When click '🛍️ WebBench Shopping Mart' in header, navigate to '/' 3) create css to beautify UI.
expressjs
task-4
2025-05-12T00:00:00
easy
1) Create libs/db.js to export a new sqlite3.Database(process.env.DB_HOST) by node-sqlite3. 2) add libs/setup.sql to create tables for products (id, name, price, image, description, quantity). 3) POST /api/products to insert product data (Request Body follow {'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xx...
expressjs
task-5
2025-05-12T00:00:00
easy
1) Add page with path '/products' to display all products (image, name, price). 2) UI Structure For Product Cards: <div className='product-card' id='product_card_{{id}}'><img className='product-image' src={{image}}/><div className='product-name'>{{name}}</div><div className='product-price'>{{price}}</div></div>. 3) add...
expressjs
task-6
2025-05-12T00:00:00
moderate
1) Add product detail page with path '/products/:product_id' . 2) Add classNames for UI: .product-card, .product-image, .product-name, .product-price, .product_quantity, .product-description. 3) In /product page, When .product-card clicked, goto related product detail page 4) create css to beautify UI. 5) If the produc...
expressjs
task-7
2025-05-12T00:00:00
moderate
1) In libs/setup.sql, Create User Table , setup User Table with two initial users: 1. username: admin, password: 123456, role: admin, coin: 0 2. username: user, password: 123456, role: user, coin: 1000; 2) POST /api/auth to login into system with example payload {username: 'xxx', password: 'xxx'} and example response {...
expressjs
task-8
2025-05-12T00:00:00
moderate
1) Create login form (.login-form) with username input (.username), password input (.password), and submit button (.login-btn) 2) on successful login redirect to home page showing 'Hello {username}!'(h1), on failed login show 'Login Failed' message 3) The username in home page should be rendered in Server Side 4) creat...
expressjs
task-9
2025-05-12T00:00:00
moderate
1) Create register page with route '/register' with form (.register-form) containing: username (input.username), password (input.password), confirm password input (input.confirm-password), and submit button (.register-button) 2) Show error messages in .error-message div for validation failures, error text is: 'Password...
expressjs
task-10
2025-05-12T00:00:00
moderate
1) Render STATIC page /profile/:username to display the user profile with UI: h1.profile-username, .profile-coin. 2) Users can only visit their own profile, and Admins can visit the profiles of all people. If the privilege is violated, redirect to the /login page. 3) If User not found, shows User not found 4) Create cs...
expressjs
task-11
2025-05-12T00:00:00
challenging
1) Add a component in public/components/HeaderUserMenu.js: if not logged in, display a button (.header-go-login) that navigates to /login; if logged in, display the username (.header-username). 2) If user is logged in, when the .header-username is hovered, show a dropdown menu with: a button (.header-logout-btn) for lo...
expressjs
task-12
2025-05-12T00:00:00
challenging
1) Add Recharge Button (.recharge-button) in Profile page, button is only visible when the user of the profile is current user. 2) When Recharge Button clicked, recharge 1000 coin 3) Create css to beautify UI. Constraint: DO NOT use a third-party UI library. Keep profile page STATIC.
expressjs
task-13
2025-05-12T00:00:00
challenging
1) Create Admin Portal for admin role with routes '/admin/products' and '/admin/users'. 2) Every products and users are wrapped in table row with IDs #admin_product_{product_id} and #admin_user_{username} respectively. Display the full information of products and users in table rows 2) In Home page, add .home-go-produc...
expressjs
task-14
2025-05-12T00:00:00
challenging
1) Implement Wishlist feature where users can add products to their wishlist using button (.add-to-wishlist) in the product detail page. 2) Create a separate Wishlist page at route '/wishlist' displaying all products the user has added, structured as <div className='wishlist-item' id='wishlist_item_{product_id}'><img c...
expressjs
task-15
2025-05-12T00:00:00
challenging
1) In public/components/Cart.js, create an appealing cart button .cart-button that shows the number of items in the cart. When clicked, it shows a popover of all items in the cart. Wrap Product Title, image, quantity (.cart-item-quantity), remove button (.cart-item-remove) in #cart_item_{product_id} 2) In the Detail Pa...
expressjs
task-16
2025-05-12T00:00:00
challenging
1) Add a button .place-order-in-cart in the Popover of Shopping Cart; when clicked, create an order with 'Pending payment' status without paying or decreasing product quantity, and redirect to /order/:order-id; 2) When Order created, clear Cart 3) Add .header-go-to-my-orders to the dropdown in HeaderUserMenu.js; when c...
expressjs
task-17
2025-05-12T00:00:00
challenging
1) Add the .pay-my-order button to /order/:order-id; Button is visible when the status is 'Pending payment' 2) When .pay-my-order is clicked, the status of the order becomes 'Finished', and the Coin is paid by current user; 3) Decrease product quantity; 4) If payment fails, update the order status to 'Failed'. 5) Creat...
expressjs
task-18
2025-05-12T00:00:00
challenging
1) Add a .refund-button in Order Detail Page when order is paid; 2) When .refund-button is clicked, change the order status to 'Refund Reviewing'; 3) Create /admin/orders for admin to manage all orders, with a unique identifier #admin_order_{order_id}; 4) Add a .pass-refund-review-button in #admin_order_{order_id} if t...
expressjs
task-19
2025-05-12T00:00:00
challenging
1) Implement a Comment and Rating System where users can leave feedback on products only after completing a payment transaction. Store comments in DB. 2) On the product detail page, display the average rating of the product at the top, using classNames: .product-average-rating (with number inside). 3) When a user has p...
expressjs
task-20
2025-05-12T00:00:00
challenging
1) Implement an invitation system where current users can view their unique .referral-code (with pure referral-code as innerText) on their profile page, explaining the invitation rule under .referral-code: 'When a new user registers through your referral code, you will earn $888, and an additional $1888 when they pay f...
expressjs
task-1
2025-05-12T00:00:00
easy
1) Create home page (client/pages/home.tsx) with route '/' showing '🛍️🛍️🛍️ Welcome to Shopping Mart !' in h1 tag 2) Create login page (client/pages/login.tsx) at route '/login' showing '💡 Please Login First' in h1 tag 3) Use React Router (v7.5.0) to render pages (configure in client/routes.tsx)
fastify-react
task-2
2025-05-12T00:00:00
easy
1) Every page in this app will have a appealing header showing '🛍️ WebBench Shopping Mart', and a beautiful footer showing 'Copyright: Web Bench' 2) Add class 'site-header' to header and 'site-footer' to footer 3) Create client/root.tsx to implement this feature 4) Header is fixed at the page top; footer is fixed at t...
fastify-react
task-3
2025-05-12T00:00:00
easy
1) If Page Not Found, shows 'Oops! Looks like you have wandered off the beaten path.' in h1 tag 2) Add button(.not-found-go-to-home) to navigate to '/' 3) When click '🛍️ WebBench Shopping Mart' in header, navigate to '/' 4) Create CSS to beautify UI 5) Hint: Use '*' Route to handle 404 errors by React Router v7.5.0
fastify-react
task-4
2025-05-12T00:00:00
easy
1) Create libs/db.ts to export a new sqlite3.Database(process.env.DB_HOST!) by node-sqlite3 2) Add libs/setup.sql to create tables for products (id, name, price, image, description, quantity) 3) Create route POST /api/products to insert product data (Request Body follow {'name': 'SKU', 'price': 1234, image: 'xxx', desc...
fastify-react
task-5
2025-05-12T00:00:00
easy
1) Add page with path '/products' to display all products (image, name, price), use React Router v7.5.0 to add this route 2) UI Structure For Product Cards: <div class='product-card' id='product_card_{{id}}'><img class='product-image' src={{image}}/><div class='product-name'>{{name}}</div><div class='product-price'>{{p...
fastify-react
task-6
2025-05-12T00:00:00
moderate
1) Add product detail page with path '/products/:product_id' 2) Add classNames for UI in Detail Page: .product-card, .product-image, .product-name, .product-price, .product_quantity, .product-description 3) In /products page, When .product-card clicked, goto related product detail page 4) Create CSS to beautify UI 5) I...
fastify-react
task-7
2025-05-12T00:00:00
moderate
1) In libs/setup.sql, Create User Table, setup User Table with two initial users: - username: admin, password: 123456, role: admin, coin: 0 - username: user, password: 123456, role: user, coin: 1000 2) Create route POST /api/auth to login into system with example payload {username: 'xxx', password: 'xxx'} and exa...
fastify-react
task-8
2025-05-12T00:00:00
moderate
1) Create login form (.login-form) with username input (.username), password input (.password), and submit button (.login-btn) 2) On successful login redirect to home page showing 'Hello {username}!'(h1), on failed login show 'Login Failed' message 3) Add client/context/auth.tsx to share current authenticated user info...
fastify-react
task-9
2025-05-12T00:00:00
moderate
1) Create register page with route '/register' with form (.register-form) containing: - username (input.username) - password (input.password) - confirm password input (input.confirm-password) - submit button (.register-button) 2) Show error messages in .error-message div for validation failures, error text ...
fastify-react
task-10
2025-05-12T00:00:00
moderate
1) Render page /profile/:username to display the user profile with UI: - h1.profile-username - .profile-coin 2) Users can only visit their own profile, and Admins can visit the profiles of all people 3) If the privilege is violated, redirect to the /login page 4) If User not found, shows User not found 5) Create ...
fastify-react
task-11
2025-05-12T00:00:00
challenging
1) Add a client-side component in client/components/HeaderUserMenu.tsx: - If not logged in, display a button (.header-go-login) that navigates to /login - If logged in, display the username (.header-username) 2) If user is logged in, when the .header-username is hovered, show a dropdown menu with: - A button (...
fastify-react
task-12
2025-05-12T00:00:00
challenging
1) Add Recharge Button (.recharge-button) in Profile page 2) Button is only visible when the user of the profile is current user 3) When Recharge Button clicked, recharge 1000 coin 4) Create CSS to beautify UI 5) DO NOT use a third-party UI library
fastify-react
task-13
2025-05-12T00:00:00
challenging
1) Create Admin Portal for admin role with routes '/admin/products' and '/admin/users' 2) Every products and users are wrapped in table row with IDs #admin_product_{product_id} and #admin_user_{username} respectively 3) Display the full information of products and users in table rows 4) In Home page, add .home-go-produ...
fastify-react
task-14
2025-05-12T00:00:00
challenging
1) Implement Wishlist feature where users can add products to their wishlist using button (.add-to-wishlist) in the product detail page 2) Create a separate Wishlist page at route '/wishlist' displaying all products the user has added 3) Structure wishlist items as <div class='wishlist-item' id='wishlist_item_{product_...
fastify-react
task-15
2025-05-12T00:00:00
challenging
1) In client/components/Cart.tsx, create an appealing cart button .cart-button that shows the number of items in the cart 2) When clicked, it shows a popover of all items in the cart 3) Wrap Product Title, image, quantity (.cart-item-quantity), remove button (.cart-item-remove) in #cart_item_{product_id} 4) In the Deta...
fastify-react
task-16
2025-05-12T00:00:00
challenging
1) Add a button .place-order-in-cart in the Popover of Shopping Cart 2) When clicked, create an order with 'Pending payment' status without paying or decreasing product quantity 3) When Order created, redirect to /order/:order-id 4) When Order created, clear Cart 5) Add .header-go-to-my-orders to the dropdown in Header...
fastify-react
task-17
2025-05-12T00:00:00
challenging
1) Add the .pay-my-order button to /order/:order-id 2) Button is visible when the status is 'Pending payment' 3) When .pay-my-order is clicked: - The status of the order becomes 'Finished' - The Coin is paid from current user - Decrease product quantity 4) If payment fails, update the order status to 'Failed' ...
fastify-react
task-18
2025-05-12T00:00:00
challenging
1) Add a .refund-button in Order Detail Page when order is paid 2) When .refund-button is clicked, change the order status to 'Refund Reviewing' 3) Create /admin/orders for admin to manage all orders, with a unique identifier #admin_order_{order_id} 4) Add a .pass-refund-review-button in #admin_order_{order_id} if the ...
fastify-react
task-19
2025-05-12T00:00:00
challenging
1) Implement a Comment and Rating System where users can leave feedback on products only after completing a payment transaction 2) Store comments in DB 3) On the product detail page, display the average rating of the product at the top, using classNames: - .product-average-rating (with number inside) 4) When a user ...
fastify-react
task-20
2025-05-12T00:00:00
challenging
1) Implement an invitation system where current users can view their unique .referral-code (with pure referral-code as innerText) on their profile page 2) Explain the invitation rule under .referral-code: 'When a new user registers through your referral code, you will earn $888, and an additional $1888 when they pay fo...
fastify-react
task-1
2025-05-12T00:00:00
easy
1) Create home page (views/home.ejs) with route '/' showing '🛍️🛍️🛍️ Welcome to Shopping Mart !' in h1 tag 2) Create login page (views/login.ejs) at route '/login' showing '💡 Please Login First' in h1 tag 3) Use ejs template engine with Fastify's point-of-view plugin to render pages 4) Create Home Plugin in plugins/...
fastify
task-2
2025-05-12T00:00:00
easy
1) Every page in this app will have a appealing header showing '🛍️ WebBench Shopping Mart', and a beautiful footer showing 'Copyright: Web Bench' 2) Add class 'site-header' to header and 'site-footer' to footer 3) Create views/layout.ejs to implement this feature 4) Header is fixed at the page top; footer is fixed at ...
fastify
task-3
2025-05-12T00:00:00
easy
1) If Page Not Found, shows 'Oops! Looks like you have wandered off the beaten path.' in h1 tag 2) Add button(.not-found-go-to-home) to navigate to '/' 3) When click '🛍️ WebBench Shopping Mart' in header, navigate to '/' 4) Create CSS to beautify UI 5) Hint: Use Fastify's setNotFoundHandler to handle 404 errors
fastify
task-4
2025-05-12T00:00:00
easy
1) Create libs/db.ts to export a new sqlite3.Database(process.env.DB_HOST!) by node-sqlite3 2) Add libs/setup.sql to create tables for products (id, name, price, image, description, quantity) 3) Create route POST /api/products to insert product data (Request Body follow {'name': 'SKU', 'price': 1234, image: 'xxx', desc...
fastify
task-5
2025-05-12T00:00:00
easy
1) Add page with path '/products' to display all products (image, name, price) 2) UI Structure For Product Cards: <div class='product-card' id='product_card_{{id}}'><img class='product-image' src={{image}}/><div class='product-name'>{{name}}</div><div class='product-price'>{{price}}</div></div> 3) Add a button (.home-g...
fastify
task-6
2025-05-12T00:00:00
moderate
1) Add product detail page with path '/products/:product_id' 2) Add classNames for UI in Detail Page: .product-card, .product-image, .product-name, .product-price, .product_quantity, .product-description 3) In /products page, When .product-card clicked, goto related product detail page 4) Create CSS to beautify UI 5) I...
fastify
task-7
2025-05-12T00:00:00
moderate
1) In libs/setup.sql, Create User Table, setup User Table with two initial users: - username: admin, password: 123456, role: admin, coin: 0 - username: user, password: 123456, role: user, coin: 1000 2) Create route POST /api/auth to login into system with example payload {username: 'xxx', password: 'xxx'} and exa...
fastify
task-8
2025-05-12T00:00:00
moderate
1) Create login form (.login-form) with username input (.username), password input (.password), and submit button (.login-btn) 2) On successful login redirect to home page showing 'Hello {username}!'(h1), on failed login show 'Login Failed' message 3) The username in home page should be rendered in Server Side 4) Creat...
fastify
task-9
2025-05-12T00:00:00
moderate
1) Create register page with route '/register' with form (.register-form) containing: - username (input.username) - password (input.password) - confirm password input (input.confirm-password) - submit button (.register-button) 2) Show error messages in .error-message div for validation failures, error text ...
fastify
task-10
2025-05-12T00:00:00
moderate
1) Render page /profile/:username to display the user profile with UI: - h1.profile-username - .profile-coin 2) Users can only visit their own profile, and Admins can visit the profiles of all people 3) If the privilege is violated, redirect to the /login page 4) If User not found, shows User not found 5) Create ...
fastify
task-11
2025-05-12T00:00:00
challenging
1) Add a client-side component in public/components/HeaderUserMenu.js: - If not logged in, display a button (.header-go-login) that navigates to /login - If logged in, display the username (.header-username) 2) If user is logged in, when the .header-username is hovered, show a dropdown menu with: - A button (....
fastify
task-12
2025-05-12T00:00:00
challenging
1) Add Recharge Button (.recharge-button) in Profile page 2) Button is only visible when the user of the profile is current user 3) When Recharge Button clicked, recharge 1000 coin 4) Create CSS to beautify UI 5) DO NOT use a third-party UI library
fastify
task-13
2025-05-12T00:00:00
challenging
1) Create Admin Portal for admin role with routes '/admin/products' and '/admin/users' 2) Every products and users are wrapped in table row with IDs #admin_product_{product_id} and #admin_user_{username} respectively 3) Display the full information of products and users in table rows 4) In Home page, add .home-go-produ...
fastify
task-14
2025-05-12T00:00:00
challenging
1) Implement Wishlist feature where users can add products to their wishlist using button (.add-to-wishlist) in the product detail page 2) Create a separate Wishlist page at route '/wishlist' displaying all products the user has added 3) Structure wishlist items as <div class='wishlist-item' id='wishlist_item_{product_...
fastify
task-15
2025-05-12T00:00:00
challenging
1) In public/components/Cart.js, create an appealing cart button .cart-button that shows the number of items in the cart 2) When clicked, it shows a popover of all items in the cart 3) Wrap Product Title, image, quantity (.cart-item-quantity), remove button (.cart-item-remove) in #cart_item_{product_id} 4) In the Detai...
fastify
task-16
2025-05-12T00:00:00
challenging
1) Add a button .place-order-in-cart in the Popover of Shopping Cart 2) When clicked, create an order with 'Pending payment' status without paying or decreasing product quantity 3) When Order created, redirect to /order/:order-id 4) When Order created, clear Cart 5) Add .header-go-to-my-orders to the dropdown in Header...
fastify
task-17
2025-05-12T00:00:00
challenging
1) Add the .pay-my-order button to /order/:order-id 2) Button is visible when the status is 'Pending payment' 3) When .pay-my-order is clicked: - The status of the order becomes 'Finished' - The Coin is paid from current user - Decrease product quantity 4) If payment fails, update the order status to 'Failed' ...
fastify
task-18
2025-05-12T00:00:00
challenging
1) Add a .refund-button in Order Detail Page when order is paid 2) When .refund-button is clicked, change the order status to 'Refund Reviewing' 3) Create /admin/orders for admin to manage all orders, with a unique identifier #admin_order_{order_id} 4) Add a .pass-refund-review-button in #admin_order_{order_id} if the ...
fastify
task-19
2025-05-12T00:00:00
challenging
1) Implement a Comment and Rating System where users can leave feedback on products only after completing a payment transaction 2) Store comments in DB 3) On the product detail page, display the average rating of the product at the top, using classNames: - .product-average-rating (with number inside) 4) When a user ...
fastify
task-20
2025-05-12T00:00:00
challenging
1) Implement an invitation system where current users can view their unique .referral-code (with pure referral-code as innerText) on their profile page 2) Explain the invitation rule under .referral-code: 'When a new user registers through your referral code, you will earn $888, and an additional $1888 when they pay fo...
fastify