Skip to content

Commit

Permalink
move frontend to port 80, add screenshots in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Wilson committed Apr 13, 2023
1 parent 853d634 commit 1795ba4
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 13 deletions.
15 changes: 6 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This is an implementation of a scalable day trading application for UVic's Scala

## Running

`docker compose up` will get the server running. It expects your computer has 16GB of ram and allocates memory between containers accordingly.
`docker compose up` will get the server running. It expects your computer has 16GB of ram and allocates memory between containers accordingly. The frontend will be available at `http://localhost:80`

### CLI

Expand All @@ -14,14 +14,11 @@ There are downloadable binaries for the CLI on the releases pages. `cli --help`
### GUI
NextJS React Application

#### Run frontend in development mode
1. Node 16 or greater must be installed
2. Run
```sh
cd frontend
npm install
npm run dev
```
<img src="readmeimages/1.png" alt="">
<img src="readmeimages/2.png" alt="">
<img src="readmeimages/3.png" alt="">
<img src="readmeimages/4.png" alt="">
<img src="readmeimages/5.png" alt="">

## Architecture

Expand Down
10 changes: 7 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ services:
POSTGRES_PASSWORD: "daytrader"
command: postgres -c max_connections=5010 -c fsync=off -c synchronous_commit=off -c full_page_writes=false -c effective_cache_size=8GB
healthcheck:
test: ["CMD-SHELL", "sh -c 'pg_isready -U daytrader -d daytrader'"]
test:
[
"CMD-SHELL",
"sh -c 'pg_isready -U daytrader -d daytrader'"
]
interval: 5s
timeout: 5s
retries: 5
Expand All @@ -38,7 +42,7 @@ services:
condition: service_started
init: true
ports:
- "80:8000"
- "8000:8000"
quote-server-adaptor:
image: ghcr.io/marcusdunn/day-trader/quote-server-adaptor
init: true
Expand All @@ -54,4 +58,4 @@ services:
- FRONTEND_URL=http://swift-trader-frontend:3000/
- transactionURI=lean:8000
ports:
- "3000:3000"
- "80:3000"
8 changes: 8 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,11 @@ swift-trader-frontend/
├── components/ # Contains reusable UI components
└── ...
```

## Screenshots

<img src="../readmeimages/1.png" alt="">
<img src="../readmeimages/2.png" alt="">
<img src="../readmeimages/3.png" alt="">
<img src="../readmeimages/4.png" alt="">
<img src="../readmeimages/5.png" alt="">
2 changes: 1 addition & 1 deletion frontend/pages/api/clients/DayTraderClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import path from "path";
const protoPath = path.join(process.cwd(), 'pages', 'api', 'clients', 'day-trader.proto');
const def = loadSync(protoPath)
const definitions = grpc.loadPackageDefinition(def)
const DayTraderClient = new definitions.day_trader.DayTrader(process.env.transactionURI || 'localhost:80', grpc.credentials.createInsecure());
const DayTraderClient = new definitions.day_trader.DayTrader(process.env.transactionURI || 'localhost:8000', grpc.credentials.createInsecure());


export function Add(userId, amount, requestNum) {
Expand Down
Binary file added readmeimages/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readmeimages/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readmeimages/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readmeimages/4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readmeimages/5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1795ba4

Please sign in to comment.