diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..238d2e4 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,38 @@ +import js from '@eslint/js' +import globals from 'globals' +import react from 'eslint-plugin-react' +import reactHooks from 'eslint-plugin-react-hooks' +import reactRefresh from 'eslint-plugin-react-refresh' + +export default [ + { ignores: ['dist'] }, + { + files: ['**/*.{js,jsx}'], + languageOptions: { + ecmaVersion: 2020, + globals: globals.browser, + parserOptions: { + ecmaVersion: 'latest', + ecmaFeatures: { jsx: true }, + sourceType: 'module', + }, + }, + settings: { react: { version: '18.3' } }, + plugins: { + react, + 'react-hooks': reactHooks, + 'react-refresh': reactRefresh, + }, + rules: { + ...js.configs.recommended.rules, + ...react.configs.recommended.rules, + ...react.configs['jsx-runtime'].rules, + ...reactHooks.configs.recommended.rules, + 'react/jsx-no-target-blank': 'off', + 'react-refresh/only-export-components': [ + 'warn', + { allowConstantExport: true }, + ], + }, + }, +] diff --git a/index.html b/index.html new file mode 100644 index 0000000..fe40c08 --- /dev/null +++ b/index.html @@ -0,0 +1,13 @@ + + + + + + + MiarmaCraft + + +
+ + + diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 0000000..30e99a0 --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@/*": ["src/*"] + } + }, + "include": ["src"] + } \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..bcad554 --- /dev/null +++ b/package.json @@ -0,0 +1,49 @@ +{ + "name": "miarmacraftreact", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "lint": "eslint .", + "preview": "vite preview" + }, + "dependencies": { + "@fortawesome/fontawesome-free": "^6.7.2", + "@fortawesome/fontawesome-svg-core": "^6.7.2", + "@fortawesome/free-brands-svg-icons": "^6.7.2", + "@fortawesome/free-regular-svg-icons": "^6.7.2", + "@fortawesome/free-solid-svg-icons": "^6.7.2", + "@fortawesome/react-fontawesome": "^0.2.2", + "axios": "^1.9.0", + "bootstrap": "^5.3.5", + "date-fns": "^2.30.0", + "dompurify": "^3.2.5", + "file-saver": "^2.0.5", + "framer-motion": "^12.6.1", + "pixelarticons": "^1.8.1", + "react": "^18.3.1", + "react-bootstrap": "^2.10.9", + "react-dom": "^18.3.1", + "react-router-dom": "^7.1.5", + "react-simple-wysiwyg": "^3.2.2", + "react-skinview3d": "^5.1.0", + "react-slick": "^0.30.3", + "react-split": "^2.0.14", + "slick-carousel": "^1.8.1", + "vite-plugin-clean": "^2.0.1" + }, + "devDependencies": { + "@eslint/js": "^9.17.0", + "@types/react": "^18.3.18", + "@types/react-dom": "^18.3.5", + "@vitejs/plugin-react": "^4.3.4", + "eslint": "^9.17.0", + "eslint-plugin-react": "^7.37.2", + "eslint-plugin-react-hooks": "^5.0.0", + "eslint-plugin-react-refresh": "^0.4.16", + "globals": "^15.14.0", + "vite": "^6.0.5" + } +} diff --git a/public/config/settings.dev.json b/public/config/settings.dev.json new file mode 100644 index 0000000..461b9ba --- /dev/null +++ b/public/config/settings.dev.json @@ -0,0 +1,32 @@ +{ + "apiConfig": { + "baseUrl": "https://api.miarma.net/mmc/v1", + "baseRawUrl": "https://api.miarma.net/mmc/raw/v1", + "coreUrl": "https://api.miarma.net/v1", + "coreRawUrl": "https://api.miarma.net/raw/v1", + "authUrl": "https://api.miarma.net/auth/v1", + "endpoints": { + "auth": { + "login": "/login", + "validateToken": "/validate-token", + "refreshToken": "/refresh-token", + "changePassword": "/change-password", + "loginValidate": "/login/validate" + }, + "mods": { + "all": "/mods", + "byId": "/mods/:mod_id", + "modStatus": "/mods/:mod_id/status" + }, + "players": { + "all": "/players", + "byId": "/players/:player_id", + "playerStatus": "/players/:player_id/status", + "playerRole": "/players/:player_id/role", + "playerExists": "/players/:player_id/exists", + "playerAvatar": "/players/:player_id/avatar", + "playerInfo": "/players/me" + } + } + } +} \ No newline at end of file diff --git a/public/config/settings.prod.json b/public/config/settings.prod.json new file mode 100644 index 0000000..461b9ba --- /dev/null +++ b/public/config/settings.prod.json @@ -0,0 +1,32 @@ +{ + "apiConfig": { + "baseUrl": "https://api.miarma.net/mmc/v1", + "baseRawUrl": "https://api.miarma.net/mmc/raw/v1", + "coreUrl": "https://api.miarma.net/v1", + "coreRawUrl": "https://api.miarma.net/raw/v1", + "authUrl": "https://api.miarma.net/auth/v1", + "endpoints": { + "auth": { + "login": "/login", + "validateToken": "/validate-token", + "refreshToken": "/refresh-token", + "changePassword": "/change-password", + "loginValidate": "/login/validate" + }, + "mods": { + "all": "/mods", + "byId": "/mods/:mod_id", + "modStatus": "/mods/:mod_id/status" + }, + "players": { + "all": "/players", + "byId": "/players/:player_id", + "playerStatus": "/players/:player_id/status", + "playerRole": "/players/:player_id/role", + "playerExists": "/players/:player_id/exists", + "playerAvatar": "/players/:player_id/avatar", + "playerInfo": "/players/me" + } + } + } +} \ No newline at end of file diff --git a/public/fonts/mc-text-bold-italic.otf b/public/fonts/mc-text-bold-italic.otf new file mode 100644 index 0000000..1f74f38 Binary files /dev/null and b/public/fonts/mc-text-bold-italic.otf differ diff --git a/public/fonts/mc-text-bold.otf b/public/fonts/mc-text-bold.otf new file mode 100644 index 0000000..87b124c Binary files /dev/null and b/public/fonts/mc-text-bold.otf differ diff --git a/public/fonts/mc-text-italic.otf b/public/fonts/mc-text-italic.otf new file mode 100644 index 0000000..6801bd8 Binary files /dev/null and b/public/fonts/mc-text-italic.otf differ diff --git a/public/fonts/mc-text-regular.otf b/public/fonts/mc-text-regular.otf new file mode 100644 index 0000000..54f08ad Binary files /dev/null and b/public/fonts/mc-text-regular.otf differ diff --git a/public/fonts/mc-titles.ttf b/public/fonts/mc-titles.ttf new file mode 100644 index 0000000..c1be72b Binary files /dev/null and b/public/fonts/mc-titles.ttf differ diff --git a/public/images/background.png b/public/images/background.png new file mode 100644 index 0000000..0271fbb Binary files /dev/null and b/public/images/background.png differ diff --git a/public/images/bg_dirt.webp b/public/images/bg_dirt.webp new file mode 100644 index 0000000..4195a1f Binary files /dev/null and b/public/images/bg_dirt.webp differ diff --git a/public/images/building.webp b/public/images/building.webp new file mode 100644 index 0000000..52e60a1 Binary files /dev/null and b/public/images/building.webp differ diff --git a/public/images/favicon.ico b/public/images/favicon.ico new file mode 100644 index 0000000..0695e65 Binary files /dev/null and b/public/images/favicon.ico differ diff --git a/public/images/miarmacraft.svg b/public/images/miarmacraft.svg new file mode 100644 index 0000000..b6ac668 --- /dev/null +++ b/public/images/miarmacraft.svg @@ -0,0 +1,429 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/images/miarmacraft_mods.svg b/public/images/miarmacraft_mods.svg new file mode 100644 index 0000000..5cb4692 --- /dev/null +++ b/public/images/miarmacraft_mods.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/images/sign.jpg b/public/images/sign.jpg new file mode 100644 index 0000000..39fb6c2 Binary files /dev/null and b/public/images/sign.jpg differ diff --git a/public/images/title.gif b/public/images/title.gif new file mode 100644 index 0000000..75ece50 Binary files /dev/null and b/public/images/title.gif differ diff --git a/public/images/title.png b/public/images/title.png new file mode 100644 index 0000000..da00872 Binary files /dev/null and b/public/images/title.png differ diff --git a/public/privacy.txt b/public/privacy.txt new file mode 100644 index 0000000..f3b4296 --- /dev/null +++ b/public/privacy.txt @@ -0,0 +1,6 @@ +privacy.txt + +1. No recopilamos ningun dato personal. +2. No mandaremos correos basura en la lista de correo. +3. No usaremos cookies de terceros. +4. Es bastante probable que usemos tu direccion IPv4 por motivos de funcionamiento del servidor. \ No newline at end of file diff --git a/src/api/axiosInstance.js b/src/api/axiosInstance.js new file mode 100644 index 0000000..5a4f265 --- /dev/null +++ b/src/api/axiosInstance.js @@ -0,0 +1,14 @@ +import axios from "axios"; + +const createAxiosInstance = (baseURL, token) => { + const instance = axios.create({ + baseURL, + headers: { + ...(token && { Authorization: `Bearer ${token}` }), + }, + }); + + return instance; +}; + +export default createAxiosInstance; diff --git a/src/components/App.jsx b/src/components/App.jsx new file mode 100644 index 0000000..3dcbe7c --- /dev/null +++ b/src/components/App.jsx @@ -0,0 +1,43 @@ +import { Route, Routes, useLocation } from "react-router-dom"; +import Header from "./layout/Header"; +import Inicio from "./pages/Inicio"; +import Mods from "./pages/Mods"; +import Jugadores from "./pages/Jugadores"; +import Footer from "./layout/Footer"; +import Login from "./pages/Login"; +import Profile from "./pages/Profile"; +import ProtectedRoute from "./auth/ProtectedRoute"; +import { CONSTANTS } from "@/constants"; + +const App = () => { + const location = useLocation().pathname.replace(import.meta.env.BASE_URL, '/'); + const routesWithFooter = ["/", "/login"] + return ( + <> +
+ + } /> + + + + } /> + + + + } /> + } /> + + + + } /> + + + {routesWithFooter.includes(location) ?