summaryrefslogtreecommitdiff
path: root/resources
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2025-02-03 01:12:45 -0500
committerBenjamin Chausse <benjamin@chausse.xyz>2025-02-03 01:12:45 -0500
commit5389e1a5d26fdbf2441fa5a1e101999e8449b9d1 (patch)
tree069cd37cb8e556c1ba3b47c3ea8576a1aa91ea2c /resources
Batman
Diffstat (limited to 'resources')
-rwxr-xr-xresources/local_dev.sh19
-rw-r--r--resources/schema.proto79
2 files changed, 98 insertions, 0 deletions
diff --git a/resources/local_dev.sh b/resources/local_dev.sh
new file mode 100755
index 0000000..68bb46b
--- /dev/null
+++ b/resources/local_dev.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+env_vars=$(cat << EOF
+ LOG_LEVEL=debug
+ LOG_FORMAT=plain
+ LOG_OUTPUT=stdout
+ LISTEN_PORT=1234
+ DATABASE_PATH=runtime/store.db
+EOF
+)
+
+case "$1" in
+ --get-config)
+ echo "$env_vars"
+ ;;
+ *)
+ clear && env $env_vars go run . $@
+ ;;
+esac
diff --git a/resources/schema.proto b/resources/schema.proto
new file mode 100644
index 0000000..5b34332
--- /dev/null
+++ b/resources/schema.proto
@@ -0,0 +1,79 @@
+syntax = "proto3";
+
+import "protobuf/src/google/protobuf/empty.proto";
+import "protobuf/src/google/protobuf/timestamp.proto";
+
+option go_package = "github.com/ChausseBenjamin/rafta/internal/server/model";
+
+enum TaskState {
+ TASK_UNDEFINED = 0;
+ TASK_PENDING = 1;
+ TASK_IN_PROGRESS = 2;
+ TASK_DONE = 3;
+ TASK_BLOCKED = 4;
+}
+
+message UserID {
+ string uuid = 1;
+}
+
+message UserData {
+ string name = 1;
+ string email = 2;
+ google.protobuf.Timestamp created_on = 3;
+ google.protobuf.Timestamp last_login = 4;
+}
+
+message User {
+ UserID id = 1;
+ UserData data = 2;
+}
+
+message TaskID {
+ string uuid = 1;
+}
+
+message TaskData {
+ string title = 1;
+ Description desc = 2; // markdown
+ uint32 priority = 3;
+ TaskState state = 4;
+ google.protobuf.Timestamp created_on = 5;
+ google.protobuf.Timestamp last_updated = 6;
+ repeated string tags = 7;
+}
+
+message Description {
+ string data = 1;
+}
+
+message Task {
+ TaskID id = 1;
+ TaskData data = 2;
+}
+
+message TaskList {
+ repeated Task tasks = 1;
+}
+
+message UserList {
+ repeated User users = 1;
+}
+
+service Rafta {
+ // Retrieval
+ rpc GetUserTasks(UserID) returns (TaskList);
+ rpc GetAllUsers(google.protobuf.Empty) returns (UserList);
+ rpc GetUser(UserID) returns (User);
+ rpc GetTask(TaskID) returns (Task);
+
+ // Task Manipulation
+ rpc DeleteTask(TaskID) returns (google.protobuf.Empty);
+ rpc UpdateTask(Task) returns (Task);
+ rpc CreateTask(TaskData) returns (Task);
+
+ // User Manipulation
+ rpc DeleteUser(UserID) returns (google.protobuf.Empty);
+ rpc UpdateUser(User) returns (User);
+ rpc CreateUser(UserData) returns (User);
+}