1
- > Warning: You should probably not use this in production or with any data that is sensitive as the authentication system
1
+ > Warning: You should probably not use this in production or with any data that is sensitive as the authentication
2
+ > system
2
3
> is made very amateurish.
3
4
4
5
# Cira - a minimalistic ticket system backend
@@ -11,18 +12,17 @@ The rest is up to you.
11
12
Create a native desktop or smartphone app, or keep in the web as most ticket boards to.
12
13
You decide, the possibilities are endless.
13
14
14
-
15
15
## Features
16
16
17
17
Cira gives you the foundation to:
18
+
18
19
- create and delete tickets
19
20
- update tickets after creation
20
21
- group tickets by labels
21
22
- assign tickets to users
22
23
- filter tickets by labels, assignee, status and labels
23
24
- authentication with bearer tokens
24
25
25
-
26
26
## Run Locally
27
27
28
28
Simply clone the repository, set up the database and compile the application locally.
@@ -31,17 +31,23 @@ You are required to have installed: [the rust programming language](https://rust
31
31
[ git] ( https://git-scm.com/ ) , [ diesel] ( https://diesel.rs )
32
32
33
33
``` bash
34
- git clone https://github.com/CodeF0x/cira-backend.git
35
- cd cira-backend
34
+ git clone https://github.com/CodeF0x/cira.git
35
+ cd cira
36
+ cargo install diesel_cli
37
+ diesel run migration --database-url cira-backend.sqlite
36
38
cargo build --release
37
- ./target/release/< name of executable >
39
+ ./target/release/cira
38
40
```
41
+
42
+ If you're on Debian and get ` error: linking with 'cc' failed: exit status: 1 ` , make sure to have ` build-essential `
43
+ installed. Same goes for other distros (build-essential might be called different / have an equivalent).
44
+
39
45
There are some default values set in the .env file, you can adjust them as you wish.
40
- Keep in mind to change the code as well.
46
+ Keep in mind to change the code as well. For example, if you change the database file name, change it in the .env file
47
+ as well.
41
48
42
49
You can also launch it in a screen or in a container, so it runs without an active shell session.
43
50
44
-
45
51
## Running Tests
46
52
47
53
To run tests, set up a fake database that is independent of the actual production database.
@@ -52,7 +58,6 @@ diesel migration run --database-url test-backend.sqlite
52
58
cargo test
53
59
```
54
60
55
-
56
61
## API Reference
57
62
58
63
#### Create a new ticket
@@ -63,19 +68,21 @@ cargo test
63
68
64
69
Your payload must be valid JSON and contain the following properties:
65
70
66
- | Property | Type | Description |
67
- | :-------- | :------- | :------------------------- |
68
- | ` title ` | ` string ` | ** Required** . The title of your ticket |
69
- | ` body ` | ` string ` | ** Required** . The body of your ticket |
70
- | ` labels ` | ` Array<string> ` | ** Required** . Labels of your ticket |
71
- | ` status ` | ` string ` | ** Required** . The status of your ticket (set it to "Open") |
72
- | ` assigned_user ` | ` id \| null ` | ** Optional** . A user the ticket should be assigned to. Can be omitted or null |
71
+ | Property | Type | Description |
72
+ | :---------------- | :---------------- | :------------------------------------------------------------------------------ |
73
+ | ` title ` | ` string ` | ** Required** . The title of your ticket |
74
+ | ` body ` | ` string ` | ** Required** . The body of your ticket |
75
+ | ` labels ` | ` Array<string> ` | ** Required** . Labels of your ticket |
76
+ | ` status ` | ` string ` | ** Required** . The status of your ticket (set it to "Open") |
77
+ | ` assigned_user ` | ` id \| null ` | ** Optional** . A user the ticket should be assigned to. Can be omitted or null |
73
78
74
79
Possible Status options:
80
+
75
81
- ` Open `
76
82
- ` Closed `
77
83
78
84
Possible Label options:
85
+
79
86
- ` Feature `
80
87
- ` Bug `
81
88
- ` WontFix `
@@ -100,9 +107,9 @@ Get all tickets.
100
107
101
108
URL parameters:
102
109
103
- | Property | Type | Description |
104
- | :-------- | :------- | :------------------------- |
105
- | ` id ` | ` number ` | ** Required** . The id of the ticket |
110
+ | Property | Type | Description |
111
+ | :--------- | :--------- | :----------------------------------- |
112
+ | ` id ` | ` number ` | ** Required** . The id of the ticket |
106
113
107
114
Deletes a ticket and returns it.
108
115
@@ -114,25 +121,27 @@ Deletes a ticket and returns it.
114
121
115
122
URL parameters:
116
123
117
- | Property | Type | Description |
118
- | :-------- | :------- | :------------------------- |
119
- | ` id ` | ` number ` | ** Required** . The id of the ticket |
124
+ | Property | Type | Description |
125
+ | :--------- | :--------- | :----------------------------------- |
126
+ | ` id ` | ` number ` | ** Required** . The id of the ticket |
120
127
121
128
Your payload must be valid JSON and contain the following properties:
122
129
123
- | Property | Type | Description |
124
- | :-------- | :------- | :------------------------- |
125
- | ` title ` | ` string ` | ** Required** . The title of your ticket |
126
- | ` body ` | ` string ` | ** Required** . The body of your ticket |
127
- | ` labels ` | ` Array<string> ` | ** Required** . Labels of your ticket |
128
- | ` status ` | ` string ` | ** Required** . The status of your ticket (set it to "Open") |
129
- | ` assigned_user ` | ` id \| null ` | ** Optional** . A user the ticket should be assigned to. Can be omitted or null |
130
+ | Property | Type | Description |
131
+ | :---------------- | :---------------- | :------------------------------------------------------------------------------ |
132
+ | ` title ` | ` string ` | ** Required** . The title of your ticket |
133
+ | ` body ` | ` string ` | ** Required** . The body of your ticket |
134
+ | ` labels ` | ` Array<string> ` | ** Required** . Labels of your ticket |
135
+ | ` status ` | ` string ` | ** Required** . The status of your ticket (set it to "Open") |
136
+ | ` assigned_user ` | ` id \| null ` | ** Optional** . A user the ticket should be assigned to. Can be omitted or null |
130
137
131
138
Possible Status options:
139
+
132
140
- ` Open `
133
141
- ` Closed `
134
142
135
143
Possible Label options:
144
+
136
145
- ` Feature `
137
146
- ` Bug `
138
147
- ` WontFix `
@@ -149,11 +158,11 @@ Updates a ticket and returns it.
149
158
150
159
Your payload must be valid JSON and contain the following properties:
151
160
152
- | Property | Type | Description |
153
- | :-------- | :------- | :------------------------- |
154
- | ` display_name ` | ` string ` | ** Required** . The user's display name |
155
- | ` email ` | ` string ` | ** Required** . The user's email address |
156
- | ` password ` | ` string ` | ** Required** . The user's password |
161
+ | Property | Type | Description |
162
+ | :--------------- | :--------- | :--------------------------------------- |
163
+ | ` display_name ` | ` string ` | ** Required** . The user's display name |
164
+ | ` email ` | ` string ` | ** Required** . The user's email address |
165
+ | ` password ` | ` string ` | ** Required** . The user's password |
157
166
158
167
Create a new user and return it.
159
168
@@ -165,22 +174,22 @@ Create a new user and return it.
165
174
166
175
Your payload must be valid JSON and contain the following properties:
167
176
168
- | Property | Type | Description |
169
- | :-------- | :------- | :----------------------------------------------------------------|
170
- | ` title ` | ` string \| null ` | ** Optional** . Title to search for. Can be omitted or null |
171
- | ` labels ` | ` Array<string> \| null ` | ** Optional** . Labels to search for. Can be omitted or null |
172
- | ` status ` | ` string \| null ` | ** Optional** . Status to search for. Can be omitted or null |
173
- | ` assigned_user ` | ` id \| null ` | ** Optional** . Assignee id to search for. Can be omitted or null |
177
+ | Property | Type | Description |
178
+ | :---------------- | :------------------------ | :----------------------------------------------------------------|
179
+ | ` title ` | ` string \| null ` | ** Optional** . Title to search for. Can be omitted or null |
180
+ | ` labels ` | ` Array<string> \| null ` | ** Optional** . Labels to search for. Can be omitted or null |
181
+ | ` status ` | ` string \| null ` | ** Optional** . Status to search for. Can be omitted or null |
182
+ | ` assigned_user ` | ` id \| null ` | ** Optional** . Assignee id to search for. Can be omitted or null |
174
183
175
184
Lets you filter for tickets and return results.
185
+
176
186
## Contributing
177
187
178
188
Contributions are always welcome!
179
189
180
190
Either by submitting issues, pull requests or just general constructive feedback in the form of issues,
181
191
emails or direct messages on Telegram.
182
192
183
-
184
193
## License
185
194
186
195
[ MIT] ( https://choosealicense.com/licenses/mit/ )
0 commit comments