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
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'.
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('square', math.square(2))`.
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 call `log('cube1', math.default(2)); log('cube2', cube(2))`.
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('rectangle1', new Rectangle(2, 3).area)` in 'index.js'.
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'.
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'.
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'.
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.
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.
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'.
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'.
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'.
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'.
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'.
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'.
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'.
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'.
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'.
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'.
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'.
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.
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.
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.
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.
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 be inserted at the cursor's current position or replace the selected text in the editor. If the editor is not focused, insert the content at the end of the editor. - Considering that users may need to delete newly inserted text, the new text should be selected after insertion.
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 and closing parentheses, ensuring that the user can continue typing without needing to manually adjust the cursor.
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. ## `tokenize` function implemention detail `tokenize` receive a `string` as input, and return `Token[]` as output. ### Constraints Ignore all tab、whitespaces、newlines ### Token Types I'll give you the TypeScript type definitions for your convenience. ```ts type Token = Identifier | Operator | LeftParen | RightParen type Identifier = { type: 'identifier'; from: number; to: number; value: string; } type Operator = { type: 'operator'; from: number; to: number; value: 'AND' | 'OR'; } type LeftParen = { type: 'lparen'; from: number; to: number; } type RightParen = { type: 'rparen'; from: number; to: number; } ``` ### Examples Besides these, here are some examples for you to better understand the tokenize result. <examples> <example source="" description="empty source"> ```js [] ``` </example> <example source="foo" description="Single identifier"> ```js [ { type: 'identifier', from: 0, to: 3, value: 'foo' } ] ``` </example> <example source="foo AND bar" description="Use AND with two identifiers"> ```js [ { type: 'identifier', from: 0, to: 3, value: 'foo' }, { type: 'operator', from: 4, to: 7, value: 'AND' }, { type: 'identifier', from: 8, to: 11, value: 'bar' } ] ``` </example> <example source="foo OR (bar OR baz)" description="Compound expression with parens"> ```js [ { type: 'identifier', from: 0, to: 3, value: 'foo' }, { type: 'operator', from: 4, to: 6, value: 'OR' }, { type: 'lparen', from: 7, to: 8, }, { type: 'identifier', from: 8, to: 11, value: 'bar' }, { type: 'operator', from: 12, to: 14, value: 'OR' }, { type: 'identifier', from: 15, to: 18, value: 'baz' }, { type: 'rparen', from: 18, to: 19, }, ] ``` </example> </examples>
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 Document To complete the target, let's dig it deeper. ## `parse` function implemention detail `parse` receive a `string` as input, and return `Program` as output. ### Constraints #### Syntax Rules - Identifier: A string composed of letters (a-z, A-Z), digits (0-9), and underscores, but it cannot start with a digit. - LogicalExpression: Includes AND and OR. These operators are used to connect expressions and must be in uppercase. - Parentheses: Used to change the order of operations or to group expressions, including left parenthesis ( and right parenthesis ). #### Precedence and Associativity - The AND and OR operators are left-associative, meaning they are evaluated from left to right in the absence of parentheses. - The precedence of the AND operator is higher than that of OR. ### Node Types I'll give you the TypeScript type definitions for your convenience. ```ts type Program = { type: 'Program'; children: SyntaxNode[]; } type Identifier = { type: 'Identifier'; name: string; } type LogicalExpression = { type: 'LogicalExpression'; operator: 'AND' | 'OR'; left: SyntaxNode; right: SyntaxNode; } type SyntaxNode = Identifier | LogicalExpression ``` ### Examples Besides these, here are some examples for you to better understand the AST structure. <examples> <example source="" description="Empty source"> ```js { type: 'Program', body: [] } ``` </example> <example source="foo" description="Single identifier"> ```js { type: 'Program', body: [ { type: 'Identifier', name: 'foo' } ] } ``` </example> <example source="foo AND bar" description="Use AND with two identifiers"> ```js { type: 'Program', body: [ { type: 'LogicalExpression', operator: 'AND', left: { type: 'Identifier', name: 'foo' }, right: { type: 'Identifier', name: 'bar' } } ] } ``` </example> <example source="foo OR bar AND baz" description="Precedence of AND is higher than OR"> ```js { type: 'Program', body: [ { type: 'LogicalExpression', operator: 'OR', left: { type: 'Identifier', name: 'foo' }, right: { type: 'LogicalExpression', operator: 'AND', left: { type: 'Identifier', name: 'bar' }, right: { type: 'Identifier', name: 'baz' } } } ] } ``` </example> <example source="foo OR bar OR baz" description="And/OR operators are both left associative"> ```js { type: 'Program', body: [ { type: 'LogicalExpression', operator: 'OR', left: { type: 'LogicalExpression', operator: 'OR', left: { type: 'Identifier', name: 'foo' }, right: { type: 'Identifier', name: 'bar' } }, right: { type: 'Identifier', name: 'baz' } } ] } ``` </example> <example source="foo OR (bar OR baz)" description="Parentheses can change default associativity"> ```js { type: 'Program', body: [ { type: 'LogicalExpression', operator: 'OR', left: { type: 'Identifier', name: 'foo' }, right: { type: 'LogicalExpression', operator: 'OR', left: { type: 'Identifier', name: 'bar' }, right: { type: 'Identifier', name: 'baz' } } } ] } ``` </example> <example source=" foo OR ( bar OR baz ) " description="Any number of whitespaces are allowed, and does not affect the result"> ```js { type: 'Program', body: [ { type: 'LogicalExpression', operator: 'OR', left: { type: 'Identifier', name: 'foo' }, right: { type: 'LogicalExpression', operator: 'OR', left: { type: 'Identifier', name: 'bar' }, right: { type: 'Identifier', name: 'baz' } } } ] } ``` </example> </examples>
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; } ```
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: text color is #00ff00
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 LogicalExpression AST node to save the operator range, type of operatorRange is { from: number; to: number } - add `source` field for Program AST node, tracking the original source code. 2. Implement a function named `lint`, and export it in `lint.js` with ESM. # Constraints DO NOT modify files other than `parser.js` and `lint.js`. # Detail of `lint` `lint` receives Program(return type of `parse`) as input, returns Diagnostic[] as output. Type definition of Program is ```ts interface Range { from: number; to: number; } type Program = { type: 'Program'; source: string; children: SyntaxNode[]; range: Range; } type Identifier = { type: 'Identifier'; name: string; range: Range; } type LogicalExpression = { type: 'LogicalExpression'; operator: string; operatorRange: Range; left: SyntaxNode; right: SyntaxNode; range: Range; } type SyntaxNode = Identifier | LogicalExpression ``` Type definition of Diagnostic is ```ts type Diagnostic = { range: { from: number; to: number; }; level: 'error' | 'warning'; message: string; } ``` ## Lint Rules <rules> <rule level="error" description="AND and OR should be uppercase. All misspells should be reported" /> </rules> ## Examples <examples> <example description="No error found"> <input>foo AND bar</input> <diagnostics> [] </diagnostics> </example> <example description="Find two errors"> <input>foo and bar or baz</input> <diagnostics> [ { range: { from: 4, to: 7, }, level: 'error', message: 'Operator should be uppercase. Use AND instead of and.' }, { range: { from: 12, to: 14, }, level: 'error', message: 'Operator should be uppercase. Use OR instead of or.' } ] </diagnostics> </example> </examples>
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.
task-13
2025-05-12T00:00:00
easy
Add `data-diagnostic-message` attribute for the wrapper element of error range showing the error message.
task-14
2025-05-12T00:00:00
easy
Show diagnostic message in tooltip when user hover on any diagnostic in 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 "Syntax Error" has a red background.
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 - fooooo: false - bar: true - barrrr: false - Nonexistent variables should be considered as `false` when doing evaluating. # Examples <examples> <example> <input description="empty input"></input> <output>false</output> <example> <example> <input>foo</input> <output>true</output> <example> <example> <input>foo a</input> <output description="return null because there is a syntax error">null</output> <example> <example> <input>foo AND</input> <output description="return null because there is a syntax error">null</output> <example> <example> <input>foo and bar</input> <output description="return null because 'and' is not a leagal operator">null</output> </example> <example> <input>foo AND bar</input> <output>true</output> </example> <example> <input>x AND bar</input> <output>false</output> </example> <example> <input>foo AND barrrr</input> <output>false</output> </example> <example> <input>foo OR barrrr</input> <output>true</output> </example> </examples>
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". - If the evaluate result is false, display "false".
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 editor to avoid duplicate text after inserting - Syntax highlighting still works after inserting completion Here are some examples: - When user input f, suggest `foo` and `fooooo` - When user input fo, suggest `foo` and `fooooo` - When user input foa, no suggestion - When user input a, suggest AND - When user input aN, suggest AND - When user input aNb, no suggestion
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 default - Selected completion item should have a different background color from unselected one. - Loop from the last item back to the first (and vice versa) when navigating beyond the end (or beginning) of the list.
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
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
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 fixed at the page bottom; main(children) occupies the remaining space. 5) create public/css/style.css file to beautify CSS.
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.
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: 'xxx', quantity: 100}). Return { success: true, data: {'id': 'xxxx' } } when inserted successfully 4) GET /api/products to fetch all products. Return { success: true, products: [{'id':'xxx', 'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}] } when fetched successfully. 5) all apis generated in this tasks should be placed in routes/products/api.js and used by app entry(index.js) as Express Router
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 a button (.home-go-products-link) in home page to navigate to '/products' 4) .product-card is wrapped in .product-list. 5) create css to beautify UI.
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 product is not found, show 'Product Not Found' in the product detail page.
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 { success: true } 3) GET /api/auth to get the full information of current user, example response {'username': 'xxx', 'role': 'xxx', 'coin': xxx}, if not login, return 401 status 4) use 'jose' to generate JWT in cookie by key: 'TOKEN', the payload of JWT follow example{'username': 'xxx', 'role': 'xxx'}, secret is 'WEBBENCH-SECRET', use default HS256 algorithm and expired in 1 hour.
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) create css to beautify UI.
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: 'Passwords must match', 'Username already exists' 3) Redirect to home page and auto login when register successful 4) Add .login-link, clicked to /login 5) Add a .register-link in /login page, clicked to /register 6) The initial coin for new user is 1000 7) create CSS file to beautify CSS.
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 css to beautify UI. DO NOT use a third-party UI library.
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 logging out, and a button (.header-go-user-profile) for navigating to the current user's profile page. 3) Ensure that this component is displayed on the right side of the site header. 4) Create CSS to beautify UI. DO NOT use a third-party UI library.
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.
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-product-portal-link and .home-go-user-portal-link to navigate to respective portals. 3) For any route inside /admin, Redirect to /login if no privilege. 4) Create css to beautify UI.
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 className='wishlist-image' src='/'/><div className='wishlist-name'></div><div className='wishlist-price'></div></div>. 3) Add functionality to remove items from wishlist with button (.remove-from-wishlist). 4) Store wishlist items in the database 5) Add button (.home-go-wish-list) in home page to navigate to '/wishlist' 6) Create CSS file to beautify the Wishlist UI. Constraint: DO NOT use a third-party UI library.
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 Page, add an .add-to-cart-button. When clicked, add this product to the cart. 3) Store Cart Info in the DB for the current User. 4) Place Shopping Cart which can be seen in every page in the right-bottom of page 5) Create css to beautify UI. Constraint: DO NOT use a third-party UI library.
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 clicked, go to the Orders Page of the current user; Each order in my orders page should be displayed with id, status total price inside #my_order_${order_id}; and clicking on an order should jump to the order detail page at /order/:order-id; 4) In /order/:order-id, display the product title, images, price in tr#product_in_order_${product_id}; display the order price and order status. 5) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library.
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) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library.
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 order is under 'Refund Reviewing'; 5) When .pass-refund-review-button is clicked, update the order status to 'Refund Passed' and ensure that the Coin is refunded to the user's account. 6) In Home page, add .home-go-order-portal-link to navigate to /admin/orders. 7) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library.
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 purchased the product, display a form on the product page with classNames: .comment-form, .rate-input with five stars inside: (.rate-1-star, .rate-2-star, ... , .rate-5-star), , .comment-textarea, .comment-submit-button allowing users to submit their ratings and comments. 4) Display all comments in a list on the product page, with each comment showing the username, the rating, and the comment text, styled using classNames: .comment-item, .comment-username, .comment-rating(with number inside), .comment-text. 5) Every User can ONLY comment a product for one time 6) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library.
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 for their first order.' And the system should automatically credit the referring user with reward by this rule. 2) On the register page, add a .referral-code-input field allowing new users to input the referral code during registration. 3) Create CSS files to beautify the invitation system, ensuring a cohesive look. Constraint: DO NOT use a third-party UI library.
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)
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 the page bottom; main(children) occupies the remaining space 5) Create client/root.css file to beautify CSS 6) Hint: RootLayout can be configured by React Router v7.5.0 in client/routes.tsx
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
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', description: 'xxx', quantity: 100}) 4) Return { success: true, data: {'id': 'xxxx' } } when inserted successfully 5) Create route GET /api/products to fetch all products 6) Return { success: true, products: [{'id':'xxx', 'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}] } when fetched successfully 7) Create Fastify Product Plugin in plugins/product.ts to register these apis
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'>{{price}}</div></div> 3) Add a button (.home-go-products-link) in home page to navigate to '/products' 4) .product-card is wrapped in .product-list 5) Create CSS to beautify UI
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) If the product is not found, show 'Product Not Found' in the product detail page
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 example response { success: true } 3) Create route GET /api/auth to get the full information of current user, example response {'username': 'xxx', 'role': 'xxx', 'coin': xxx}, if not login, return 401 status 4) Use 'jose' to generate JWT in cookie by key: 'TOKEN', the payload of JWT follow example{'username': 'xxx', 'role': 'xxx'}, secret is 'WEBBENCH-SECRET', use default HS256 algorithm and expired in 1 hour 5) Use '@fastify/cookie' plugin to manage cookies
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 information in context 4) Create CSS to beautify UI
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 is: - 'Passwords must match' - 'Username already exists' 3) Redirect to home page and auto login when register successful 4) Add .login-link, clicked to /login 5) Add a .register-link in /login page, clicked to /register 6) The initial coin for new user is 1000 7) Create CSS file to beautify CSS
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 CSS to beautify UI 6) DO NOT use a third-party UI library
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 (.header-logout-btn) for logging out - A button (.header-go-user-profile) for navigating to the current user's profile page 3) Ensure that this component is displayed on the right side of the site header 4) Create CSS to beautify UI 5) DO NOT use a third-party UI library
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
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-product-portal-link and .home-go-user-portal-link to navigate to respective portals 5) For any route inside /admin, redirect to /login if no privilege using a Fastify hook or preHandler 6) Create CSS to beautify UI
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_id}'><img class='wishlist-image' src='/'/><div class='wishlist-name'></div><div class='wishlist-price'></div></div> 4) Add functionality to remove items from wishlist with button (.remove-from-wishlist) 5) Store wishlist items in the database 6) Add button (.home-go-wish-list) in home page to navigate to '/wishlist' 7) Create CSS file to beautify the Wishlist UI 8) DO NOT use a third-party UI library
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 Detail Page, add an .add-to-cart-button 5) When clicked, add this product to the cart 6) Store Cart Info in the DB for the current User 7) Place Shopping Cart which can be seen in every page in the right-bottom of page 8) Create CSS to beautify UI 9) DO NOT use a third-party UI library
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 HeaderUserMenu.ts, when clicked, go to the Orders Page of the current user 6) Each order in my orders page should be displayed with id, status total price inside #my_order_${order_id} 7) Clicking on an order should jump to the order detail page at /order/:order-id 8) In /order/:order-id, display the product title, images, price in tr#product_in_order_${product_id}, display the order price and order status 9) Create CSS files to beautify CSS 10) DO NOT use a third-party UI library
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' 5) Create CSS files to beautify CSS 6) DO NOT use a third-party UI library 7) Implement database transaction to ensure data integrity
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 order is under 'Refund Reviewing' 5) When .pass-refund-review-button is clicked: - Update the order status to 'Refund Passed' - Ensure that the Coin is refunded to the user's account 6) In Home page, add .home-go-order-portal-link to navigate to /admin/orders 7) Create CSS files to beautify CSS 8) DO NOT use a third-party UI library
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 has purchased the product, display a form on the product page with classNames: - .comment-form - .rate-input with five stars inside: (.rate-1-star, .rate-2-star, ... , .rate-5-star) - .comment-textarea - .comment-submit-button 5) Display all comments in a list on the product page, with each comment showing: - The username - The rating - The comment text 6) Style using classNames: - .comment-item - .comment-username - .comment-rating (with number inside) - .comment-text 7) Every User can ONLY comment a product for one time 8) Create CSS files to beautify CSS 9) DO NOT use a third-party UI library
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 for their first order.' 3) The system should automatically credit the referring user with reward by this rule 4) On the register page, add a .referral-code-input field allowing new users to input the referral code during registration 5) Create CSS files to beautify the invitation system, ensuring a cohesive look 6) DO NOT use a third-party UI library 7) Implement database transaction to ensure data integrity when processing referral rewards
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/home.ts to render this pages
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 the page bottom; main(children) occupies the remaining space 5) Create public/css/style.css file to beautify CSS 6) Hint: Layout can be configured by @fastify/view plugin, and in layout.ejs, <%- body %> is the content of the page
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
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', description: 'xxx', quantity: 100}) 4) Return { success: true, data: {'id': 'xxxx' } } when inserted successfully 5) Create route GET /api/products to fetch all products 6) Return { success: true, products: [{'id':'xxx', 'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}] } when fetched successfully 7) Create Product Plugin in plugins/product.ts to register these apis
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-go-products-link) in home page to navigate to '/products' 4) .product-card is wrapped in .product-list 5) Create CSS to beautify UI
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) If the product is not found, show 'Product Not Found' in the product detail page
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 example response { success: true } 3) Create route GET /api/auth to get the full information of current user, example response {'username': 'xxx', 'role': 'xxx', 'coin': xxx}, if not login, return 401 status 4) Use 'jose' to generate JWT in cookie by key: 'TOKEN', the payload of JWT follow example{'username': 'xxx', 'role': 'xxx'}, secret is 'WEBBENCH-SECRET', use default HS256 algorithm and expired in 1 hour 5) Use '@fastify/cookie' plugin to manage cookies
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) Create CSS to beautify UI
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 is: - 'Passwords must match' - 'Username already exists' 3) Redirect to home page and auto login when register successful 4) Add .login-link, clicked to /login 5) Add a .register-link in /login page, clicked to /register 6) The initial coin for new user is 1000 7) Create CSS file to beautify CSS 8) Use Fastify's schema validation for request validation
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 CSS to beautify UI 6) DO NOT use a third-party UI library
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 (.header-logout-btn) for logging out - A button (.header-go-user-profile) for navigating to the current user's profile page 3) Ensure that this component is displayed on the right side of the site header 4) Create CSS to beautify UI 5) DO NOT use a third-party UI library
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
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-product-portal-link and .home-go-user-portal-link to navigate to respective portals 5) For any route inside /admin, redirect to /login if no privilege using a Fastify hook or preHandler 6) Create CSS to beautify UI
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_id}'><img class='wishlist-image' src='/'/><div class='wishlist-name'></div><div class='wishlist-price'></div></div> 4) Add functionality to remove items from wishlist with button (.remove-from-wishlist) 5) Store wishlist items in the database 6) Add button (.home-go-wish-list) in home page to navigate to '/wishlist' 7) Create CSS file to beautify the Wishlist UI 8) DO NOT use a third-party UI library
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 Detail Page, add an .add-to-cart-button 5) When clicked, add this product to the cart 6) Store Cart Info in the DB for the current User 7) Place Shopping Cart which can be seen in every page in the right-bottom of page 8) Create CSS to beautify UI 9) DO NOT use a third-party UI library
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 HeaderUserMenu.ts, when clicked, go to the Orders Page of the current user 6) Each order in my orders page should be displayed with id, status total price inside #my_order_${order_id} 7) Clicking on an order should jump to the order detail page at /order/:order-id 8) In /order/:order-id, display the product title, images, price in tr#product_in_order_${product_id}, display the order price and order status 9) Create CSS files to beautify CSS 10) DO NOT use a third-party UI library
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' 5) Create CSS files to beautify CSS 6) DO NOT use a third-party UI library 7) Implement database transaction to ensure data integrity
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 order is under 'Refund Reviewing' 5) When .pass-refund-review-button is clicked: - Update the order status to 'Refund Passed' - Ensure that the Coin is refunded to the user's account 6) In Home page, add .home-go-order-portal-link to navigate to /admin/orders 7) Create CSS files to beautify CSS 8) DO NOT use a third-party UI library
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 has purchased the product, display a form on the product page with classNames: - .comment-form - .rate-input with five stars inside: (.rate-1-star, .rate-2-star, ... , .rate-5-star) - .comment-textarea - .comment-submit-button 5) Display all comments in a list on the product page, with each comment showing: - The username - The rating - The comment text 6) Style using classNames: - .comment-item - .comment-username - .comment-rating (with number inside) - .comment-text 7) Every User can ONLY comment a product for one time 8) Create CSS files to beautify CSS 9) DO NOT use a third-party UI library
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 for their first order.' 3) The system should automatically credit the referring user with reward by this rule 4) On the register page, add a .referral-code-input field allowing new users to input the referral code during registration 5) Create CSS files to beautify the invitation system, ensuring a cohesive look 6) DO NOT use a third-party library