Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
709bb46
init: start task #1
maiano Jul 4, 2025
6909a9f
chore: create config
maiano Jul 4, 2025
6e48a63
chore: add pull request template
maiano Jul 5, 2025
f4c1137
fix: delete unused code
maiano Jul 5, 2025
caf005b
chore: change gitignore
maiano Jul 5, 2025
ce9cc3b
feat: create header component
maiano Jul 6, 2025
7bcab55
feat: create SearchBar component
maiano Jul 6, 2025
7904566
feat: create Card and CardList component
maiano Jul 7, 2025
9d0a9a7
feat: add logic for fetching data via API
maiano Jul 7, 2025
2e3a43b
feat: add ErrorBoundary component
maiano Jul 7, 2025
e8a6047
feat: add logo
maiano Jul 7, 2025
2696df3
feat: add animation for rendering cards
maiano Jul 7, 2025
0b8c407
feat: add logic to disable the button
maiano Jul 7, 2025
6e7be59
feat: add pagination
maiano Jul 8, 2025
00a2f95
fix: fix pagination logic
maiano Jul 8, 2025
e880d47
refactor: move the request to the API and local storage to the module
maiano Jul 9, 2025
582f1f1
refactor: extract HomePage component and add Footer with error button
maiano Jul 10, 2025
7dd4812
docs: add readme
maiano Jul 10, 2025
1b6e492
docs: change description in readme
maiano Jul 10, 2025
90d72a1
refactor: update ErrorBoundary fallback with custom content
maiano Jul 10, 2025
1b304dd
refactor: replace text button with svg chevron icons
maiano Jul 10, 2025
3f5d7e1
refactor: second update ErrorBoundary fallback with custom content
maiano Jul 11, 2025
5c91e81
refactor: update 404 fallback
maiano Jul 11, 2025
20553b4
feat: add information to the Card component
maiano Jul 11, 2025
637feb3
refactor: move fetching logic to HomePage
maiano Jul 11, 2025
d22c023
feat: improve unknown fields in the card
maiano Jul 12, 2025
494e720
feat: add adaptive rendering for page buttons
maiano Jul 12, 2025
9f2e4fb
refactor: add explicit type for state in the SearchBar component
maiano Jul 12, 2025
3257118
feat: apply custom theme to Pagination and SearchBar
maiano Jul 12, 2025
2b7ffb6
refactor: make initial search term controlled via props
maiano Jul 12, 2025
c02239d
feat: add input name, id and autofocus for better accessibility
maiano Jul 13, 2025
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
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
9 changes: 9 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
1. Task: [link](https://github.com/)
2. Screenshot:
3. Deploy: [link](https://github.com/)
4. Done 28.05.2020 / deadline 31.05.2020
5. Score: 75 / 110
- [x] Application is divided to logical modules / layers. Like working with api it's separate module, as well as working with UI rendering, or working with an application state, etc. Better discuss architecture with a mentor before implementing. (40/40)
- [x] All the HTML-content is generated by JavaScript (body contains only one tag script inside). (15/30)
- [ ] Application is SPA.(0/20)
- [x] Webpack or another bundler should be used. There should be one HTML-file, JS-file, and one CSS-file (or it can be embedded right in the HTML-file). (20/20)
49 changes: 30 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
Expand Down Expand Up @@ -56,6 +57,12 @@ web_modules/
# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

Expand All @@ -67,8 +74,10 @@ web_modules/

# dotenv environment variable files
.env
.env.*
!.env.example
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
Expand All @@ -95,9 +104,6 @@ dist
.temp
.cache

# Sveltekit cache directory
.svelte-kit/

# vitepress build output
**/.vitepress/dist

Expand All @@ -116,24 +122,29 @@ dist
# DynamoDB Local files
.dynamodb/

# Firebase cache directory
.firebase/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v3
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Vite logs files
vite.config.js.timestamp-*
vite.config.ts.timestamp-*

# Vitest
.vitest-cache/
.vitest/
test-results.xml

# IDE
.idea/
.vscode/
*.swp
*.swo

# macOS
.DS_Store
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no -- commitlint --edit
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no -- lint-staged
4 changes: 4 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
echo 'Running test...'
echo 'If there are no tests, you need to write them'


7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"printWidth": 80,
"tabWidth": 2
}
55 changes: 54 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,54 @@
# react-2025
# Rick and Morty Explorer - React App

🔗 **Live Demo**: [https://rick-and-morty-maiano.netlify.app/](https://rick-and-morty-maiano.netlify.app/)

## About

**Rick and Morty Explorer** is a simple React app for browsing characters from the Rick and Morty universe, with support for:

- Search by character name
- Local storage of last search

### Core

- **Frontend**: <a href="https://reactjs.org/"><img src="https://user-images.githubusercontent.com/25181517/183897015-94a058a6-b86e-4e42-a37f-bf92061753e5.png" width="16" alt="React"> React </a> + TypeScript + <a href="https://tailwindcss.com/"> <img src="https://tailwindcss.com/favicons/favicon.ico?v=4" width="16" alt="TailwindCSS"> TailwindCSS</a>

### Tooling

- **Bundler**: <a href="https://vitejs.dev/"><img src="https://vitejs.dev/logo.svg" width="16" alt="Vite"> Vite</a>
- **Linting**: ESLint + Prettier + Husky

## Quick Start

> [!NOTE]
> To get started with the development:
>
> 1. Clone the repository using `git clone https://github.com/maiano/eCommerce-Application.git`.
> 2. Install dependencies using `npm install`.
> 3. Run the development server using `npm run dev`.
> 4. Build the project using `npm run build`.

<details>
<summary>Scripts</summary>

- `build`: Create production build.

- `ci:format`: Check code formatting.

- `dev`: Start development server.

- `format`: Format code with Prettier.

- `lint`: Check for linting errors.

- `lint:fix`: Fix linting errors.

- `prepare`: Sets up Husky.

- `preview`: Preview production build.

- `test`: Run all tests.

- `coverage`: Generate test coverage report.

</details>
27 changes: 27 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
export default {
extends: ['@commitlint/config-conventional'],
rules: {
'scope-case': [2, 'always', 'lower-case'],
'subject-empty': [2, 'never'],
'subject-full-stop': [2, 'never', '.'],
'type-case': [2, 'always', 'lower-case'],
'type-empty': [2, 'never'],
'type-enum': [
2,
'always',
[
'build',
'ci',
'chore',
'docs',
'feat',
'fix',
'refactor',
'revert',
'style',
'test',
'init',
],
],
},
};
89 changes: 89 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import js from '@eslint/js';
import globals from 'globals';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import tsPlugin from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import importPlugin from 'eslint-plugin-import';
import jsxA11y from 'eslint-plugin-jsx-a11y';

export default [
// Base
{
ignores: ['dist/**', '**/*.d.ts', 'node_modules', 'vite.http-config.ts'],
},

// JS
{
files: ['**/*.js'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
...globals.browser,
},
},
rules: {
...js.configs.recommended.rules,
},
},

// TS
{
files: ['src/**/*.{ts,tsx}'],
languageOptions: {
parser: tsParser,
parserOptions: {
project: './tsconfig.app.json',
tsconfigRootDir: import.meta.dirname,
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2022,
sourceType: 'module',
},
globals: {
...globals.browser,
},
},
plugins: {
'@typescript-eslint': tsPlugin,
import: importPlugin,
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
'jsx-a11y': jsxA11y,
},
rules: {
...tsPlugin.configs.recommended.rules,
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': 'warn',
'import/order': [
'warn',
{
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
],
alphabetize: { order: 'asc', caseInsensitive: true },
},
],
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-unsafe-argument': 'error',
'@typescript-eslint/no-unsafe-assignment': 'error',
'@typescript-eslint/no-unsafe-call': 'error',
'@typescript-eslint/no-unsafe-member-access': 'error',
'@typescript-eslint/no-unsafe-return': 'error',

'jsx-a11y/alt-text': 'warn',
'jsx-a11y/anchor-is-valid': 'warn',
'jsx-a11y/aria-props': 'warn',
'jsx-a11y/click-events-have-key-events': 'warn',
},
},
];
13 changes: 13 additions & 0 deletions 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/png" href="/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Rick and Morty</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading