Skip to content

Commit

Permalink
more intial setup
Browse files Browse the repository at this point in the history
- add material ui, react router, and eslint
- add configs for eslint, material ui
- format project files according to the new rules
- remove unwanted default create-react-app code
  • Loading branch information
honzaflash committed Sep 14, 2023
1 parent 304c717 commit a8fc0a9
Show file tree
Hide file tree
Showing 12 changed files with 10,177 additions and 90 deletions.
44 changes: 44 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"react"
],
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"never"
]
}
}
50 changes: 24 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,44 @@
# Getting Started with Create React App
# (My) Portfolio Website

A place to show what I am about professionally.

# Used Tech
### React
I chose to use React just to show case what I already know and have experience with. That should also speed up the process for me as I want an up-to-date protfolio quickly since I am currently searching for a job.

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

### Material UI
I have use MUI before and liked the flexibility in designing.

## Available Scripts

In the project directory, you can run:

### `npm start`

### `yarn start`
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
Hosted at [http://localhost:3000](http://localhost:3000).

The page will reload if you make edits.\
You will also see any lint errors in the console.
### `yarn lint`
Runs `eslint` on the project.

### `npm test`
### `yarn lint:fix`
Runs `eslint --fix` on the project.

### `yarn test`
Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

### `yarn build`
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

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

### `npm run 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.
The build is minified and the filenames include the hashes.

## Learn More
### `yarn run eject`
Standard create-react-app eject.
**Note: this is a one-way operation.**

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/).
# TODOs
- Create a version of the porfolio using Gatsby
26 changes: 21 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"name": "rychly-portfolio",
"version": "0.1.0",
"private": true,
"private": false,
"dependencies": {
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@mui/material": "^5.14.8",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
Expand All @@ -12,13 +15,16 @@
"@types/react-dom": "^18.2.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.15.0",
"react-scripts": "5.0.1",
"typescript": "^4.9.5",
"web-vitals": "^2.1.4"
"showdown": "^2.1.0",
"typescript": "^4.9.5"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"lint": "npx eslint .",
"lint:fix": "npx eslint . --fix",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
Expand All @@ -39,5 +45,15 @@
"last 1 firefox version",
"last 1 safari version"
]
}
}
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.60.1",
"@typescript-eslint/parser": "^5.60.1",
"eslint": "^8.43.0",
"eslint-plugin-react": "^7.32.2"
},
"description": "Portfolio website",
"main": "index.js",
"author": "Jan Rychly <[email protected]>",
"license": "MIT"
}
13 changes: 6 additions & 7 deletions src/App.test.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import App from './App';
import { render, screen } from '@testing-library/react'
import App from './App'

test('renders learn react link', () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});
render(<App />)
const linkElement = screen.getByText(/learn react/i)
expect(linkElement).toBeInTheDocument()
})
30 changes: 8 additions & 22 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,12 @@
import React from 'react';
import logo from './logo.svg';
import './App.css';
import { Box } from '@mui/material'
import './App.css'

function App() {
export const App = () => {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.tsx</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
);
<Box className="App">
how u like dis app
</Box>
)
}

export default App;
export default App
19 changes: 7 additions & 12 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import React from 'react'
import ReactDOM from 'react-dom/client'
import './index.css'
import App from './App'

const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement
);
)

root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
)
1 change: 0 additions & 1 deletion src/logo.svg

This file was deleted.

1 change: 0 additions & 1 deletion src/react-app-env.d.ts

This file was deleted.

15 changes: 0 additions & 15 deletions src/reportWebVitals.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/setupTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom';
import '@testing-library/jest-dom'
88 changes: 88 additions & 0 deletions src/theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import { ThemeOptions } from '@mui/material/styles'

export const themeOptions: ThemeOptions = {
palette: {
mode: 'dark',
primary: {
main: '#48b53f',
contrastText: 'rgba(0,0,0,0.87)',
},
secondary: {
main: '#9843c7',
},
background: {
default: '#010302',
},
text: {
primary: '#ffffff',
secondary: '#fafffb',
disabled: 'rgba(242,245,242,0.38)',
},
warning: {
main: '#ed9302',
},
},
typography: {
h1: {
fontFamily: 'Victor Mono',
},
h2: {
fontFamily: 'Victor Mono',
},
h3: {
fontFamily: 'Victor Mono',
},
h4: {
fontFamily: 'Victor Mono',
},
body1: {
fontFamily: 'Open Sans',
},
body2: {
fontFamily: 'Open Sans',
},
button: {
fontFamily: 'Victor Mono',
},
caption: {
fontFamily: 'Open Sans',
},
overline: {
fontFamily: 'Open Sans',
},
subtitle2: {
fontFamily: 'Open Sans',
},
subtitle1: {
fontFamily: 'Open Sans',
},
h6: {
fontFamily: 'Victor Mono',
},
h5: {
fontFamily: 'Victor Mono',
},
fontFamily: 'Open Sans',
},
components: {
MuiButtonBase: {
defaultProps: {
disableRipple: true,
},
},
MuiAppBar: {
defaultProps: {
color: 'primary',
},
},
MuiTooltip: {
defaultProps: {
arrow: true,
},
},
},
shape: {
borderRadius: 2,
},
spacing: 4,
}
Loading

0 comments on commit a8fc0a9

Please sign in to comment.