Skip to content

Commit 5330b61

Browse files
committed
docs: Improve contributing instructions
1 parent 63f5136 commit 5330b61

2 files changed

Lines changed: 23 additions & 24 deletions

File tree

.github/copilot-instructions.md

Lines changed: 0 additions & 22 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ Versia Server is built using the following technologies:
1111

1212
- [Bun](https://bun.sh) - A JavaScript runtime similar to Node.js, but faster and with more features
1313
- [PostgreSQL](https://www.postgresql.org/) - A relational database
14-
- [`pg_uuidv7`](https://github.com/fboulnois/pg_uuidv7) - A PostgreSQL extension that provides a UUIDv7 data type
14+
- [Drizzle ORM](https://orm.drizzle.team/) - An ORM for TypeScript and JavaScript, used for database interactions
1515
- [Docker](https://www.docker.com/) - A containerization platform, used for development and deployment
1616
- [Sharp](https://sharp.pixelplumbing.com/) - An image processing library, used for fast image resizing and converting
1717
- [TypeScript](https://www.typescriptlang.org/) - A typed superset of JavaScript
18+
- [Biome](https://biomejs.dev) - A code formatter and linter, used to enforce a consistent code style
1819

1920
## Getting Started
2021

@@ -36,7 +37,7 @@ git clone https://github.com/versia-pub/server.git
3637
bun install
3738
```
3839

39-
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.
4041

4142
2. Copy the `config/config.example.toml` file to `config/config.toml` and edit it to set up the database connection and other settings.
4243

@@ -104,6 +105,12 @@ bun lint --write
104105

105106
You can also install the Biome Visual Studio Code extension and have it format your code automatically on save.
106107

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+
107114
### TypeScript
108115

109116
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
139146

140147
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.
141148

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+
142163
## Reporting bugs
143164

144165
If you find a bug, please open an issue on GitHub. Please make sure to include the following information:

0 commit comments

Comments
 (0)