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

Commit 9f5c9ec

Browse files
authored
DOC: update documentation (#130)
* DOC: update documentation * DOC: update more docs * DOC: update test script * DOC: update expected output
1 parent a6d3865 commit 9f5c9ec

13 files changed

+133
-115
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ backend: # Package Spotify Apollo service with maven.
2727

2828
storage: # Initialize filesystemm and database and pre-populate with examples. Requires MySQL root password.
2929
mkdir -p ~/.euphoria
30-
cp -r docs/exampleFiles/* ~/.euphoria/
30+
cp -r docs/example-files/* ~/.euphoria/
3131
cat euphoria-service/src/main/resources/initialize-database.sql | mysql -u root -p
3232

3333
build: frontend backend # Alias for `make frontend backend`.

README.md

+15-7
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
[![Build Status](https://travis-ci.org/eigenfoo/euphoria.svg?branch=master)](https://travis-ci.org/eigenfoo/euphoria)
44

55
> Our web application is served at
6-
> [199.98.27.117:8000](http://199.98.27.117:8000/). We eventually intend to set
7-
> up the [euphoria-recruiting.club](http://euphoria-recruiting.club/) domain
8-
> name (hence the project structure).
6+
> [199.98.27.117:8000](http://199.98.27.117:8000/). We intended to set up the
7+
> [euphoria-recruiting.club](http://euphoria-recruiting.club/) domain name
8+
> (hence the project structure), but that fell outside the scope of our project.
99
1010
A simple recruiting platform, written as a project for ECE366 (Software
1111
Engineering & Large Systems Design) at The Cooper Union. Euphoria's tech stack
@@ -14,14 +14,16 @@ with a [MySQL](https://www.mysql.com/) database and a
1414
[React.js](https://github.com/facebook/create-react-app) JavaScript web
1515
application.
1616

17-
Team members: [George Ho](https://github.com/eigenfoo), [Wendy Ide](https://github.com/wside), [Luka Lipovac](https://github.com/lipovac) and [Ostap Voynarovskiy](https://github.com/ostapstephan)
17+
Team members: [George Ho](https://github.com/eigenfoo), [Wendy
18+
Ide](https://github.com/wside), [Luka Lipovac](https://github.com/lipovac) and
19+
[Ostap Voynarovskiy](https://github.com/ostapstephan)
1820

1921
## Requirements
2022

2123
- [Oracle JDK 11](https://www.oracle.com/technetwork/java/javase/downloads/jdk11-downloads-5066655.html)
2224
- Maven
2325
- MySQL
24-
- Node.js and `npm`
26+
- Node.js and npm
2527

2628
```bash
2729
sudo apt install nodejs npm maven mysql-server
@@ -39,14 +41,20 @@ make all
3941

4042
This will:
4143

42-
1. Install `euphoria`'s dependencies
43-
2. Build the frontend web application and backend service
44+
1. Install euphoria's dependencies.
45+
2. Build the frontend web application with npm and package the backend service
46+
with maven.
4447
3. Initialize the filesytem and database, and pre-populate it with examples.
4548

4649
See the [installation and setup
4750
documentation](https://github.com/eigenfoo/euphoria/blob/master/docs/installation-setup.md)
4851
for more detailed instructions on how to manually install and setup `euphoria`.
4952

53+
## Deployment
54+
55+
Upon running `make all`, you can simply run `make deploy` in a virtual machine
56+
to deploy euphoria.
57+
5058
## Documentation
5159

5260
See the [`docs/`
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

docs/http-expected-output.txt

+26
Large diffs are not rendered by default.

docs/http-requests.md

+1
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
Payload contains nothing.
131131

132132
---
133+
133134
To base64 dump any file:
134135
```bash
135136
base64 resume.pdf | tr -d '\n'

docs/installation-setup.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
```
1515

1616
3. Initiliaze the example files by manually copying the contents of
17-
[`docs/exampleFiles`
18-
subdirectory](https://github.com/eigenfoo/euphoria/tree/master/docs/exampleFiles)
17+
[`docs/example-files`
18+
subdirectory](https://github.com/eigenfoo/euphoria/tree/master/docs/example-files)
1919
into `~/.euphoria/`. You will need to manually create the `~/.euphoria`
2020
directory.
2121

2222
```bash
2323
mkdir ~/.euphoria/
24-
cp -r docs/exampleFiles/* ~/.euphoria/
24+
cp -r docs/example-files/* ~/.euphoria/
2525
```
2626

2727
4. Download dependencies for, and build, the frontend:
@@ -49,7 +49,7 @@
4949
5. If serving the frontend on a virtual machine, overwrite the file
5050
`/etc/nginx/sites-available/default` with [the `nginx/default`
5151
file](https://github.com/eigenfoo/euphoria/blob/master/nginx/default). Then
52-
restart `nginx` with `sudo /etc/init.d/nginx reload`.
52+
restart `nginx` with `sudo systemctl restart nginx`.
5353

5454
Before restarting `nginx`, you can test your configuration with `sudo nginx
5555
-t`.

docs/test-http.sh

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#!/bin/bash
2+
#
3+
# This script sends test HTTP requests from the command line via curl. Expected
4+
# outputs are documented in `http-expected-output.txt`. Note that the expected
5+
# outputs are produced by running this script immediately after initializing the
6+
# database (with `initialize-database.sql`). Also note that some outputs are
7+
# non-deterministic and will change (e.g. the cookie that is produced upon
8+
# authentication).
9+
10+
curl -X GET http://localhost:8080/api/authentication/apple/hash
11+
echo ""
12+
13+
curl -X GET http://localhost:8080/api/posting/1
14+
echo ""
15+
16+
curl -X GET http://localhost:8080/api/posting/all
17+
echo ""
18+
19+
curl -X GET http://localhost:8080/api/posting/random
20+
echo ""
21+
22+
curl -X GET http://localhost:8080/api/posting/company/123
23+
echo ""
24+
25+
curl -X GET http://localhost:8080/api/posting/NEWYORK/TECHNOLOGY/INTERNSHIP
26+
echo ""
27+
28+
curl -X GET http://localhost:8080/api/application/1
29+
echo ""
30+
31+
curl -X GET http://localhost:8080/api/application/posting/3
32+
echo ""
33+
34+
curl -X GET http://localhost:8080/api/user/2
35+
echo ""
36+
37+
curl -X GET http://localhost:8080/api/company/2
38+
echo ""
39+
40+
curl -X POST http://localhost:8080/api/authentication -H "Content-Type: application/json" -d '{"id": 3, "username": "george", "passwordHash":"ho", "isUser" : true}'
41+
echo ""
42+
43+
curl -X GET http://localhost:8080/api/authentication/george/ho
44+
echo ""
45+
46+
curl -X POST http://localhost:8080/api/posting -H "Content-Type: application/json" -d '{"companyId": 5, "jobTitle": "hello", "description":"there", "location" : "NEWYORK" , "industry": "FINANCE", "skillLevel":"INTERNSHIP"}'
47+
echo ""
48+
49+
curl -X GET http://localhost:8080/api/posting/4
50+
echo ""
51+
52+
curl -X POST http://localhost:8080/api/application -H "Content-Type: application/json" -d '{"postingId": 3, "userId": 2, "resume": "54686973", "coverLetter": "54686973"}'
53+
echo ""
54+
55+
curl -X POST http://localhost:8080/api/application -H "Content-Type: application/json" -d '{"postingId": 1, "userId": 1, "resume": "This", "coverLetter": "This"}'
56+
echo ""
57+
58+
curl -X GET http://localhost:8080/api/application/4
59+
echo ""
60+
61+
curl -X POST http://localhost:8080/api/user -H "Content-Type: application/json" -d '{"name": "george", "email": "[email protected]", "phoneNumber": "1234567890", "educationLevel": "BACHELORS", "description": "fml."}'
62+
echo ""
63+
64+
curl -X GET http://localhost:8080/api/user/4
65+
echo ""
66+
67+
curl -X POST http://localhost:8080/api/company -H "Content-Type: application/json" -d '{"name": "Cooper", "website": "cooper.edu", "description": "fml."}'
68+
echo ""
69+
70+
curl -X PUT http://localhost:8080/api/posting -H "Content-Type: application/json" -d '{"postingId": 4, "jobTitle": "again hello", "description":"there", "location" : "NEWYORK" , "industry": "FINANCE", "skillLevel":"INTERNSHIP"}'
71+
echo ""
72+
73+
curl -X GET http://localhost:8080/api/posting/4
74+
echo ""
75+
76+
curl -X DELETE http://localhost:8080/api/posting/4
77+
echo ""
78+
79+
curl -X GET http://localhost:8080/api/posting/4
80+
echo ""
81+
82+
curl -X POST http://localhost:8080/api/cookie -H "Content-Type: application/json" -d '{"username": "timapple", "passwordHash": "hash"}'
83+
echo ""
84+
85+
curl -X GET http://localhost:8080/api/cookie/abcdefgh-ijkl-mnop-qurs-tuvwxyz12345
86+
echo ""

docs/test.sh

-103
This file was deleted.

0 commit comments

Comments
 (0)