Skip to content

Commit d6273be

Browse files
committed
docs: better setup tutorial
1 parent 336e3a4 commit d6273be

File tree

1 file changed

+50
-41
lines changed

1 file changed

+50
-41
lines changed

readme.md

Lines changed: 50 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
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
23
> is made very amateurish.
34
45
# Cira - a minimalistic ticket system backend
@@ -11,18 +12,17 @@ The rest is up to you.
1112
Create a native desktop or smartphone app, or keep in the web as most ticket boards to.
1213
You decide, the possibilities are endless.
1314

14-
1515
## Features
1616

1717
Cira gives you the foundation to:
18+
1819
- create and delete tickets
1920
- update tickets after creation
2021
- group tickets by labels
2122
- assign tickets to users
2223
- filter tickets by labels, assignee, status and labels
2324
- authentication with bearer tokens
2425

25-
2626
## Run Locally
2727

2828
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
3131
[git](https://git-scm.com/), [diesel](https://diesel.rs)
3232

3333
```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
3638
cargo build --release
37-
./target/release/<name of executable>
39+
./target/release/cira
3840
```
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+
3945
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.
4148

4249
You can also launch it in a screen or in a container, so it runs without an active shell session.
4350

44-
4551
## Running Tests
4652

4753
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
5258
cargo test
5359
```
5460

55-
5661
## API Reference
5762

5863
#### Create a new ticket
@@ -63,19 +68,21 @@ cargo test
6368

6469
Your payload must be valid JSON and contain the following properties:
6570

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 |
7378

7479
Possible Status options:
80+
7581
- `Open`
7682
- `Closed`
7783

7884
Possible Label options:
85+
7986
- `Feature`
8087
- `Bug`
8188
- `WontFix`
@@ -100,9 +107,9 @@ Get all tickets.
100107

101108
URL parameters:
102109

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 |
106113

107114
Deletes a ticket and returns it.
108115

@@ -114,25 +121,27 @@ Deletes a ticket and returns it.
114121

115122
URL parameters:
116123

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 |
120127

121128
Your payload must be valid JSON and contain the following properties:
122129

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 |
130137

131138
Possible Status options:
139+
132140
- `Open`
133141
- `Closed`
134142

135143
Possible Label options:
144+
136145
- `Feature`
137146
- `Bug`
138147
- `WontFix`
@@ -149,11 +158,11 @@ Updates a ticket and returns it.
149158

150159
Your payload must be valid JSON and contain the following properties:
151160

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 |
157166

158167
Create a new user and return it.
159168

@@ -165,22 +174,22 @@ Create a new user and return it.
165174

166175
Your payload must be valid JSON and contain the following properties:
167176

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 |
174183

175184
Lets you filter for tickets and return results.
185+
176186
## Contributing
177187

178188
Contributions are always welcome!
179189

180190
Either by submitting issues, pull requests or just general constructive feedback in the form of issues,
181191
emails or direct messages on Telegram.
182192

183-
184193
## License
185194

186195
[MIT](https://choosealicense.com/licenses/mit/)

0 commit comments

Comments
 (0)