diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..9a874b5 Binary files /dev/null and b/.DS_Store differ diff --git a/.eslintrc.js b/.eslintrc.js index 341c937..8abcefc 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -28,6 +28,7 @@ module.exports = { 'react/prop-types': 'off', 'react/jsx-uses-react': 'off', 'react/react-in-jsx-scope': 'off', + '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/explicit-module-boundary-types': 'off', }, } diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e822d33..f467a74 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,7 +1,10 @@ +name: helm_ci + on: push: branches: - main + - develop jobs: build-and-test: diff --git a/.gitignore b/.gitignore index e3fbd98..fb40ccb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ build node_modules +.vscode diff --git a/.hintrc b/.hintrc new file mode 100644 index 0000000..2fa1a2e --- /dev/null +++ b/.hintrc @@ -0,0 +1,13 @@ +{ + "extends": [ + "development" + ], + "hints": { + "axe/forms": [ + "default", + { + "select-name": "off" + } + ] + } +} \ No newline at end of file diff --git a/README.md b/README.md index c947e9c..14119bb 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,27 @@ # helm_bookstore_app -Add books to a shelf, read later, edit the book information, and categorize your books. +

+This is an MVP version of a bookstore where you can keep all your favorite books together in one easy to manage place. You can Add more books, View a book's details, Update a book's information, and Delete it from your collection. This version allows your to do all these functionalities with ease. +

+ +**Application Functionality** + +![App Functionality](/src/assets/images/helm_bookstore.gif) + +**Application Setup Instructions** + +
Make sure you have the latest version of [Node](https://nodejs.org/en/) and follow this instructions to setup and run the application on you local environment:
+ +- `git clone https://github.com/ClaytonSiby/helm_bookstore_app.git`
+- `cd helm_bookstore_app`
+- `yarn install`
+- `yarn start`
+ +**Cool dev tool** + +
+ This repository is setup to run a consistent default code format with Prettier and linting with Eslint. Before commit, lint-staged and Husky is ured run enforce these rules so that every commit adheres to the standards set for everyone contributing to the repository. +
+ +**Husky and Lint-Stage Sample** + +![husky-lint](/src/assets/images/husky-lintstaged.png) diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..e2bbda4 --- /dev/null +++ b/jest.config.js @@ -0,0 +1,5 @@ +/** @type {import('ts-jest').JestConfigWithTsJest} */ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'jsdom', +} diff --git a/package.json b/package.json index 75a00d8..8590bae 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "bookstore app pulling data from the helm_bookstore_api", "main": "index.js", "scripts": { - "test": "test", + "test": "jest", "start": "webpack serve --config webpack/webpack.config.js --env env=dev", "build": "webpack --config webpack/webpack.config.js --env env=prod", "lint": "eslint --fix \"./src/**/*.{js,jsx,ts,tsx,json}\"", @@ -12,24 +12,45 @@ }, "author": "ClaytonSiby", "license": "ISC", + "engines": { + "node": "18.18.0", + "npm": "9.8.1" + }, "dependencies": { + "@testing-library/jest-dom": "^6.1.3", + "add": "^2.0.6", "react": "^18.2.0", - "react-dom": "^18.2.0" + "react-dom": "^18.2.0", + "react-router-dom": "^6.16.0", + "react-scripts": "^5.0.1", + "react-spinners": "^0.13.8", + "yarn": "^1.22.19" }, "devDependencies": { "@babel/core": "^7.23.0", + "@babel/plugin-proposal-private-property-in-object": "^7.21.11", + "@babel/plugin-syntax-flow": "^7.22.5", + "@babel/plugin-transform-private-property-in-object": "^7.22.11", + "@babel/plugin-transform-react-jsx": "^7.22.15", "@babel/preset-env": "^7.22.20", "@babel/preset-react": "^7.22.15", "@babel/preset-typescript": "^7.23.0", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.11", + "@popperjs/core": "^2.11.8", "@reduxjs/toolkit": "^1.9.7", "@testing-library/react": "^14.0.0", + "@types/jest": "^29.5.5", + "@types/mocha": "^10.0.2", "@types/react": "^18.2.25", "@types/react-dom": "^18.2.11", "@typescript-eslint/eslint-plugin": "^6.7.4", "@typescript-eslint/parser": "^6.7.4", + "autoprefixer": "^10.4.16", "axios": "^1.5.1", + "axios-mock-adapter": "^1.22.0", + "babel-jest": "^29.7.0", "babel-loader": "^9.1.3", + "bootstrap": "^5.3.2", "css-loader": "^6.8.1", "eslint": "^8.51.0", "eslint-config-prettier": "^9.0.0", @@ -41,10 +62,19 @@ "eslint-plugin-react-hooks": "^4.6.0", "html-webpack-plugin": "^5.5.3", "husky": "4", + "jest": "^29.7.0", + "jest-environment-jsdom": "^29.7.0", "lint-staged": "^14.0.1", + "postcss": "^8.4.31", + "postcss-loader": "^7.3.3", "prettier": "^3.0.3", + "react-redux": "^8.1.3", "react-refresh": "^0.14.0", + "react-test-renderer": "^18.2.0", + "sass": "^1.69.1", + "sass-loader": "^13.3.2", "style-loader": "^3.3.3", + "ts-jest": "^29.1.1", "typescript": "^5.2.2", "webpack": "^5.88.2", "webpack-cli": "^5.1.4", diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000..c328838 Binary files /dev/null and b/src/.DS_Store differ diff --git a/src/App.tsx b/src/App.tsx index 6541568..6975bcd 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,7 +1,25 @@ -import './styles.css' +import { BrowserRouter as Router, Routes, Route } from 'react-router-dom' +import BookList from './components/BookList' +import UpdateBook from './components/UpdateBook' +import Navbar from './components/Navbar' +import Footer from './components/Footer' +import './assets/styles/main.scss' -const App = () => { - return

Helm BookStore

+const App: React.FC = () => { + return ( + <> + +
+ + + } /> + } /> + + +
+