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

my wizeline project2 #9

Open
wants to merge 55 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
e5c178f
Rename index.jsx to index.js
erickwize Mar 8, 2021
0d8a95b
Update README.md
erickwize Mar 9, 2021
f41ff17
adding my next and chakra project
JesusDuarte-inv Mar 20, 2021
eee1921
adding my next and chakra project
JesusDuarte-inv Mar 20, 2021
3288576
changin raedme
JesusDuarte-inv Mar 20, 2021
709c523
adding styled title
JDuarthe Mar 20, 2021
24635fd
adding challenge2 questions in readme
JDuarthe Mar 20, 2021
e8abedf
adding testing into my project
JDuarthe Mar 20, 2021
71713f3
updated json
JDuarthe Mar 20, 2021
594468b
config changes
JDuarthe Mar 20, 2021
97d7c1f
trying to solving the deploy problem
JDuarthe Mar 20, 2021
e27c133
Update src/components/Layout/Layout.jsx
JDuarthe Mar 24, 2021
65912d1
Update src/components/CardList/CardList.jsx
JDuarthe Mar 24, 2021
6e2a3b1
Update src/components/CardList/CardList.jsx
JDuarthe Mar 24, 2021
0cc639d
Update src/components/CardList/CardList.jsx
JDuarthe Mar 24, 2021
2f3f5a6
Update src/components/Navbar/NavBar.jsx
JDuarthe Mar 24, 2021
e031f33
challenge2 changes
JDuarthe Mar 27, 2021
501595c
fixing key
JDuarthe Mar 27, 2021
d375350
challenge3
Apr 2, 2021
55dab99
challenge4
Apr 15, 2021
7d0f191
updating production
Apr 22, 2021
d4bf7c2
challenge 5
May 3, 2021
453d238
adding next config
May 3, 2021
933e7c0
fixing deploy
May 3, 2021
c0fda13
fixing again the deploy
May 3, 2021
0422b89
trying to fix the deploy
May 3, 2021
676094a
another atempt
May 3, 2021
24acbb9
solving deploy issue
May 3, 2021
c1881d6
again
May 3, 2021
6677e62
another trying
May 3, 2021
02f86e5
another
May 3, 2021
31e43bf
another another try
May 3, 2021
89dafb3
another another another try
May 3, 2021
9553a57
whisper
May 3, 2021
fa5459c
whisper another
May 3, 2021
76a759f
last dance
May 3, 2021
486aea1
let me believe
May 3, 2021
c847868
another try whisper
May 3, 2021
b0eecbf
another error in deploy
May 3, 2021
d1bcb09
another another error deploy
May 3, 2021
104d6cd
bueno
May 3, 2021
48fe73f
a ver
May 3, 2021
de59204
asdasd
May 3, 2021
e1f3a2a
aaaaaaaaaaaa
May 3, 2021
7855b22
yolo
May 3, 2021
2b110c1
yolo1
May 3, 2021
14d9f02
here we go again
May 3, 2021
268810a
ola
May 3, 2021
d3a6ad9
cambio
May 3, 2021
25f5dd8
new changes for deploy
May 3, 2021
4787874
another try
May 3, 2021
afeef17
let me see
May 3, 2021
103c91e
come on
May 3, 2021
eb06913
close
May 3, 2021
8041307
this is it
May 3, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
API_KEY='AIzaSyBLF4iEDjnWFmKrhEtIetO5qRT2aKQqO4o'
17 changes: 0 additions & 17 deletions .eslintrc

This file was deleted.

5 changes: 5 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"env": {
"jest": true
}
}
19 changes: 15 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,31 @@
/node_modules
/.pnp
.pnp.js

node_modules
# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
# vercel
.vercel
9 changes: 0 additions & 9 deletions .prettierrc

This file was deleted.

157 changes: 22 additions & 135 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,143 +1,30 @@
# React Certification 2020
# Wizeline Challenge with Next and chakra.

