diff --git a/frontend/.dockerignore b/frontend/.dockerignore new file mode 100644 index 0000000..f132a49 --- /dev/null +++ b/frontend/.dockerignore @@ -0,0 +1,5 @@ +build/** +.idea/ +node_modules/ +vs_code/ +Dockerfile \ No newline at end of file diff --git a/frontend/.eslintrc.json b/frontend/.eslintrc.json new file mode 100644 index 0000000..65b9ef0 --- /dev/null +++ b/frontend/.eslintrc.json @@ -0,0 +1,28 @@ +{ + "env": { + "browser": true, + "es6": true, + "jest": true + }, + "extends": ["plugin:react/recommended", "airbnb"], + "globals": { + "Atomics": "readonly", + "SharedArrayBuffer": "readonly" + }, + "parserOptions": { + "ecmaFeatures": { + "jsx": true + }, + "ecmaVersion": 11, + "sourceType": "module" + }, + "plugins": ["react"], + "rules": { + "import/no-cycle": 0, + "no-unused-expressions": 0, + "react/jsx-props-no-spreading": 0, + "react/prop-types": 0, + "react/function-component-definition": 0, + "react/no-alert": 0 + } +} diff --git a/frontend/.gitignore b/frontend/.gitignore new file mode 100644 index 0000000..0d29aa3 --- /dev/null +++ b/frontend/.gitignore @@ -0,0 +1,28 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# production +/build + +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +yarn.lock + +.vscode/ +.vscode/* \ No newline at end of file diff --git a/frontend/.prettierrc b/frontend/.prettierrc new file mode 100644 index 0000000..44e874d --- /dev/null +++ b/frontend/.prettierrc @@ -0,0 +1,6 @@ +{ + "arrowParens": "avoid", + "trailingComma": "es5", + "singleQuote": true, + "semi": true +} \ No newline at end of file diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 0000000..c7fe761 --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,24 @@ +FROM node:18-alpine AS builder + +RUN apk update && apk upgrade && \ + apk add --no-cache bash git openssh + +WORKDIR /app +COPY package*.json ./ +RUN npm install + +COPY . . +RUN npm run build +FROM node:18-alpine AS server + +ENV NODE_ENV=production +RUN npm install -g serve + +WORKDIR /app +COPY package*.json ./ +COPY --from=builder /app/build ./build + +ENV PORT=3000 +EXPOSE 3000 +USER node +CMD ["serve", "-s", "build"] \ No newline at end of file diff --git a/frontend/package.json b/frontend/package.json new file mode 100644 index 0000000..29edc44 --- /dev/null +++ b/frontend/package.json @@ -0,0 +1,45 @@ +{ + "name": "ctmmm-ui", + "version": "1.0.0", + "private": true, + "dependencies": { + "@popperjs/core": "^2.11.7", + "bootstrap": "^5.2.3", + "react": "18.2.0", + "react-bootstrap": "^2.7.4", + "react-dom": "18.2.0", + "react-scripts": "5.0.1", + "web-vitals": "^2.1.0" + }, + "scripts": { + "start": "react-scripts start", + "build": "react-scripts build", + "test": "react-scripts test", + "eject": "react-scripts eject" + }, + "eslintConfig": { + "extends": "react-app" + }, + "devDependencies": { + "eslint": "^8.13.0", + "eslint-config-airbnb": "^19.0.4", + "eslint-plugin-import": "^2.22.1", + "eslint-plugin-jsx-a11y": "^6.3.1", + "eslint-plugin-prefer-arrow-functions": "^3.1.4", + "eslint-plugin-react": "^7.21.4", + "eslint-plugin-react-hooks": "^4.1.2" + }, + "proxy": "http://localhost:3000", + "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..dd885d1 --- /dev/null +++ b/frontend/public/index.html @@ -0,0 +1,22 @@ + + + +
+ + + + + + + + ++ Welcome! + {' '} + In order to use this tool you'll need to have already created (if it's + still "Under Review", that's ok) your Modrinth Page, and a few other things: + +
{logs});
+};
diff --git a/frontend/src/index.js b/frontend/src/index.js
new file mode 100644
index 0000000..42f131e
--- /dev/null
+++ b/frontend/src/index.js
@@ -0,0 +1,10 @@
+import { createRoot } from 'react-dom/client';
+
+import App from './App';
+import './App.css';
+import 'bootstrap/dist/css/bootstrap.min.css';
+
+const container = document.getElementById('root');
+const root = createRoot(container);
+
+root.render(App());
diff --git a/frontend/src/pages/Home.jsx b/frontend/src/pages/Home.jsx
new file mode 100644
index 0000000..853e309
--- /dev/null
+++ b/frontend/src/pages/Home.jsx
@@ -0,0 +1,173 @@
+import React, { useState } from 'react';
+import {
+ Form, Button, Container, Accordion, Modal,
+} from 'react-bootstrap';
+import OutputLog from '../components/OutputLog';
+import Info from '../components/Info';
+
+export default () => {
+ const [help, setHelp] = useState(null);
+ const [jobId, setJobId] = useState(window.localStorage.getItem('last-jobid'));
+ const [formData, setFormData] = useState({
+ githubPat: '',
+ slug: '',
+ projId: '',
+ });
+
+ // eslint-disable-next-line max-len
+ const isValidState = () => !!formData.githubPat.length && !!formData.slug.length && !!formData.projId.length;
+ const delimHelp = (evt) => {
+ evt.preventDefault();
+ setHelp((
+
+ This is the splitter between parts of the filename. Geolosys uses format
+ {' '}
+ MODNAME-MCVER-MAJOR.MINOR.PATCH
+ , where
+ {' '}
+ -
+ {' '}
+ is the delimiter.
+
+ Using this logic, it is assumed that the Minecraft version for this
+ {' '}
+ .jar
+ -file is between the first and second delimiter, and that the mod version is between
+ the second and the end of the file. Formatting aside from this is not supported,
+ unfortunately, as I've got a bit of trauma
+ {' '}
+ (/s)
+ {' '}
+ from
+ {' '}
+
+ this Regular Expression I wrote.
+
+
{`#${jobId}`}
+