Skip to content
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

React & Node.js #16

Merged
merged 152 commits into from
Feb 16, 2021
Merged

React & Node.js #16

merged 152 commits into from
Feb 16, 2021

Conversation

Jl5her
Copy link
Member

@Jl5her Jl5her commented Feb 16, 2021

Split up backend and frontend to operate independently and function cooperatively.

  • Converted Flask backend to node.js (express) API-based backend.
    • Now running in an EBS deployment group that can be scaled
  • Convert frontend to React and using fetch calls to retrieve competition data.
    • Hosted in a static S3 bucket

Comment on lines 7 to 9
<meta name="theme-color" content="#000000" />
<meta name="description" content="Web site created using create-react-app" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/images/logo192.png" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine for now. We might want to deal with analytics in the next major push.

Copy link
Member

@brad-cooley brad-cooley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of code cleanup and standardizing of methods mainly. Besides that, looks really good.

background: var(--blue);
border-radius: 15px;
height: 18px;
margin-top: -6px;
transition: width .6s ease;
transition: wiedth .6s ease;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo?

@@ -0,0 +1,25 @@
{
"short_name": "Abacus",
"name": "Create React App Sample",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update this?

Comment on lines 23 to 27
// "env": {
// "browser": true,
// "es2021": true
// },
// "plugins": ["react", "@typescript-eslint"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need this?


app.use(cors())
app.use(bodyParser.json())
// app.use(bodyParser.urlencoded({ extended: true }))
Copy link
Member

@brad-cooley brad-cooley Feb 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need this? Specifically line 24.

README.md Outdated
- Backend and frontend run as two seperate processes. You have two choices here
- From the repo root directory, open one terminal and run `npm run dev`
- Open two terminals (or command prompt). In one terminal run `npm start` from the `frontend` directory and in the other terminal, run `npm run dev` from the `backend` directory.
- After running the frontend (eitehr way) the terminal should open a new web browser window to `localhost:3000`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type. Should be "either"

Comment on lines 21 to 27
{/* {!hasAccess('blue') ?
<>
<DefaultNavigation />
<Container text className="main">
<Unauthorized />
</Container>
</> :*/} <>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for this either because we have the logic built in below?

</Switch>
</Container>
</>
{/* } */}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code cleanup.

Comment on lines 23 to 36
{/* <a
{% if submissions['status'] == "accepted" or submissions['status'] == "pending" or not(is_logged_in()) %}
class="icon button ui disabled"
{% else %}
href="/gold/problems/{{ problem.id }}/submit" id="submit" class = "icon button ui"
{% endif %}
data-tooltip="Submit" data-position="top center" data-inverted="">
<i class="upload icon"></i>
Submit
</a> */}
{/* <a class="icon button ui" id="stats" data-tooltip="Stats" data-position="top center" data-inverted="">
<i class="chart bar icon"></i>
Stats
</a> */}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove old Jinja code.

<Block size='xs-12'>
<Form>
<Input value="scratch" style={{ display: 'none' }} />
<Input style={{ display: 'none' }} /> {/* value={getuserinfo('scratch_username')}/>*/}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this?

Comment on lines 15 to 17
{/* {% for problem in problems %}
<option value="{{ problem['problem_id'] }}">{{ problem['problem_name'] }}</option>
{% endfor %} */}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Old Jinja code?

Copy link
Member Author

@Jl5her Jl5her left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Removed commented code that is no longer needed.
  • Fixed typos (width, and either),
  • Moved check.svg, cross.svg, and question.svg to src/assets rather than using open.kattis.com
  • Update JSX.Element returned functions to specify so
  • Updated gold Jinja to rudimentary React

@Jl5her Jl5her merged commit 140e8f8 into master Feb 16, 2021
@Jl5her Jl5her deleted the react branch February 16, 2021 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants