Architecture Choices
Our guiding principle to developing software.
This means
- keep code base small
- prefer flexibility in tooling
- type safety
Here you will find a breakdown of our architecture choices in the context of these pricinples
Framework
NextJS
Fullstack. So no need to maintain separate projects for backend and frontend. Makes development faster.
Popularity. Widespread usage means most integrations are supported.
Design Library
Shadcn
Composable. Make it easy to customize.
Radix Based. Smaller bundle size for the app.
Large Component Library. Most control components like datepicker are available out of the box.
Packages
NextAuth
Handle authentication
React Query
API fetching for datatables (ie. order listing).
Zod
Validation and Type definitions in one place.
React Table
Datatable display.
Database
MongoDB
We prefer MongoDB when operation requirement is evloving fast (ie frequent changes in data structure)
Postgres
Operational requirement is static and ACID is required.
MongoDB ORM
Mongoose
Default choice.
Postgres ORM
Drizzle
Default choice.
Primsa
If there is client requirement.
Storage
Amazon S3
Files and images served to a single region. S3 for storage and a Nginx cache on front.
Cloudflare
Multi-region or video files.
Application Deployment
Docker + VPS
Best for projects that focuses on a single geographical region.
This allows for predictable cost.
Serverless/PaaS
Best for multi-region projects. Tradeoff high development speed for server cost. You can always optimize for server cost later when the development has matured.
Also works best for projects that charges client on a usage basis.
Mailgun
Simple and cost effective.