Instruction file imported from Evols/foundation (
.cursor/rules/backend.mdc). Copyright stays with the author.
use DDD-like philosophy but stay pragmatic business logic is at the center of the code. put as much logic in there as possible. it can interact with the database directly, using drizzle services interact with the outside world. uses the strategy pattern to use actual services in production and fake ones in unit testing. try to put only what is needed to in there, since business logic should be in the dedicated folder a presentation layer is the API. try to put only what is needed to in there, since business logic should be in the dedicated folder
the backend relies heavily on unit testing business logic tests are alongside the code they are testing in application_backend/src/business_logic. those should use fake services, so they can run very very fast services tests are alongside the code they are testing in application_backend/src/services integration testing is separated in application_backend/src/tests
if you use json in the database, always validate with zod everything that goes in the database
commands can be invoked manually to setup the application_backend