PromptCoder(mini example): Node.js + TypeScript + Express + React

Опубликовано: 16 Май 2026
на канале: Prompt Coder
10
0

Welcome to the PromptCoder channel — a platform where development turns into a dialogue.

Stack: Node.js + TypeScript + Express + React

1. Create a TypeScript function that takes an array of numbers and returns their sum.
2. Add type checking: if the array contains a non-number value, throw an exception.
3. Refactor the function to be asynchronous, simulating an external API or database call.
4. Write a unit test for this function using Jest.
5. Create an Express POST /sum endpoint that calls this function.
6. Add OpenAPI (Swagger) documentation using swagger-jsdoc or express-openapi-validator.
7. Add input validation using Zod or Joi: the array must not be empty.
8. Save the request result in MongoDB or PostgreSQL, in a requests table/collection.
9. Create a GET /logs endpoint that returns the last 10 records.
10. Add middleware for logging and enable CORS support.
11. Build a React UI: input field for numbers + submit button.
12. Display the result or error message in the UI.
13. Add a toggle between sync and async call on the client side.
14. Add a language selector: JavaScript / TypeScript / Rust.
15. Implement the same function in Rust using Actix Web.
16. Create a Vue component that calls the API (alternative to React).
17. Generate a bash script that uses curl to call the API with a number array.
18. Add i18n support: translate "Enter numbers to sum" into 3 languages.
19. Generate a README.md that explains the whole project: setup, API, UI, usage.

→ A more advanced example (multi-step + Rust integration)
→ And then: "How to import and edit existing projects with AI"