Skip to content
Snippets Groups Projects
Commit 0885a2f2 authored by Andrej Rasevic's avatar Andrej Rasevic
Browse files

adding final exam info and project 5

parent 438616a8
No related branches found
No related tags found
No related merge requests found
## Final Exam Friday, July 8th, 2022 8:30 AM EST - 10:30 AM EST
### Details
1. Duration - 120 minutes, starting during our scheduled class meeting time 8:30 AM EST and ending at 10:30 AM EST in our normal lecture room.
2. closed book,notes, browser, etc. - do not consult with anyone during the exam.
### Format
Format (possibilities):
* short answer
* multiple choice
* true/false
* code analysis/completing code snippets
* coding
### Suggested Topics to review
1. HTML5 (https://www.w3schools.com/html/default.asp)
* tags discussed in class/code examples (table, list, a, form, input, div, h's, script, body, head, span, fieldset, ...etc.)
* associated attributes for each tag element listed above
* forms, lists (ordered and unordered), tables
* DOM (what is it?)
* attaching events/handlers to elements in a web page
* data validation
* box model
* default behavior
2. CSS (https://www.w3schools.com/css/default.asp)
* class/id selectors
* child/ancestor selectors
* rule definitions
3. Javascript
* variable declaration
* var,let,const (how are they different from one another)
* variable scopes
* function declaration
* call, bind, apply
* javascript objects
* seal, freeze
* arrays
* map, reduce, filter, sort, find
* spread/rest operator
* array/object destructuring
* arrow functions
* `this` , function execution context
* template literals
* ES6 Classes and Inheritance
* modules
* promises
* async await
* webAPI (document.querySelector, etc...) https://developer.mozilla.org/en-US/docs/Web/API
* different ways javascript interacts with a web page
* the javascript Event loop and the order in which asynchronous code gets executed in Javascript
4. React
* class component declaration (be able to write your own component)
* ReactDOM.render()
* JSX (https://reactjs.org/docs/jsx-in-depth.html)
* state
* props
* component lifecycle Methods
* lifting state from child to parent
* fetch - what it is and how we used it
* data validation on the client
5. Node/Express/API
* "proper" layout of an express api
* app.js
* middleware - what is it and how does it get invoked and where
* flow of middleware - what are the parameters it takes
* what triggers the end of the request-response transaction
* mongoose/schema what role ORM's play in our application stack
* HTTP verbs we discussed (GET, POST, PUT, DELETE) what actions they correspond to, what the request gets attached to
* diffence between url params and query params (where are they placed in the request)
__Suggestions:__
* review the tic-tac-toe tutorial on the React website (https://reactjs.org/tutorial/tutorial.html)
* review projects/exercises
* go over the midterm
* api examples
__Note:__ This is a suggested listed but by no means necessarily a complete list of topics for the final exam.
### Topics not included on the exam
* git
* text editors
* postman
* curl
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Project 5: React Search/Filter application
## Due Date: Friday July 8th, 2022 11:55 PM
__(There will be no submissions accepted after this deadline)__
## Objectives: To become aquainted with React components, state, and JSX, practice array functions (filter, map, reduce, etc..)
## Specifications/Requirements
We have provided you with a complete React application bootstrapped with the react cli tool. To complete this project you need to create 2 components: List and Search.
The Search component will display a text input box that will allow the user to enter a city or state. As the user enters data the application will display a live list of results that match the current text in the input field. We have provided you with the fetch request inside of the componentDidMount lifecycle method in `Search.js`. Do not change or add any code to this method. You are responsible for taking the results from this request to check against the results from the fetch request.
Hint: you will need to define a handler to respond to an onChange event triggered inside of the input box. Additionally, once you retrieve it's value you will want to check to see if it matches the results from the fetch request using a regular expression. Here is a reference to regular expressions in javascript as well as an online tester:
https://www.w3schools.com/jsref/jsref_obj_regexp.asp
https://regex101.com/
Once you have stored the matched data you will then pass them to the List component.
In List.js you will create the component that will create an unordered list and display each matched item inside of it.
Note: React requires entries in an unordered list to contain a "key" property that must be unique. For more information on lists and keys in React, read over the official documentation:
https://reactjs.org/docs/lists-and-keys.html
Hint: the List component will be receiving the collection of matched data as a prop. Additionally, for each list item the component will display the data in the following format: ```<city> - <state>```. To know how to retrieve those values from the request object, inspect the JSON object in the console.
__Note: In order to run the application run ```npm install``` and then ```npm start``` in the top level directory of the exercise and open a browser and navigate to localhost:3000 in order to see your application running. You can copy paste the endpoint to see the JSON objects__
\ No newline at end of file
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `npm start`
Runs the app in the development mode.<br>
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.<br>
You will also see any lint errors in the console.
### `npm test`
Launches the test runner in the interactive watch mode.<br>
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build`
Builds the app for production to the `build` folder.<br>
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.<br>
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).
### Code Splitting
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
### Analyzing the Bundle Size
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
### Making a Progressive Web App
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
### Advanced Configuration
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
### Deployment
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
### `npm run build` fails to minify
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
Source diff could not be displayed: it is too large. Options to address this: view the blob.
{
"name": "exercise4",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-scripts": "3.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Exercise 4</title>
</head>
<body>
<div id="root"></div>
</body>
</html>
import React from "react";
import Search from "./components/Search";
function App() {
return <Search />;
}
export default App;
import React, { Component } from "react";
class List extends Component {
}
import React, { Component } from "react";
class Search extends Component {
/* DO NOT MODIFY */
componentDidMount() {
const allPlaces = [];
const endpoint =
"https://gist.githubusercontent.com/Miserlou/c5cd8364bf9b2420bb29/raw/2bf258763cdddd704f8ffd3ea9a3e81d25e2c6f6/cities.json";
fetch(endpoint)
.then(data => data.json())
.then(results => {
allPlaces.push(...results)
this.setState({ places: allPlaces })
})
.catch(error => console.log(error));
}
}
\ No newline at end of file
import React from "react";
import ReactDOM from "react-dom";
import App from "./App";
ReactDOM.render(<App />, document.getElementById("root"));
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment