Skip to content
This repository was archived by the owner on Sep 8, 2019. It is now read-only.

Commit 779b395

Browse files
committed
Backend Readme Initial Push
1 parent c800b12 commit 779b395

File tree

1 file changed

+87
-0
lines changed

1 file changed

+87
-0
lines changed

backend/README.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
## backend
2+
Coded in Rust, manages database manipulation using AJAX requests from frontend.
3+
4+
### Dependencies:
5+
* [Rouille 3.0.0](https://github.com/tomaka/rouille)
6+
* [Diesel 1.3.3](https://github.com/diesel-rs/diesel)
7+
* [dotenv 0.13.0](https://github.com/sgrif/rust-dotenv)
8+
* [serde 1.0](https://github.com/serde-rs/serde)
9+
* [serde_json 1.0](https://github.com/serde-rs/json)
10+
* [log 0.4](https://github.com/rust-lang-nursery/log)
11+
* [simplelog](https://github.com/drakulix/simplelog.rs)
12+
13+
14+
### API Calls
15+
16+
`GET /users`
17+
Gets information about every user in the system. Returns a List of Users.
18+
19+
`GET /users/{id: u64}`
20+
Gets information about the user with the given id. Returns a single User.
21+
22+
`POST /users`
23+
Creates a new user. The body of POST should be a valid User. Returns the id of the created user.
24+
25+
`POST /users/{id: u64}`
26+
Updates a given user.
27+
28+
### Data Models
29+
30+
Many of the API calls share a common set of data models, represented in JSON format.
31+
32+
#### User
33+
| Property Name | Type | Optional | Description |
34+
|---------------|--------|----------|-------------|
35+
| id | u64 | No | The internal id of the user |
36+
| first_name | String | No | The first name of the user |
37+
| last_name | String | no | The last name of the user |
38+
| banner_id | u64 | No | The banner id of the user |
39+
| email | String | Yes | The Rowan email of the user. If the user does not have an email, this will be null of non-existent |
40+
```
41+
{
42+
"id": 11,
43+
"first_name": "John"
44+
"last_name": "Smith",
45+
"banner_id": 9162xxxxx,
46+
"email": "[email protected]"
47+
}
48+
```
49+
50+
#### Partial User
51+
| Property Name | Type | Optional | Description |
52+
|---------------|--------|----------|-------------|
53+
| first_name | String | Yes | The first name of the user |
54+
| last_name | String | Yes | The last name of the user |
55+
| banner_id | u64 | Yes | The banner id of the user |
56+
| email | String | Yes | The Rowan email of the user. If the user does not have an email, this will be null of non-existent |
57+
```
58+
{
59+
"first_name": "John"
60+
"last_name": "Smith",
61+
"banner_id": 9162xxxxx,
62+
"email": "[email protected]"
63+
}
64+
```
65+
66+
#### List of Users
67+
| Property Name | Type | Optional | Description |
68+
|---------------|---------------|----------|-----------------|
69+
| users | List of Users | No | A list of Users |
70+
```
71+
{
72+
"users": [
73+
{
74+
"first_name": "John"
75+
"last_name": "Smith",
76+
"banner_id": 9162xxxxx,
77+
"email": "[email protected]"
78+
},
79+
{
80+
"first_name": "Mike"
81+
"last_name": "Johnson",
82+
"banner_id": 9162xxxxx,
83+
"email": "[email protected]"
84+
}
85+
]
86+
}
87+
```

0 commit comments

Comments
 (0)