The Guardian is an innovative open-source platform that streamlines the creation, management, and verification of digital environmental assets. It leverages a customizable Policy Workflow Engine and Web3 technology to ensure transparent and fraud-proof operations, making it a key tool for transforming sustainability practices and carbon markets.
Currently Guardian is built using Express, which has served us well but is showing limitations in performance and scalability as our user base grows. Express.js, while robust, doesn't fully leverage the capabilities of modern Node.js features. We need to migrate to a more performant framework to improve our application's speed, reduce latency, and better handle concurrent requests.
Requirements
Migrate the existing Express app to Fastify
Ensure all current routes and middleware are properly ported to Fastify equivalents
Implement proper error handling and logging in Fastify
Ensure all existing unit and integration tests pass after migration
Document any changes in API responses or behaviour (if any)
Definition of done
All Express code has been replaced with equivalent Fastify code
The application runs without errors and all features function as expected
Performance tests show improved response times and throughput compared to the Express version
All existing tests pass, and new tests have been added where necessary
Documentation has been updated to reflect the migration to Fastify
Acceptance criteria
[ ] All existing API endpoints return the same responses as before, with status codes and data structures unchanged
[ ] Request handling performance has improved according to tests
[ ] Memory usage has decreased or remained the same under equivalent load
[ ] No new bugs or regressions have been introduced as a result of the migration
[ ] All middleware, including authentication and error handling, works as expected
Problem description
Currently Guardian is built using Express, which has served us well but is showing limitations in performance and scalability as our user base grows. Express.js, while robust, doesn't fully leverage the capabilities of modern Node.js features. We need to migrate to a more performant framework to improve our application's speed, reduce latency, and better handle concurrent requests.
Requirements
Definition of done
Acceptance criteria