Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
filipemelo2002 committed Apr 14, 2021
2 parents 4658161 + cf355cb commit 72e6922
Show file tree
Hide file tree
Showing 57 changed files with 2,406 additions and 104 deletions.
6 changes: 4 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"env": {
"browser": true,
"es2021": true
"es2021": true,
"jest": true
},
"extends": [
"plugin:react/recommended",
Expand All @@ -26,7 +27,8 @@
"prettier/prettier":"error",
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": ["error"],
"react/prop-types": "off"
"react/prop-types": "off",
"camelcase": "off"
},
"settings": {
"import/resolver": "eslint-import-resolver-typescript"
Expand Down
96 changes: 76 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
# Getting Started with Create React App

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
# [🐙Github Compare](https://github.com/filipemelo2002/github-compare)
Github Compare is a web application that allows users to show comparisons of repositories selected by them on Github.

## Available Scripts
This App uses github [**GitHub API V3**](https://docs.github.com/en/rest)

In the project directory, you can run:
## 📦 Packages
### Configuration
* [ESlint](https://eslint.org/)
* [Prettier](https://prettier.io/)
* [Typescript](https://www.typescriptlang.org/)
### CSS
* [ClayUI](https://clayui.com/)
* [styled-components](https://styled-components.com/)
## Tests
* [Jest](https://jestjs.io/)
* [Testing Library](https://testing-library.com/)

### `yarn start`
## ⚙️Getting started


Clone this project and install the dependencies:
```bash
git clone https://github.com/filipemelo2002/github-compare.git
cd github-compare
npm install # or yarn install
```
### `npm run start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
Expand All @@ -29,18 +48,55 @@ Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `yarn eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).
## 📸Screenshots
![Screenshot github-compare](https://i.imgur.com/N8J3cdz.png)

![Screenshot github-compare](https://i.imgur.com/RKhMNqE.png)

![Screenshot github-compare](https://i.imgur.com/xE6loky.png)

![Screenshot github-compare](https://i.imgur.com/gBXkS8p.png)

![Screenshot github-compare](https://i.imgur.com/Q3AjysV.png)

## 🧑‍🏭Architecture
Below, you can see how the files are organized:
```bash
github-compare/
┣ public/
┃ ┣ favicon.ico
┃ ┣ index.html
┃ ┣ logo192.png
┃ ┗ logo512.png
┣ src/
┃ ┣ @types/
┃ ┣ __tests__/
┃ ┣ api/
┃ ┣ assets/
┃ ┣ components/
┃ ┣ pages/
┃ ┣ redux/
┃ ┣ services/
┃ ┣ styles/
┃ ┣ App.tsx
┃ ┣ index.tsx
┃ ┗ react-app-env.d.ts
┣ .eslintrc.json
┣ .gitignore
┣ .prettierrc
┣ README.md
┣ package.json
┣ tsconfig.json
┗ yarn.lock
```
### Components
Are inside components folder and each of them work individually.

### Pages
currently, there's only one page, Home, which is responsible for rendering all components.

### Tests
Are declared inside *\_\_tests\_\_* folder.

## 📃 License
The MIT License (MIT)
47 changes: 37 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,35 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@types/jest": "^26.0.15",
"@types/node": "^12.0.0",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"@clayui/button": "^3.6.0",
"@clayui/card": "^3.25.1",
"@clayui/css": "^3.25.3",
"@clayui/drop-down": "^3.25.1",
"@clayui/form": "^3.14.4",
"@clayui/label": "^3.4.1",
"@clayui/loading-indicator": "^3.2.0",
"@clayui/management-toolbar": "^3.3.0",
"@clayui/modal": "^3.8.5",
"add": "^2.0.6",
"axios": "^0.21.1",
"lodash.debounce": "^4.0.8",
"moment": "^2.29.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-icons": "^4.2.0",
"react-redux": "^7.2.3",
"react-scripts": "4.0.3",
"redux": "^4.0.5",
"redux-thunk": "^2.3.0",
"styled-components": "^5.2.3",
"typescript": "^4.1.2",
"web-vitals": "^1.0.1"
"web-vitals": "^1.0.1",
"yarn": "^1.22.10"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"test": "react-scripts test --runInBand",
"eject": "react-scripts eject"
},
"eslintConfig": {
Expand All @@ -41,6 +53,18 @@
]
},
"devDependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.2.6",
"@testing-library/user-event": "^12.1.10",
"@types/jest": "^26.0.22",
"@types/lodash.debounce": "^4.0.6",
"@types/mocha": "^8.2.2",
"@types/node": "^14.14.37",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"@types/redux-logger": "^3.0.8",
"@types/redux-mock-store": "^1.0.2",
"@types/styled-components": "^5.1.9",
"@typescript-eslint/eslint-plugin": "^4.21.0",
"@typescript-eslint/parser": "^4.21.0",
"eslint": "^7.12.1",
Expand All @@ -52,6 +76,9 @@
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-react": "^7.23.2",
"prettier": "^2.2.1"
"prettier": "^2.2.1",
"redux-logger": "^3.0.6",
"redux-mock-store": "^1.5.4",
"ts-node": "^9.1.1"
}
}
Binary file modified public/favicon.ico
Binary file not shown.
26 changes: 1 addition & 25 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,10 @@
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>Github Compare</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
Binary file modified public/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 0 additions & 25 deletions public/manifest.json

This file was deleted.

3 changes: 0 additions & 3 deletions public/robots.txt

This file was deleted.

16 changes: 16 additions & 0 deletions src/@types/redux.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
interface IRepositoryState {
data: IRepository[];
loading: boolean;
error: boolean;
filter: {
name: string;
data: IRepository[];
starred: boolean;
sortBy: Sort;
};
listType: ListType;
}

interface State {
repository: IRepositoryState;
}
25 changes: 25 additions & 0 deletions src/@types/repository.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
interface ILicense {
name: string;
}
interface IRepository {
id: number;
full_name: string;
stargazers_count: number;
forks: number;
open_issues: number;
created_at: string;
pushed_at: string;
license: ILicense | null;
starred?: boolean;
language: string;
}

interface IRepositoryList {
items: IRepository[];
}
type Sort = 'stars' | 'forks' | 'openIssues' | 'age' | 'lastCommit' | '';
type ListType = 'grid' | 'row';
interface FilterActionSort {
type: string;
payload: Sort;
}
12 changes: 10 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import React from 'react';
import Home from './pages/Home';

const App = () => (<Home />)
import GlobalStyle from './styles/globalStyles';
import '@clayui/css/lib/css/atlas.css';
import { Provider } from 'react-redux';
import store from './redux/store';
const App: React.FC = () => (
<Provider store={store}>
<Home />
<GlobalStyle />
</Provider>
);

export default App;
Loading

0 comments on commit 72e6922

Please sign in to comment.