## Introduction
This example features how to use [chakra-ui](https://github.com/chakra-ui/chakra-ui) as the component library within a Next.js app.

Thank you for participating in the React Certification 2020 course! Here you'll find instructions for completing your certification.

## The challenge

The purpose of the challenge is for you to demonstrate your React skills. This is your chance to show off everything you've learned during the course and to earn your certification!!

The idea is that you build and deliver a **whole** React application on your own. We don't want to limit you by providing some "fill in the blanks" exercises, but instead request you to build it from scratch! We hope you find this exercise challenging and engaging.

The goal is to build a YouTube client app.

We've created a demo application: https://react-certification-2020.netlify.app/

> **NOTE:* Use `wizeline` as the username and `Rocks!` as the password to log in*

We won't share its source-code until after the certification is complete and all the participants deliver their own implementations (we don't want to bias your solution).

You should use this application just as a guide and as a trigger for your own ideas. It's not mandatory to reproduce the exact functionalities nor the same styling; this is **YOUR** project and you can be creative in the way you build it.

### Requirements

These are the main requirements we will evaluate from your deliverable:

- Use all that you've learned in the course:
- Functional Components
- React Hooks
- Custom Hooks
- State Management with React Context
- Styled Components
- React Router
- Public and private routes
- Fetch results from YouTube API (keep reading for more details)
- Search videos by name
- User Authentication (keep reading for more details)
- Unit Tests Coverage (~70%)

Try to keep the use of 3rd party libraries to the minimum, especially the ones related to the topics covered in the course.

E.g., you can use some CSS framework (such as Bootstrap) if that makes you feel more comfortable and move faster, but we will still want you to develop and deliver meaningful styled-components.

## Getting Started

We have provided some general React boilerplate in this repository.

The provided codebase is not directly related to the challenge topic, but you can use it as a guide for structuring your application. Feel free to add, remove, or change anything if you consider it necessary.

To get started, follow these steps:
- Fork this project.
- Create the YouTube API credential and configure the client SDK (more details below).
- Commit periodically.
- Have fun!

### YouTube API

In order to fetch videos from YouTube you need to create a new project using the Google console, and then create an API key for consuming the API.

