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

React next js ssr ssg #5

Open
wants to merge 108 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
0512fa2
feat: install vite react ts template
MakaevaElena Oct 11, 2023
be5204c
feat: install Recommended libraries
MakaevaElena Oct 12, 2023
9f949a1
feat: add Eslint and prettier configurations
MakaevaElena Oct 12, 2023
8494aee
feat: configurate husky
MakaevaElena Oct 12, 2023
bb78942
feat: fetch data from pokeapi
MakaevaElena Oct 17, 2023
5c32cc7
feat: fetch and render card details - img
MakaevaElena Oct 17, 2023
d7ba01e
feat: add sass, minimum styles for pokemon list
MakaevaElena Oct 22, 2023
5276553
feat: add component Searching
MakaevaElena Oct 22, 2023
ee6b14e
feat: implement searching by name on first page
MakaevaElena Oct 23, 2023
ee8ce92
feat: add types for Pokemon from api
MakaevaElena Oct 23, 2023
f5f2d06
feat: add details to card
MakaevaElena Oct 23, 2023
aa76e5d
feat: save search value in Local Storage
MakaevaElena Oct 23, 2023
fed2037
feat: add component ErrorBoundary
MakaevaElena Oct 24, 2023
afbf6e9
feat: modified husky
MakaevaElena Oct 25, 2023
2a2b00a
feat: add validation for search input
MakaevaElena Oct 25, 2023
b6470b3
fix: search by all 1292 pokemons, partial match
MakaevaElena Oct 25, 2023
7336693
fix: searching with empty field
MakaevaElena Oct 26, 2023
97b34ea
feat: change api to rickandmortyapi
MakaevaElena Oct 26, 2023
8633864
feat: new repository name, test
MakaevaElena Oct 27, 2023
fe6078d
feat: Pokemon not found massage
MakaevaElena Oct 27, 2023
7386b57
feat: change naming from Pokemon to Rickandmorty Characters
MakaevaElena Oct 27, 2023
7363afa
feat: add Loader
MakaevaElena Oct 27, 2023
31d51e8
feat: change Loader style
MakaevaElena Oct 27, 2023
d8c45f3
fix: error boundary replace button message
MakaevaElena Oct 27, 2023
fbeb537
refactor: delete comments, crlf->lf, take outside constants
MakaevaElena Oct 29, 2023
f0b1f99
feat: change vite config, root ./
MakaevaElena Oct 29, 2023
60ce0c2
feat: change class component App to functional
MakaevaElena Oct 29, 2023
b4134c8
feat: change class Card to function
MakaevaElena Oct 30, 2023
4999f7d
feat: change class Searching to function
MakaevaElena Oct 30, 2023
95dadf5
feat: change class CharacterList to function
MakaevaElena Oct 30, 2023
c77a7d7
feat: change class Loader & TestErrorButton to function
MakaevaElena Oct 30, 2023
b06a85d
feat: add component Pagination, PageNotFound, install react-router-dom
MakaevaElena Oct 31, 2023
bdc4156
feat: implement pagination with routing
MakaevaElena Nov 1, 2023
2c76bad
feat: add outlet
MakaevaElena Nov 2, 2023
24fb3af
feat : change routing with RouteObject
MakaevaElena Nov 3, 2023
3c8e6f7
fix: pagination , return to BrowserRouter
MakaevaElena Nov 3, 2023
becf29d
feat: add close button to Info
MakaevaElena Nov 3, 2023
e05898b
feat: change useParams to useSearchParams, add query to url
MakaevaElena Nov 4, 2023
871c022
feat: add count per page
MakaevaElena Nov 5, 2023
231fd8a
rafactor: magic numbers
MakaevaElena Nov 5, 2023
53991a0
refactor: types replace to component directory
MakaevaElena Nov 5, 2023
ab7d1ac
feat: change size of left side
MakaevaElena Nov 5, 2023
e2f08aa
feat: install jest
MakaevaElena Nov 6, 2023
933bfdb
feat: install vitest, add test for Loader
MakaevaElena Nov 6, 2023
25a546e
feat: configuring vitest
MakaevaElena Nov 7, 2023
845b605
fix: sample vitest test for CharacterList
MakaevaElena Nov 7, 2023
fd031ea
feat: save in Context search_value & data
MakaevaElena Nov 8, 2023
646e57a
feat: add husky folder pre-push, test
MakaevaElena Nov 8, 2023
6ad6169
feat: add test-vitest to pre-push, test
MakaevaElena Nov 8, 2023
9830b02
fix: add test-vitest to pre-push, test
MakaevaElena Nov 8, 2023
07134cb
fix: add test-vitest to pre-push, test
MakaevaElena Nov 8, 2023
da6a621
fix: add test-vitest to pre-push, test
MakaevaElena Nov 8, 2023
f0bd029
fix: add test-vitest to pre-push, test
MakaevaElena Nov 8, 2023
465c194
fix: add test-vitest to pre-push, test
MakaevaElena Nov 8, 2023
992cbd1
fix: pre-commit, add lint-staged, test
MakaevaElena Nov 8, 2023
0c92ce0
fix: pre-push, test
MakaevaElena Nov 8, 2023
71e7b99
fix: pre-push, test
MakaevaElena Nov 8, 2023
39229a7
fix: pre-push, test2
MakaevaElena Nov 8, 2023
71abcc5
fix: pre-push, test2
MakaevaElena Nov 8, 2023
ccaf84b
fix: pre-push, test2
MakaevaElena Nov 8, 2023
c385c95
feat: add Tests for the Card List component
MakaevaElena Nov 8, 2023
8ae6436
feat: add Tests for the Card List component
MakaevaElena Nov 8, 2023
1ffcfb3
feat: add test: Ensure that the card component renders the relevant c…
MakaevaElena Nov 9, 2023
bc7dc1f
feat: add base Batton
MakaevaElena Nov 9, 2023
02e549e
feat: Tests for the Search component
MakaevaElena Nov 9, 2023
830483c
feat: add Tests for the Pagination component
MakaevaElena Nov 9, 2023
752699e
fix: gitignore
MakaevaElena Nov 10, 2023
e002df1
fix: change vitest settings --watch=false
MakaevaElena Nov 10, 2023
85e2ee0
feat: add Test for Card : Validate that clicking on a card opens a de…
MakaevaElena Nov 10, 2023
08fa676
feat: add Test for ErrorButton
MakaevaElena Nov 10, 2023
88f29db
feat: add tests for ErrorBoundary ,and render Loader while Searching
MakaevaElena Nov 11, 2023
be59e0e
feat: add test for ErrorButton click
MakaevaElena Nov 11, 2023
d2b71f4
feat: change scripts for test
MakaevaElena Nov 12, 2023
93489ac
refactor: delete comments
MakaevaElena Nov 12, 2023
ffb46f8
feat: add redux, Save search value in store
MakaevaElena Nov 13, 2023
0a30fe6
feat: Save items per page in Redux store
MakaevaElena Nov 13, 2023
df35214
refactor: separate api
MakaevaElena Nov 14, 2023
2c2a56e
feat: Save view mode value in store
MakaevaElena Nov 16, 2023
0b5dd4d
feat: Loading Flags for main, card, detailes
MakaevaElena Nov 16, 2023
344f309
feat: add rtk query api, change searching by value to query
MakaevaElena Nov 16, 2023
4553622
refactor: delete fetch in card
MakaevaElena Nov 17, 2023
7f5eea1
feat: change to rtkq in searching
MakaevaElena Nov 17, 2023
6428129
feat: change to rtkq in pagination
MakaevaElena Nov 17, 2023
57c481e
fix: eslint errors
MakaevaElena Nov 19, 2023
2154f04
feat: loading flags in the Redux store
MakaevaElena Nov 19, 2023
6a646c0
fix: tests more then 80%
MakaevaElena Nov 19, 2023
847908a
refactor: delete comments
MakaevaElena Nov 19, 2023
5ab1a8c
feractor: delete unused state cardIsLoading
MakaevaElena Nov 19, 2023
7ef32eb
fix: search value after reload
MakaevaElena Nov 19, 2023
eae94be
fix: delete comments
MakaevaElena Nov 19, 2023
a9a82b2
docs: use create-next-app
MakaevaElena Nov 20, 2023
5b452c3
feat: add Components, styles broken, use useSearchParams from next/na…
MakaevaElena Nov 20, 2023
3c04247
feat: change navigation to useRouter
MakaevaElena Nov 21, 2023
7cafeb1
fix: change router from next/navigation to next/router
MakaevaElena Nov 22, 2023
1ba156d
feat: add extractRehydrationInfo
MakaevaElena Nov 22, 2023
d5e4005
feat: ssr with getServerSideProps
MakaevaElena Nov 23, 2023
af904f3
fix: build errors, get result table
MakaevaElena Nov 23, 2023
8985fb6
feat: dlete brouser router from tests, useRouter,mock 'next/router'
MakaevaElena Nov 23, 2023
ba98533
feat: Update tests to make it work with Next.JS | 94.4 | 78.48 | …
MakaevaElena Nov 23, 2023
c2588e3
feat: update tests | 95.35 | 77.08 | 88.09 | 95.35
MakaevaElena Nov 24, 2023
df5a6b1
fix: pagination countPerPage; tests | 95.97 | 84.53 | 90.69 |…
MakaevaElena Nov 24, 2023
5c11a3d
fix: searching by gSSP
MakaevaElena Nov 25, 2023
f246cb2
fix: Info get by SSR
MakaevaElena Nov 25, 2023
6e9f701
fix: pagination
MakaevaElena Nov 25, 2023
7272929
refactor: clean code, remove comments
MakaevaElena Nov 26, 2023
ae0c070
refactor: uninstall react-router-dom
MakaevaElena Nov 26, 2023
c6fc7be
feat: change husky pre-push
MakaevaElena Nov 26, 2023
cc951be
feat: change 404 page
MakaevaElena Nov 26, 2023
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
49 changes: 49 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"parser": "@typescript-eslint/parser",
"extends": [
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
"plugin:react-hooks/recommended",
"plugin:prettier/recommended"
],
"env": {
"browser": true,
"es6": true,
"jest": true,
"node": true
},
"root": true,
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "react", "prettier", "react-hooks", "@next/eslint-plugin-next"],
"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-comment": "error",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-var-requires": "off",
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off"
},
"settings": {
"react": {
"pragma": "React",
"version": "detect"
}
}
}
62 changes: 62 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# 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

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
coverage
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

# npm test
npx lint-staged
5 changes: 5 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx vitest --coverage --watch=false
# npx lint-staged
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"endOfLine": "auto",
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"printWidth": 100,
"arrowParens": "always"
}
41 changes: 40 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,40 @@
# Pokeapi_React_2023_Q4
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
6 changes: 6 additions & 0 deletions desktop.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[.ShellClassInfo]
IconResource=C:\Windows\System32\SHELL32.dll,144
[ViewState]
Mode=
Vid=
FolderType=Generic
17 changes: 17 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export const BASE_URL = 'https://rickandmortyapi.com/api/';

/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'rickandmortyapi.com',
port: '',
},
],
},
};

export default nextConfig;
Loading