How We Migrated an API from Express to NestJS in Two Weeks (with AI Assistance)
October 13, 2025
•8 min read

This case study shares our experience helping Overnght.com migrate an API built with Node.js, Express, and Prisma to NestJS with TypeORM and Swagger in under two weeks, leveraging Cursor and its AI features.
This wasn't just a technology swap, it was an experiment in how AI can accelerate development while highlighting the importance of human oversight.
The Starting Point
The original API supported a streaming platform. While it didn't handle massive amounts of data, it had to withstand high concurrent user spikes during live events.
The codebase, however, was increasingly unmaintainable:
- It lacked adherence to best practices.
- Documentation was minimal or non-existent.
- There were no tests.
Adding new features or making changes carried significant risk, making a complete rewrite the most practical option.
The Challenge
Although there was no formal deadline, the objective was to complete the migration as quickly as possible to enable new functionality.
Key challenges included:
- Migrating to NestJS to achieve a modular and scalable architecture.
- Switching to TypeORM while replicating the exact database schema generated by Prisma.
- Integrating Swagger for live API documentation from day one.
- Performing all this as a single developer.
We also needed to ensure that the new codebase was clean, consistent, and maintainable.
Our Approach
We decided to start from scratch, rather than adapting the existing code. This allowed us to:
- Apply NestJS conventions from the ground up.
- Keep modules, services, and controllers clearly organized.
- Integrate Swagger as part of the development workflow.
The major accelerator was Cursor with AI:
- It generated boilerplate for modules, entities, and controllers.
- Helped migrate models and endpoints quickly.
- Provided different solutions for the same problem, which sometimes caused inconsistencies.
To handle this, we had to:
- Establish clear implementation standards.
- Refactor AI-generated code to maintain consistency and readability.
AI acted as a co-pilot: speeding up development while still requiring careful supervision and guidance.
Results
In less than two weeks, the API was fully migrated:
- NestJS + TypeORM provided a solid, maintainable foundation.
- Swagger ensured documentation was live and always up-to-date.
- The modular architecture made the API scalable and ready for new features.
Compared to the original project, the new API was understandable, extensible, and reliable, transforming our ability to maintain and enhance it.
Key Learnings
The success of using AI depends almost entirely on how specific we are in our requests. Clear instructions, examples, and defined conventions make the AI much more effective.
Despite AI assistance, the final quality of the code relies heavily on human oversight. Reviewing, refactoring, and enforcing standards is unavoidable.
Using AI often requires significant rework to align its output with the desired architecture and coding style. AI can accelerate repetitive tasks, but it cannot replace critical thinking or decision-making.
Starting from scratch allowed us to enforce best practices from day one, but even then, continuous iteration and corrections were necessary.
Treat AI as a co-pilot, not a replacement: its speed is powerful, but the human role is essential to maintain consistency, readability, and maintainability.
Final Thoughts
This project demonstrated that combining a robust framework like NestJS with AI as a development co-pilot can deliver complete, high-quality solutions quickly; even with a small team.
The key takeaway: AI accelerates development, but decision-making, standards, and refinement remain human responsibilities.
Ready to Migrate Your API?
Let's discuss how Nimble can help you modernize your API architecture with best practices and AI-assisted development.