Skip to content

Commit c1b39e0

Browse files
authored
docs: better setup tutorial (#36)
* docs: better setup tutorial * docs: better build info
1 parent 336e3a4 commit c1b39e0

File tree

2 files changed

+57
-44
lines changed

2 files changed

+57
-44
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "cira-backend"
2+
name = "cira"
33
version = "0.1.0"
44
edition = "2021"
55

readme.md

Lines changed: 56 additions & 43 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,48 +12,56 @@ 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.
2929
Then start it.
3030
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/)
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 --no-default-features --features "sqlite"
37+
diesel setup
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+
45+
If this error accours while installing `diesel_cli`, try `sudo apt install -y libsqlite3-dev libpq-dev libmysqlclient-dev`.
46+
3947
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.
4150

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`.
4352

53+
You can also launch it in a screen or in a container, so it runs without an active shell session.
4454

4555
## Running Tests
4656

4757
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).
4959

5060
```bash
5161
diesel migration run --database-url test-backend.sqlite
5262
cargo test
5363
```
5464

55-
5665
## API Reference
5766

5867
#### Create a new ticket
@@ -63,19 +72,21 @@ cargo test
6372

6473
Your payload must be valid JSON and contain the following properties:
6574

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

7483
Possible Status options:
84+
7585
- `Open`
7686
- `Closed`
7787

7888
Possible Label options:
89+
7990
- `Feature`
8091
- `Bug`
8192
- `WontFix`
@@ -100,9 +111,9 @@ Get all tickets.
100111

101112
URL parameters:
102113

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

107118
Deletes a ticket and returns it.
108119

@@ -114,25 +125,27 @@ Deletes a ticket and returns it.
114125

115126
URL parameters:
116127

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

121132
Your payload must be valid JSON and contain the following properties:
122133

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

131142
Possible Status options:
143+
132144
- `Open`
133145
- `Closed`
134146

135147
Possible Label options:
148+
136149
- `Feature`
137150
- `Bug`
138151
- `WontFix`
@@ -149,11 +162,11 @@ Updates a ticket and returns it.
149162

150163
Your payload must be valid JSON and contain the following properties:
151164

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

158171
Create a new user and return it.
159172

@@ -165,22 +178,22 @@ Create a new user and return it.
165178

166179
Your payload must be valid JSON and contain the following properties:
167180

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

175188
Lets you filter for tickets and return results.
189+
176190
## Contributing
177191

178192
Contributions are always welcome!
179193

180194
Either by submitting issues, pull requests or just general constructive feedback in the form of issues,
181195
emails or direct messages on Telegram.
182196

183-
184197
## License
185198

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

0 commit comments

Comments
 (0)