You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Set up a PostgreSQL database (you need a special extension, please look at [the database documentation](https://server.versia.pub/setup/database))
40
+
1. Set up a PostgreSQL database.
40
41
41
42
2. Copy the `config/config.example.toml` file to `config/config.toml` and edit it to set up the database connection and other settings.
42
43
@@ -104,6 +105,12 @@ bun lint --write
104
105
105
106
You can also install the Biome Visual Studio Code extension and have it format your code automatically on save.
106
107
108
+
### Conventions
109
+
110
+
- We always use ESM and the very latest TypeScript/JavaScript features available in Bun.
111
+
- We use double quotes for strings and four spaces for indentation.
112
+
- We try to use JSDoc comments for all functions and classes, and we use explicit type annotations for all variables and function return values.
113
+
107
114
### TypeScript
108
115
109
116
Linting should not be ignored, except if they are false positives, in which case you can use a comment to disable the rule for the line or the file. If you need to disable a rule, please add a comment explaining why.
@@ -139,6 +146,20 @@ Documentation for the Versia protocol is available on [versia.pub](https://versi
139
146
140
147
This project should not need much documentation, but if you think that something needs to be documented, please add it to the README, docs or contribution guide.
141
148
149
+
## Code structure
150
+
151
+
This project uses a monorepo structure with Bun as the package manager. Packages are located in the `packages` directory:
152
+
- Packages that start with `@versia-server/` are utility packages for the server, such as the database and tables packages.
153
+
- Packages that start with `@versia` are published packages that can be used by third-party developers, such as the `@versia/client` package.
154
+
155
+
### ORM
156
+
157
+
Our codebase uses Drizzle as an ORM, which is exposed in the `@versia-server/kit/db` and `@versia-server/kit/tables` packages.
158
+
159
+
### API and worker
160
+
161
+
The app has two modes: worker and API. The worker mode is used for background tasks, while the API mode serves HTTP requests. The entry point for the worker is `worker.ts`, and for the API, it is `api.ts`.
162
+
142
163
## Reporting bugs
143
164
144
165
If you find a bug, please open an issue on GitHub. Please make sure to include the following information:
0 commit comments