Posted on Jun 9 I made NestJS Backend Server simulator in my library nestia.You can build the backend server simulator by only one line command. nestia will analyze your server codes, and generate imitation codes validating and composing mock-up data. It can be used in frontend application, without real backend server interaction.Furthermore, nestia supports much more convenient and powerful features like below. With those features, you can get high productivity even gaining both high performance and easy development.p.s) Currently, frontend level backend server simulator is only possible, when the backend server be implemented by NestJS (+nestia). However, it would be possible in every backend server frameworks, soon.In nowadays, I've developed a NestJS backend server simulator in my library nestia.For reference, the simulator does not connect to remote backend server. It just imitates request data validation and response data construction, by itself. Therefore, frontend developers can start application development only with API interfaces, even if the backend server is not ready.Below is a piece of SDK (Software Development Kit) code, generated by nestia, supporting the simulation mode. AS you can see, the simulator be activated just by configuring IConnection.random value to be true. Otherwise, the SDK would connect to the remote backend server.Within framework of backend developers, they also do not need to compose mock-up data, either. Mock-up data composition would be automated by the simulator, and backend developers may focus on the business logic like API interface designs and main program developments.Like below example code, just define only API interfaces. Then, builds simulator and delivers to frontend developers. Then you backend developer can implement application at the same time with frontend developers in parallel.For referecen, nestia also can generate e2e test functions automatically. Therefore, if you've succeeded to determine API specs, you can concentrate only on the main program development.In traditional software development, frontend developers recognize backend server API spec by reading Swagger Documents or similar one like RestDocs. By the way, as frontend developers are not robots but humans, reading and re-writing API specs in frontend application is a very annoying and error-prone work.nestia also can generate Swagger Documents, and it is much evolved than traditional NestJS. However, I recommend NestJS backend developers to utilize SDK library much more, for frontend developersIn nestia case, it can generate SDK (Software Development Kit) library for frontend developers. As you can see from above example code, the SDK library is very simple and easy to use. Only import and function call statements are required. The SDK library will make frontend development much safer through type hints. NestJS backend server simulator also provided by the SDK library.By the way, how nestia generates the SDK library? The secret is on your source code. nestia reads your NestJS backend server code directly (especially controllers), and analyzes which API routes are provided, and which DTO types are being used.After these analyses, nestia writes fetch functios for each API routes, and import statemtns that are used in each controller classes. The SDK library is generated by such source code analyses and combininng fetch functions and import statements.The NestJS backend server simulator, it is just a little extension of such SDK library.By the way, in the previous #Summary section, I'd told that nestia is much easier than traditional NestJS. I'd told that when defining DTO schema, nestia needs only pure TypeScript type, but traditinal NestJS needs triple times duplicated definitions.Looking at below example DTO schema definitions, you may understand what I am saying.Looking at above example code, someone may ask me:"Hey Samchon, how to validate the IBbsArticle.IStore type?If a client requests with invalid data, is it possible to reject? As you know, TypeScript interface does not have any schema info in the runtime, and it is the reason why traditional NestJS has enforced developers to define triple times duplicated DTO schemas."However, my answer is "It is enougly possible". Also, even in this case, the secret is on your source code.When you compile your NestJS backend servere, nestia will analyze your source codes, and analyzes how DTO schemas are being composed. Reading your DTO schemas and traveling properties of them, nestia will generate validation and JSON serialization codes for each API routes.Looking at below compiled code, it is dedicatedly optimized for IBbsArticle.IStore type. It's the secret of nestia, which does not require triple times duplicated DTO schema definitions, but requires only pure TypeScript type. Also, such compile time optimization through source code analyzing is called, "AOT (Ahead of Time) compilation".For reference, such AOT compilation optimization is much light and faster than general logics accessing to each properties through for (const key in obj) statements like traditional NestJS. Measuring benchmark, it's 25,000 times faster.About this secret (static access vs dynamic access), I'll write another article later. This is related to v8 engine optimization, and I can sure that it would be much interesting than any other stories.If you've read my article carefully, you may understand how to simulate response data, by yourself. Yes, the response data also be composed by AOT compilation skill. Let's read the simulator (SDK) code again, then you can find that typia.random