Skip to content

Commit

Permalink
Added week-4 assignments
Browse files Browse the repository at this point in the history
  • Loading branch information
100xdevs-admin committed Jul 3, 2023
1 parent 004324b commit 131fd44
Show file tree
Hide file tree
Showing 32 changed files with 4,167 additions and 0 deletions.
15 changes: 15 additions & 0 deletions week-4/01-easy-todo-app/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
],
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
settings: { react: { version: '18.2' } },
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': 'warn',
},
}
24 changes: 24 additions & 0 deletions week-4/01-easy-todo-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
18 changes: 18 additions & 0 deletions week-4/01-easy-todo-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

### Assignment 1
Create the frontend for a TODO app.
You should be able to
1. Create a new TODO
2. List all TODOs
3. Delete a TODO

The backend we've already written in
/week2/02-nodejs/solutions/todoServer.solution.js

Make sure you
1. Add app.listen so it is running on 3000
2. Use cors

Good to do
1. Break things down into components
2. Use a library like axios to make the requests
13 changes: 13 additions & 0 deletions week-4/01-easy-todo-app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
26 changes: 26 additions & 0 deletions week-4/01-easy-todo-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "01-easy-todo-app",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint src --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/react": "^18.0.37",
"@types/react-dom": "^18.0.11",
"@vitejs/plugin-react": "^4.0.0",
"eslint": "^8.38.0",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.3.4",
"vite": "^4.3.9"
}
}
1 change: 1 addition & 0 deletions week-4/01-easy-todo-app/public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
27 changes: 27 additions & 0 deletions week-4/01-easy-todo-app/src/App.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { useState } from 'react'
import reactLogo from './assets/react.svg'
import viteLogo from '/vite.svg'
import './App.css'

function App() {
const [todos, setTodos] = useState([])
// fetch all todos from server

return (
<>
<div>
<h1>Easy Todo App</h1>
<input type="text" />
</div>
</>
)
}

function Todo(props) {
// Add a delete button here so user can delete a TODO.
return <div>
{props.title}
</div>
}

export default App
1 change: 1 addition & 0 deletions week-4/01-easy-todo-app/src/assets/react.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
10 changes: 10 additions & 0 deletions week-4/01-easy-todo-app/src/main.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.jsx'
import './index.css'

ReactDOM.createRoot(document.getElementById('root')).render(
<React.StrictMode>
<App />
</React.StrictMode>,
)
7 changes: 7 additions & 0 deletions week-4/01-easy-todo-app/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
})
Loading

0 comments on commit 131fd44

Please sign in to comment.