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,48 +12,56 @@ 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.
29
29
Then start it.
30
30
You are required to have installed: [ the rust programming language] ( https://rust-lang.org ) ,
31
- [ git] ( https://git-scm.com/ ) , [ diesel] ( https://diesel.rs )
31
+ [ git] ( https://git-scm.com/ ) , [ diesel] ( https://diesel.rs ) , [ sqlite ] ( https://www.sqlite.org/ )
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 --no-default-features --features " sqlite"
37
+ diesel setup
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
+
45
+ If this error accours while installing ` diesel_cli ` , try ` sudo apt install -y libsqlite3-dev libpq-dev libmysqlclient-dev ` .
46
+
39
47
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.
48
+ Keep in mind to change the code as well. For example, if you change the database file name, change it in the .env file
49
+ as well.
41
50
42
- You can also launch it in a screen or in a container, so it runs without an active shell session .
51
+ If everything went well and there is no output after running the last command, cira is listening on port ` 8080 ` .
43
52
53
+ You can also launch it in a screen or in a container, so it runs without an active shell session.
44
54
45
55
## Running Tests
46
56
47
57
To run tests, set up a fake database that is independent of the actual production database.
48
- You need to have installed [ diesel] ( https://diesel.rs ) , and [ rust] ( https://rust-lang.org ) .
58
+ You need to have installed [ diesel] ( https://diesel.rs ) , [ sqlite ] ( https://www.sqlite.org/ ) and [ rust] ( https://rust-lang.org ) .
49
59
50
60
``` bash
51
61
diesel migration run --database-url test-backend.sqlite
52
62
cargo test
53
63
```
54
64
55
-
56
65
## API Reference
57
66
58
67
#### Create a new ticket
@@ -63,19 +72,21 @@ cargo test
63
72
64
73
Your payload must be valid JSON and contain the following properties:
65
74
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 |
75
+ | Property | Type | Description |
76
+ | :---------------- | :---------------- | :------------------------------------------------------------------------------ |
77
+ | ` title ` | ` string ` | ** Required** . The title of your ticket |
78
+ | ` body ` | ` string ` | ** Required** . The body of your ticket |
79
+ | ` labels ` | ` Array<string> ` | ** Required** . Labels of your ticket |
80
+ | ` status ` | ` string ` | ** Required** . The status of your ticket (set it to "Open") |
81
+ | ` assigned_user ` | ` id \| null ` | ** Optional** . A user the ticket should be assigned to. Can be omitted or null |
73
82
74
83
Possible Status options:
84
+
75
85
- ` Open `
76
86
- ` Closed `
77
87
78
88
Possible Label options:
89
+
79
90
- ` Feature `
80
91
- ` Bug `
81
92
- ` WontFix `
@@ -100,9 +111,9 @@ Get all tickets.
100
111
101
112
URL parameters:
102
113
103
- | Property | Type | Description |
104
- | :-------- | :------- | :------------------------- |
105
- | ` id ` | ` number ` | ** Required** . The id of the ticket |
114
+ | Property | Type | Description |
115
+ | :--------- | :--------- | :----------------------------------- |
116
+ | ` id ` | ` number ` | ** Required** . The id of the ticket |
106
117
107
118
Deletes a ticket and returns it.
108
119
@@ -114,25 +125,27 @@ Deletes a ticket and returns it.
114
125
115
126
URL parameters:
116
127
117
- | Property | Type | Description |
118
- | :-------- | :------- | :------------------------- |
119
- | ` id ` | ` number ` | ** Required** . The id of the ticket |
128
+ | Property | Type | Description |
129
+ | :--------- | :--------- | :----------------------------------- |
130
+ | ` id ` | ` number ` | ** Required** . The id of the ticket |
120
131
121
132
Your payload must be valid JSON and contain the following properties:
122
133
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 |
134
+ | Property | Type | Description |
135
+ | :---------------- | :---------------- | :------------------------------------------------------------------------------ |
136
+ | ` title ` | ` string ` | ** Required** . The title of your ticket |
137
+ | ` body ` | ` string ` | ** Required** . The body of your ticket |
138
+ | ` labels ` | ` Array<string> ` | ** Required** . Labels of your ticket |
139
+ | ` status ` | ` string ` | ** Required** . The status of your ticket (set it to "Open") |
140
+ | ` assigned_user ` | ` id \| null ` | ** Optional** . A user the ticket should be assigned to. Can be omitted or null |
130
141
131
142
Possible Status options:
143
+
132
144
- ` Open `
133
145
- ` Closed `
134
146
135
147
Possible Label options:
148
+
136
149
- ` Feature `
137
150
- ` Bug `
138
151
- ` WontFix `
@@ -149,11 +162,11 @@ Updates a ticket and returns it.
149
162
150
163
Your payload must be valid JSON and contain the following properties:
151
164
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 |
165
+ | Property | Type | Description |
166
+ | :--------------- | :--------- | :--------------------------------------- |
167
+ | ` display_name ` | ` string ` | ** Required** . The user's display name |
168
+ | ` email ` | ` string ` | ** Required** . The user's email address |
169
+ | ` password ` | ` string ` | ** Required** . The user's password |
157
170
158
171
Create a new user and return it.
159
172
@@ -165,22 +178,22 @@ Create a new user and return it.
165
178
166
179
Your payload must be valid JSON and contain the following properties:
167
180
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 |
181
+ | Property | Type | Description |
182
+ | :---------------- | :------------------------ | :----------------------------------------------------------------|
183
+ | ` title ` | ` string \| null ` | ** Optional** . Title to search for. Can be omitted or null |
184
+ | ` labels ` | ` Array<string> \| null ` | ** Optional** . Labels to search for. Can be omitted or null |
185
+ | ` status ` | ` string \| null ` | ** Optional** . Status to search for. Can be omitted or null |
186
+ | ` assigned_user ` | ` id \| null ` | ** Optional** . Assignee id to search for. Can be omitted or null |
174
187
175
188
Lets you filter for tickets and return results.
189
+
176
190
## Contributing
177
191
178
192
Contributions are always welcome!
179
193
180
194
Either by submitting issues, pull requests or just general constructive feedback in the form of issues,
181
195
emails or direct messages on Telegram.
182
196
183
-
184
197
## License
185
198
186
199
[ MIT] ( https://choosealicense.com/licenses/mit/ )
0 commit comments