Prerequisites:
- Rust
- Flutter
- Protobuf
- Pre-Commit (optional but recommended)
The dart protobuf plugin requires "$HOME/.pub-cache/bin" to be added to your PATH
Installation:
- Clone and install the pre-commit hooks:
git clone https://github.com/<USERNAME>/TMS.git cd TMS pre-commit install
- Build the server:
cargo build
- Install client dependencies:
dart pub global activate protoc_plugin cd client flutter pub get
Compiling
- Compile the server (from workspace)
- If protobuf is installed the buildscript should automatically compile the protobuf files into generated outputs prior to compiling the server.
cargo build
- Compile the client
- The Flutter client uses protobuf, riverpod and freezed which generates code for state management and data models.
- It's recommended to run the build_runner to generate any lingering code. Or run it with
watchto automatically regenerate code. - And then compile the protobuf (flutter sadly doesn't have a build_runner binding for protobuf)
protoc --proto_path=protos --dart_out=grpc:client/lib/generated protos/**/*.proto cd client dart run build_runner build --delete-conflicting-outputs flutter build
| Directory | Description |
|---|---|
/database |
key-value database library using sled |
/launcher |
Launcher and entry code for the server application |
/protos |
Protocol Buffers definitions for communication between client and server |
/server |
Server-side code |
/client |
Client-side code (in flutter) |
/docs |
Documentation for the project |
Branch Naming Convention:
feat/<feature-name>fix/<issue-number>
Committing:
- TMS uses pre-commit hooks for linting and catching common issues before committing
- Use conventional and meaningful commit messages:
feat:,fix:,docs:,refactor: - Keep commit messages concise and descriptive under 50 characters
- Example:
fix: Updated export column order to match OJS
Pull Requests:
- Create feature branch from
master - Make changes, test locally
- Update documentation relating to feature if possible
- Push and open PR to
master - Ensure CI-CD is compliant with changes
- Prefer squash merge
Rust:
- Use Rustfmt for code formatting
- Use
2 spacesfor indentation - Use
120 line width - Use
snake_casefor variable and function names - Use
PascalCasefor struct, trait and enum names - Use consistent naming conventions
Flutter:
- Use
2 spacesfor indentation - Use
120 line width - Use
camelCasefor variable and function names - Use
PascalCasefor class, enum and interface names - Use consistent naming conventions
- Order of Widget priority
StatelessWidgetfor static contentConsumerWidgetfor rebuilding content (dependent on providers)HooksConsumerWidgetfor rebuilding content with inline logic
| Font Type | Font Name | Font Size |
|---|---|---|
| Heading | Ubuntu Mono | 16px |
| Body | Ubuntu Mono | 14px |
| Supporting | Ubuntu Mono | 12px |
(Yes it's monoblock, I don't want to hear it)
| Color Type | Color Name | Hex Code |
|---|---|---|
| Primary | Mint Green | #009485 |
| Secondary | Persian Blue | #009485 |
| Supporting Error | Red | #D92B2B |
| Supporting Warning | Orange | #D9822B |
| Supporting Success | Green | #2BD92B |
| Supporting Info | Blue | #2B65D9 |
| Neutral | Shadow Gray | #20222F |