From 30dc897fb915977a94eb3f4947a7111d863c243b Mon Sep 17 00:00:00 2001 From: jackyzha0 Date: Sat, 9 May 2020 20:40:01 -0700 Subject: add react setup --- .gitignore | 12 +++++++++++- Makefile | 6 +++++- frontend/package.json | 34 ++++++++++++++++++++++++++++++++++ frontend/public/index.html | 29 +++++++++++++++++++++++++++++ frontend/public/logo192.png | Bin 0 -> 5347 bytes frontend/public/logo512.png | Bin 0 -> 9664 bytes frontend/src/components/App.js | 15 +++++++++++++++ frontend/src/css/index.css | 13 +++++++++++++ frontend/src/index.js | 11 +++++++++++ 9 files changed, 118 insertions(+), 2 deletions(-) create mode 100644 frontend/package.json create mode 100644 frontend/public/index.html create mode 100644 frontend/public/logo192.png create mode 100644 frontend/public/logo512.png create mode 100644 frontend/src/components/App.js create mode 100644 frontend/src/css/index.css create mode 100644 frontend/src/index.js diff --git a/.gitignore b/.gitignore index 20ec22f..eae8e6c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,14 @@ .env .idea go.sum -.DS_Store \ No newline at end of file +.DS_Store + +frontend/node_modules +frontend/build +frontend/.pnp +frontend/yarn.lock +.pnp.js + +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/Makefile b/Makefile index 6b3a272..a07153b 100644 --- a/Makefile +++ b/Makefile @@ -8,4 +8,8 @@ docker-run: docker run -p 8080:8080 jzhao2k19/ctrl-v:latest docker-all: docker-build docker-run docker-push: - docker push jzhao2k19/ctrl-v:latest \ No newline at end of file + docker push jzhao2k19/ctrl-v:latest +fe-run: + cd frontend && yarn start +fe-build: + cd frontend && yarn build \ No newline at end of file diff --git a/frontend/package.json b/frontend/package.json new file mode 100644 index 0000000..4ff295a --- /dev/null +++ b/frontend/package.json @@ -0,0 +1,34 @@ +{ + "name": "frontend", + "version": "0.1.0", + "private": true, + "dependencies": { + "@testing-library/jest-dom": "^4.2.4", + "@testing-library/react": "^9.3.2", + "@testing-library/user-event": "^7.1.2", + "react": "^16.13.1", + "react-dom": "^16.13.1", + "react-scripts": "3.4.1" + }, + "scripts": { + "start": "react-scripts start", + "build": "react-scripts build", + "test": "react-scripts test", + "eject": "react-scripts eject" + }, + "eslintConfig": { + "extends": "react-app" + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + } +} diff --git a/frontend/public/index.html b/frontend/public/index.html new file mode 100644 index 0000000..18f4c64 --- /dev/null +++ b/frontend/public/index.html @@ -0,0 +1,29 @@ + + + + + + + + + + 📋 ctrl-v + + + +
+ + + diff --git a/frontend/public/logo192.png b/frontend/public/logo192.png new file mode 100644 index 0000000..fc44b0a Binary files /dev/null and b/frontend/public/logo192.png differ diff --git a/frontend/public/logo512.png b/frontend/public/logo512.png new file mode 100644 index 0000000..a4e47a6 Binary files /dev/null and b/frontend/public/logo512.png differ diff --git a/frontend/src/components/App.js b/frontend/src/components/App.js new file mode 100644 index 0000000..3614fe1 --- /dev/null +++ b/frontend/src/components/App.js @@ -0,0 +1,15 @@ +import React from 'react'; + +function App() { + return ( +
+
+

+ Edit src/App.js and save to reload. +

+
+
+ ); +} + +export default App; diff --git a/frontend/src/css/index.css b/frontend/src/css/index.css new file mode 100644 index 0000000..ec2585e --- /dev/null +++ b/frontend/src/css/index.css @@ -0,0 +1,13 @@ +body { + margin: 0; + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', + 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', + sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +code { + font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', + monospace; +} diff --git a/frontend/src/index.js b/frontend/src/index.js new file mode 100644 index 0000000..437fe03 --- /dev/null +++ b/frontend/src/index.js @@ -0,0 +1,11 @@ +import React from 'react'; +import ReactDOM from 'react-dom'; +import './css/index.css'; +import App from './components/App'; + +ReactDOM.render( + + + , + document.getElementById('root') +); \ No newline at end of file -- cgit v1.2.3