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

Commit 985482f

Browse files
Merge remote-tracking branch 'origin/master'
2 parents 3a5ded5 + c1cf9a6 commit 985482f

File tree

3 files changed

+142
-0
lines changed

3 files changed

+142
-0
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
main-server
2+
---
3+
4+
The central server used for managing the databases of the ECE Apprengineering Team at Rowan University.
5+
6+
## backend
7+
Coded in Rust, manages database manipulation using AJAX requests from frontend.
8+
9+
### Dependencies:
10+
* [Rouille 3.0.0](https://github.com/tomaka/rouille)
11+
* [Diesel 1.3.3](https://github.com/diesel-rs/diesel)
12+
* [dotenv 0.13.0](https://github.com/sgrif/rust-dotenv)
13+
* [serde 1.0](https://github.com/serde-rs/serde)
14+
* [serde_json 1.0](https://github.com/serde-rs/json)
15+
* [log 0.4](https://github.com/rust-lang-nursery/log)
16+
* [simplelog](https://github.com/drakulix/simplelog.rs)
17+
18+
## frontend
19+
Coded in Elm, makes requests to the backend to access database and returns to the user.
20+
21+
### Dependencies:
22+
* Core Elm Packages
23+
* [browser](https://github.com/elm/browser)
24+
* [core](https://github.com/elm/core)
25+
* [html](https://github.com/elm/html)
26+
* [http](https://github.com/elm/http)
27+
* [json](https://github.com/elm/json)
28+
* [url](https://github.com/elm/url)
29+
* [bytes](https://github.com/elm/bytes)
30+
* [file](https://github.com/elm/file)
31+
* [time](https://github.com/elm/time)
32+
* [virtual-dom](https://github.com/elm/virtual-dom)
33+
* [elm-json-decode-pipeline 1.0.0](https://github.com/NoRedInk/elm-json-decode-pipeline)
34+
* [elm-format-number 6.0.2](https://github.com/cuducos/elm-format-number)
35+
* [elm-round 1.0.4](https://github.com/myrho/elm-round)

backend/README.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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+
### API Calls
14+
15+
`GET /users`
16+
Gets information about every user in the system. Returns a List of Users.
17+
18+
`GET /users/{id: u64}`
19+
Gets information about the user with the given id. Returns a single User.
20+
21+
`POST /users`
22+
Creates a new user. The body of POST should be a valid User. Returns the id of the created user.
23+
24+
`POST /users/{id: u64}`
25+
Updates a given user.
26+
27+
### Data Models
28+
29+
Many of the API calls share a common set of data models, represented in JSON format.
30+
31+
#### User
32+
| Property Name | Type | Optional | Description |
33+
|---------------|--------|----------|-------------|
34+
| id | u64 | No | The internal id of the user |
35+
| first_name | String | No | The first name of the user |
36+
| last_name | String | no | The last name of the user |
37+
| banner_id | u64 | No | The banner id of the user |
38+
| email | String | Yes | The Rowan email of the user. If the user does not have an email, this will be null of non-existent |
39+
```
40+
{
41+
"id": 11,
42+
"first_name": "John"
43+
"last_name": "Smith",
44+
"banner_id": 9162xxxxx,
45+
"email": "[email protected]"
46+
}
47+
```
48+
49+
#### Partial User
50+
| Property Name | Type | Optional | Description |
51+
|---------------|--------|----------|-------------|
52+
| first_name | String | Yes | The first name of the user |
53+
| last_name | String | Yes | The last name of the user |
54+
| banner_id | u64 | Yes | The banner id of the user |
55+
| email | String | Yes | The Rowan email of the user. If the user does not have an email, this will be null of non-existent |
56+
```
57+
{
58+
"first_name": "John"
59+
"last_name": "Smith",
60+
"banner_id": 9162xxxxx,
61+
"email": "[email protected]"
62+
}
63+
```
64+
65+
#### List of Users
66+
| Property Name | Type | Optional | Description |
67+
|---------------|---------------|----------|-----------------|
68+
| users | List of Users | No | A list of Users |
69+
```
70+
{
71+
"users": [
72+
{
73+
"first_name": "John"
74+
"last_name": "Smith",
75+
"banner_id": 9162xxxxx,
76+
"email": "[email protected]"
77+
},
78+
{
79+
"first_name": "Mike"
80+
"last_name": "Johnson",
81+
"banner_id": 9162xxxxx,
82+
"email": "[email protected]"
83+
}
84+
]
85+
}
86+
```

frontend/src/form.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<script type="text/javascript">
6+
function ajaxGet()
7+
{
8+
var xhttp = new XMLHttpRequest();
9+
xhttp.open("GET", "/users/", true);
10+
xhttp.send();
11+
console.log(1);
12+
}
13+
</script>
14+
</head>
15+
<body>
16+
<form name="databaseFrontend" onSubmit="JavaScript:ajaxGet()">
17+
<input name="ajaxGet" type="submit" value="Test"
18+
onClick="JavaScript:ajaxGet()">
19+
</form>
20+
</body>
21+
</html>

0 commit comments

Comments
 (0)