For further development guidelines, refer to our documentation in /docs.
Note
- You’re encouraged to update documentation whenever you find gaps, issues, or outdated information.
- Our design is structured around anticipated future needs, prioritizing testability, modularity, and consistency. Since predictions are not always precise, the design will change as we continue to iterate and implement new features.
- If you find a better design approach, feel free to improve, rewrite or refactor it, but ensure the documentation stays aligned with the code.
Task is a command-line tool that automates and streamlines repetitive tasks, allowing you to run commands from any folder.
To view all available task commands, run:
task -lBefore starting the development server, ensure all dependencies are installed by running the following command in a nix shell:
task installOr we can install dependencies separately for frontend and backend
task backend:install
task frontend:installWe use different databases for each environment to ensure data integrity. We will apply migration to production database when PR is merged.
- Development and Testing: Dockerized PostgreSQL database, which will remove all data when it is down
- Production Environment and Frontend Development: PostgreSQL production database hosted on Supabase
To apply schema changes, follow these steps:
-
Update the Schema
Modify the/backend/entities/schema.tsfile. -
Start the Local Database
task db:up
-
Generate SQL
task db:generate
-
Apply Migration
task db:migrate
To start the development server:
-
Start the database:
Make sure to shut down any running PostgreSQL instances if you encounter error like "testuser does not exist."psql -h localhost -p 5432 -U testuser testdb
task db:up
-
Start the backend:
task backend:dev
-
Shut down the database when done:
task db:down
-
Start the local Docker database:
task db:up
-
Migrate the database schema:
task db:migrate
-
Start the local drizzle studio:
task db:studio
To run the backend tests, simply use the following command:
task testTo generate the OpenAPI specification for API documentation, do:
-
Update the API documentation Modify the
/openapi.ymlfile. -
Generate New Schema
task generate
Start the backend development server at "/" route and see latest changes.
We have a commit hook that automatically formats the code and fixes any linting issues when you commit. However, if you prefer to do it manually or want to see more details of lint errors that cannot be automatically fixed, you can use the commands below:
-
Format both backend and frontend:
task format
-
Backend linting:
task backend:lint
-
Frontend linting:
task frontend:lint
task backend:prod
task frontend:devWe use Bun as our package manager, so if you need to install any new libraries during development:
bun add <library>