diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..5bc539d --- /dev/null +++ b/.eslintrc @@ -0,0 +1,47 @@ +{ + "parser": "@typescript-eslint/parser", + "extends": [ + "plugin:react/recommended", + "plugin:@typescript-eslint/recommended", + "prettier", + "plugin:react-hooks/recommended", + "plugin:prettier/recommended" + ], + "plugins": ["@typescript-eslint", "react", "prettier", "react-hooks"], + "parserOptions": { + "ecmaVersion": 11, + "sourceType": "module", + "ecmaFeatures": { + "jsx": true + } + }, + "rules": { + "react-hooks/rules-of-hooks": "error", + "react-hooks/exhaustive-deps": "warn", + "comma-dangle": ["error", "only-multiline"], + "react/prop-types": "off", + "react/display-name": "off", + "@typescript-eslint/explicit-function-return-type": "off", + "prettier/prettier": ["error", { "endOfLine": "auto" }], + "@typescript-eslint/interface-name-prefix": "off", + "@typescript-eslint/ban-ts-ignore": "off", + "@typescript-eslint/explicit-module-boundary-types": "off", + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/no-explicit-any": "error", + "@typescript-eslint/no-var-reqiures": "off", + "react/jsx-uses-react": "off", + "react/react-in-jsx-scope": "off" + }, + "settings": { + "react": { + "pragma": "React", + "version": "detect" + } + }, + "env": { + "browser": true, + "es6": true, + "jest": true + }, + "root": true +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..93a5548 --- /dev/null +++ b/.gitignore @@ -0,0 +1,107 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# Next.js build output +.next + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and *not* Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Package-lock +package-lock.json diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..df07c23 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,11 @@ +# Ignore artifacts: +build +coverage + +# Ignore all HTML files: +*.html + +# Ignore all eslint and prettier files: +*.json +*.prettierignore +*.eslintrc diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..c651400 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,9 @@ +{ + "endOfLine": "auto", + "semi": true, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "es5", + "printWidth": 100, + "arrowParens": "always" +} diff --git a/SetUpBackend.md b/SetUpBackend.md new file mode 100644 index 0000000..1bc3ba9 --- /dev/null +++ b/SetUpBackend.md @@ -0,0 +1,29 @@ +# Setup backend locally + +1. Go to https://github.com/vitaly-sazonov/kanban-rest +2. Clone this repo to your pc +3. Install git and NodeJS, if you don't have them +4. Install Docker Desktop for Windows (or another OS), than reboot +https://docs.docker.com/desktop/windows/install/ +5. Open Docker and install WSL 2 based engine, than reboot +6. Open Docker and wait few seconds for the daemon to start. (you always need to run docker daemon for backend) +7. Write in gitbash\console in kanban-rest directory "docker-compose up" to start backend + +# Deploy backend +1. Open cmd\gitbash: +git clone https://github.com/vitaly-sazonov/kanban-rest +git switch source +heroku create --region eu +heroku addons:create heroku-postgresql:hobby-dev +heroku config:set NPM_CONFIG_PRODUCTION=false +heroku config:set LOG_CONSOLE=false +heroku config:set LOG_ERR_LEVEL=warn +heroku config:set LOG_INFO_LEVEL=info +heroku config:set JWT_SECRET_KEY=secret-key +heroku config:set SALT_SIZE=10 +heroku config:set USE_FASTIFY=true +heroku git:remote -a bublikbackend +git push heroku source:master + +# Deployed backend url +https://bublikbackend.herokuapp.com/ diff --git a/package.json b/package.json new file mode 100644 index 0000000..d2ecb65 --- /dev/null +++ b/package.json @@ -0,0 +1,59 @@ +{ + "name": "project-management-app", + "version": "0.1.0", + "private": true, + "dependencies": { + "@reduxjs/toolkit": "^1.8.1", + "@types/react-beautiful-dnd": "^13.1.2", + "jwt-decode": "^3.1.2", + "react": "^18.1.0", + "react-beautiful-dnd": "^13.1.0", + "react-dom": "^18.1.0", + "react-hook-form": "^7.31.1", + "react-redux": "^8.0.1", + "react-router-dom": "^6.3.0", + "react-scripts": "5.0.1" + }, + "scripts": { + "start": "cross-env HTTPS=true react-scripts start", + "build": "react-scripts build", + "test": "react-scripts test", + "eject": "react-scripts eject" + }, + "eslintConfig": { + "extends": [ + "react-app", + "react-app/jest" + ] + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + }, + "devDependencies": { + "@testing-library/jest-dom": "^5.16.4", + "@testing-library/react": "^13.1.1", + "@testing-library/user-event": "^14.1.1", + "@types/jest": "^27.4.1", + "@types/node": "^17.0.30", + "@types/react": "^18.0.8", + "@types/react-dom": "^18.0.3", + "@typescript-eslint/eslint-plugin": "^5.16.0", + "@typescript-eslint/parser": "^5.16.0", + "cross-env": "^7.0.3", + "eslint-config-prettier": "^8.5.0", + "eslint-config-react": "^1.1.7", + "eslint-plugin-prettier": "^4.0.0", + "prettier": "2.6.0", + "sass": "^1.51.0", + "typescript": "^4.6.4" + } +} diff --git a/public/_redirects b/public/_redirects new file mode 100644 index 0000000..78f7f20 --- /dev/null +++ b/public/_redirects @@ -0,0 +1 @@ +/* /index.html 200 \ No newline at end of file diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..bda0479 Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..86d126e --- /dev/null +++ b/public/index.html @@ -0,0 +1,19 @@ + + + + + + + + + + Project Management App + + + +
+ + diff --git a/public/manifest.json b/public/manifest.json new file mode 100644 index 0000000..1f2f141 --- /dev/null +++ b/public/manifest.json @@ -0,0 +1,15 @@ +{ + "short_name": "React App", + "name": "Create React App Sample", + "icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..e9e57dc --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,3 @@ +# https://www.robotstxt.org/robotstxt.html +User-agent: * +Disallow: diff --git a/src/App.scss b/src/App.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/App.test.tsx b/src/App.test.tsx new file mode 100644 index 0000000..7fe2a47 --- /dev/null +++ b/src/App.test.tsx @@ -0,0 +1,50 @@ +import { Provider } from 'react-redux'; +import { MemoryRouter } from 'react-router-dom'; +import { render, screen } from '@testing-library/react'; +import { store } from './app/store'; + +import { App } from './App'; +import { Header } from './components/layout/header/Header'; +import { Footer } from './components/layout/footer/Footer'; + +describe('Layout', () => { + // it('Header', () => { + // render( + // + //
+ // + // ); + + // const HEADER = screen.getByTestId('header'); + // expect(HEADER).toBeInTheDocument(); + + // const HEADER_BTNS = screen.getAllByTestId('PrimaryButton'); + // expect(HEADER_BTNS.length).toBe(2); + // }); + + it('Footer', () => { + render( + +