**Step 1:** Follow the [YouTube API v3 getting-started guide](https://developers.google.com/youtube/v3/getting-started) to get your API credentials.

> **NOTE:* You only need to complete the steps 1, 2 and 3 in the guide to get your API_KEY*

**Step 2:** After configuring the API key, you can read the [YouTube JavaScript client getting-started documentation](https://github.com/google/google-api-javascript-client/blob/master/docs/start.md) to get examples about how to consume the API.


### Authentication with Mocked Login

Authentication is not directly covered on this course's topics; that's why we are not requesting you to integrate with a real authentication provider (such as Auth0, OAuth, etc.).

Instead, we want you to explore how to set up your application to handle this kind of requirement: sharing the logged-in user state, define public and private routes, display content based on the authenticated user, etc.

You can use this mocked-login function in your application; just provide in the UI a way to capture the username and password values, and then handle the success and error cases (e.g. create a React Context to provide your logged-in user to the rest of the application).

```javascript
// login.api.js

const mockedUser = {
id: '123',
name: 'Wizeline',
avatarUrl: 'https://media.glassdoor.com/sqll/868055/wizeline-squarelogo-1473976610815.png',
};

export default async function loginApi(username, password) {
return new Promise((resolve, reject) => {
setTimeout(() => {
if (username === 'wizeline' && password === 'Rocks!') {
return resolve(mockedUser);
}
return reject(new Error('Username or password invalid'));
}, 500);
});
}
## Challenge2 Questions
Using create-react-app, what do we need to set up for testing?
```bash
Nothing, create-react-app has all that you need to test with jest
```
What components are worth to test in your development?
```bash
All of them, at the very least, make sure the component renders without error.
```
Can you apply TDD once you already created components?
```bash
Sure, you have to test the components that you has created
```

## Deliverables

We provide the delivery dates so you can plan accordingly; please take this challenge seriously and try to make progress constantly.

It’s worth mentioning that you’ll ONLY get feedback from the review team for your first deliverable, so you will have a chance to fix or improve the code based on our suggestions.

For the final deliverable, we will provide some feedback to but there is no extra review date, so if you are struggling with something try to get some help beforehand with your peers or by using the academy-reactcert2020 slack channel.


### First Deliverable (due September 28th 23:59PM)

- Login
- Implement the Mocked Login and store the logged-in user in a global accessible Context.

- Home View
- Search and display videos using Youtube API.

- Video Details View
- Display the selected video and its information.
- Display a list of related videos.

- Favorite Videos
- Allow users to mark videos as favorites.
- Display the favorite videos on a private route.
- Allow users to see the details of that video.

>**Important:* what’s listed in this deliverable is just for guidance and to help you distribute your workload; you can deliver more or fewer items if necessary.

### Final Deliverable (due October 5th 23:59PM)

- Finish any pending functionality or address any comment you receive from your previous deliverable.

- Style your views using styled-components; use any 3rd party CSS framework if necessary.

- Unit Testing
- Create tests for your application
- Coverage must be at least 70%


## Submitting the deliverables

For submitting your work, you should follow these steps:
1. Create a pull request with your code, targeting the master branch of the repository [react-certification-2020](https://github.com/wizelineacademy/react-certification-2020).
2. Deploy your application code to any hosting service (we suggest you use Netlify or any other free hosting provider you want to use like Firebase, etc.).
3. Fill out this form and provide the requested information: https://forms.gle/ePnLR2xNVc3M1HLu8
## How to use

> **Important:* Don't forget to include any additional information that might be necessary for running your code (e.g. test user credentials, etc).
```bash
npm install
npm dev
# or
yarn
yarn dev
```

20 changes: 20 additions & 0 deletions TestResult.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
PASS src/components/CardList/CardList.test.jsx
PASS src/components/Title/Title.test.jsx
PASS src/components/Navbar/NavBar.test.jsx
---------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
---------------|---------|----------|---------|---------|-------------------
All files | 100 | 100 | 100 | 100 |
Navbar | 100 | 100 | 100 | 100 |
NavBar.jsx | 100 | 100 | 100 | 100 |
SideMenu | 100 | 100 | 100 | 100 |
SideMenu.jsx | 100 | 100 | 100 | 100 |
Title | 100 | 100 | 100 | 100 |
Title.jsx | 100 | 100 | 100 | 100 |
---------------|---------|----------|---------|---------|-------------------

Test Suites: 3 passed, 3 total
Tests: 3 passed, 3 total
Snapshots: 0 total
Time: 4.997 s
Ran all test suites.
15 changes: 15 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
webpack: (config, { isServer }) => {
// Fixes npm packages that depend on `fs` module
if (!isServer) {
config.node = {
fs: 'empty',
}
}

return config
},
env: {
API_KEY: 'AIzaSyBLF4iEDjnWFmKrhEtIetO5qRT2aKQqO4o',
},
}
80 changes: 26 additions & 54 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,61 +1,33 @@
{
"name": "react-certification-2020",
"name": "with-chakra-ui",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^10.4.9",
"@testing-library/user-event": "^12.1.3",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.3"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"lint": "eslint ./src --ext .js,.jsx",
"lint:fix": "eslint ./src --ext .js,.jsx --fix"
},
"devDependencies": {
"eslint-config-airbnb": "^18.2.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.20.6",
"eslint-plugin-react-hooks": "^4.1.0",
"husky": "^4.2.5",
"lint-staged": "^10.2.13",
"prettier": "^2.1.1",
"pretty-quick": "^3.0.0"
"dev": "next dev",
"build": "next build",
"start": "next start",
"test": "jest --watch"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"lint-staged": {
"*.{js, jsx, css, json}": [
"yarn run lint:fix",
"pretty-quick --staged",
"git add"
]
"dependencies": {
"@chakra-ui/icons": "^1.0.0",
"@chakra-ui/react": "^1.0.0",
"@emotion/react": "^11.0.0",
"@emotion/styled": "^11.0.0",
"axios": "^0.21.1",
"formik": "^2.2.6",
"framer-motion": "^2.9.4",
"next": "^10.0.9",
"next-page-tester": "^0.24.1",
"node-fetch": "^2.6.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-icons": "^4.2.0",
"react-router-dom": "^5.2.0",
"styled-components": "^5.2.1",
"yarn": "^1.22.10"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
"license": "MIT",
"devDependencies": {},
"jest": {
"testEnvironment": "jsdom"
}
}
Binary file removed public/404.gif
Binary file not shown.
Binary file removed public/favicon.ico
Binary file not shown.
Loading