Skip to content

Commit 45765df

Browse files
author
elgris
committed
Adds READMEs for all the services
1 parent 8b45a5c commit 45765df

File tree

4 files changed

+67
-6
lines changed

4 files changed

+67
-6
lines changed

auth-api/README.md

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# auth-api
22

3-
This part of the exercise is responsible for authentication.
3+
This part of the exercise is responsible for authentication. It is written in Go and tested with Go1.9.
4+
45
It provides a single useful API endpoint `POST /login` that takes a simple JSON object and
56
returns an access token in case of successful authentication.
67

@@ -17,11 +18,19 @@ The JSON object structure is following:
1718

1819
## Configuration
1920

20-
The binary scans environment for variables:
21-
- `AUTH_API_PORT` - the port the service takes .
21+
The service scans environment for variables:
22+
- `AUTH_API_PORT` - the port the service takes.
2223
- `USERS_API_ADDRESS` - base URL of [Users API](/users-api).
2324
- `JWT_SECRET` - secret value for JWT generator. Must be shared amongst all components.
2425

26+
Following users are hardcoded for you:
27+
28+
|| Username | Password ||
29+
|-----------------------|
30+
| admin | admin |
31+
| johnd | foo |
32+
| janed | ddd |
33+
2534
## Building and running
2635

2736
1. Update the dependencies
@@ -34,7 +43,6 @@ go build
3443
AUTH_API_PORT=8000 USERS_API_ADDRESS=http://users-api:8082 JWT_SECRET=foo ./auth-api
3544
```
3645

37-
{"username": "admin","password": "admin"}
3846
## Usage
3947

4048
```

frontend/README.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# frontend
22

3-
> UI for sample distributed TODO app
3+
UI for sample distributed TODO app build with VueJS
44

5-
## Build Setup
5+
## Configuration
6+
- `PORT` - a port the application binds to
7+
8+
## Building and running
69

710
``` bash
811
# install dependencies

todos-api/README.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# todos-api
2+
3+
This service is written in NodeJS, it provides CRUD operations over TODO entries.
4+
It keeps all the data in memory. Following API endpoints are exposed:
5+
6+
- `GET /todos?userId=id` - list all TODOs for a given user
7+
- `POST /todos` - create new TODO
8+
- `GET /todos/:taskId` - get a TODO by ID
9+
- `PUT /todos/:taskId` - modify a TODO by ID
10+
- `DELETE /todos/:taskId` - modify a TODO by ID
11+
12+
TODO object looks like this:
13+
```
14+
{
15+
id: 1,
16+
userId: 1,
17+
content: "Create new todo"
18+
}
19+
```
20+
21+
## Configuration
22+
23+
The service scans environment for variables:
24+
- `TODO_API_PORT` - the port the service takes.
25+
- `JWT_SECRET` - secret value for JWT token processing.
26+
27+
## Building and running
28+
29+
```
30+
npm install
31+
JWT_SECRET=foo TODO_API_PORT=8082 npm start
32+
```

users-api/README.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# users-api
2+
This service is written in Java with SpringBoot. It provides simple API to retrieve user data.
3+
4+
- `GET /users` - list all users
5+
- `GET /users/:username` - get a user by name
6+
7+
## Configuration
8+
9+
The service scans environment for variables:
10+
- `JWT_SECRET` - secret value for JWT token processing.
11+
- `SERVER_PORT` - the port the service takes.
12+
13+
## Building and running
14+
15+
```
16+
./mvnw clean install
17+
JWT_SECRET=foo SERVER_PORT=8083 java -jar target/users-api-0.0.1-SNAPSHOT.jar
18+
```

0 commit comments

Comments
 (0)