-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add frontend implementation for Reviewed! #2
Open
Xenowa
wants to merge
4
commits into
ballerina-guides:main
Choose a base branch
from
Xenowa:session-3-frontend
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
VITE_GRAPHQL_ENDPOINT_HTTP=http://localhost:9000/reviewed | ||
VITE_GRAPHQL_ENDPOINT_WS=ws://localhost:9000/reviewed | ||
|
||
# For SSL Enabled endpoints | ||
# VITE_GRAPHQL_ENDPOINT_HTTP=https://localhost:9000/reviewed | ||
# VITE_GRAPHQL_ENDPOINT_WS=wss://localhost:9000/reviewed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,63 @@ | ||
# Frontend implementation for Reviewed! | ||
|
||
## Overview | ||
|
||
This is the frontend implementation for Reviewed!. It consists of a React application that works with a Ballerina GraphQL backend. It uses the Apollo Client on the frontend to connect to the GraphQL backend. | ||
|
||
## Get Started | ||
|
||
There are two ways to instantly serve up the frontend application: | ||
|
||
1. Serve the application using NodeJS. | ||
|
||
```bash | ||
npx serve dist --single --listen 3000 | ||
``` | ||
|
||
2. Serve the application using Python. | ||
|
||
```bash | ||
python -m http.server 3000 --directory dist | ||
``` | ||
|
||
> Note: URL rewriting is not supported when serving the production build using Python. Also, the contents of ErrorPage.jsx will not render for invalid URLs. | ||
|
||
- Open the browser and navigate to: [http://localhost:3000](http://localhost:3000) | ||
|
||
## Running the Application in Development Mode | ||
|
||
### Prerequisites | ||
|
||
Install the following software. | ||
|
||
- [Node.js (version v20.12.0)](https://nodejs.org/en/blog/release/v20.12.0) | ||
- [npm (version 10.5.0 or later)](https://www.npmjs.com/package/npm) | ||
|
||
### Steps | ||
|
||
1. Install the required project dependencies by running the following command. | ||
|
||
```bash | ||
npm install | ||
``` | ||
|
||
2. To change the backend endpoints, update the environment variables in the `.env` file. | ||
|
||
```.env | ||
VITE_GRAPHQL_ENDPOINT_HTTP=http://localhost:9000/reviewed | ||
VITE_GRAPHQL_ENDPOINT_WS=ws://localhost:9000/reviewed | ||
``` | ||
|
||
3. Start the application. | ||
|
||
```bash' | ||
npm run dev | ||
``` | ||
|
||
4. Open the browser and navigate to [http://localhost:3000](http://localhost:3000). | ||
|
||
5. To deploy the application, create a production build by running the following command. | ||
|
||
```bash | ||
npm run build | ||
``` | ||
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.4 KB
session-3/frontend/dist/assets/quicksand-latin-400-normal-UA8GZWWY.woff2
Binary file not shown.
Binary file added
BIN
+19.7 KB
session-3/frontend/dist/assets/quicksand-latin-400-normal-cOvQkyzV.woff
Binary file not shown.
Binary file added
BIN
+20 KB
session-3/frontend/dist/assets/quicksand-latin-ext-400-normal-Dr17GbVs.woff
Binary file not shown.
Binary file added
BIN
+14.6 KB
session-3/frontend/dist/assets/quicksand-latin-ext-400-normal-dVGbDDrC.woff2
Binary file not shown.
Binary file added
BIN
+7.25 KB
session-3/frontend/dist/assets/quicksand-vietnamese-400-normal-CuU2vBN1.woff
Binary file not shown.
Binary file added
BIN
+5.08 KB
session-3/frontend/dist/assets/quicksand-vietnamese-400-normal-SBD_i_7S.woff2
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Reviewed!</title> | ||
<script type="module" crossorigin src="/assets/index-CelfHX13.js"></script> | ||
<link rel="stylesheet" crossorigin href="/assets/index-Cp-0kh0u.css"> | ||
</head> | ||
|
||
<body> | ||
<div id="root"></div> | ||
|
||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Reviewed!</title> | ||
</head> | ||
|
||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.jsx"></script> | ||
</body> | ||
|
||
</html> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually, I think we can elaborate a bit on the underlying implementation. E.g., we can a screenshot of each page, mention the GraphQL query, any additional processing we do on the response, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not required for this first iteration.