From bf5f31d856e2490c1767a87ffcd699f887999c27 Mon Sep 17 00:00:00 2001 From: karlosvas <126987511+karlosvas@users.noreply.github.com> Date: Sat, 18 Jan 2025 16:34:43 +0100 Subject: [PATCH] Implement format with prettier --- .github/workflows/deploy.yml | 97 +- .gitignore | 24 +- .prettierignore | 18 + .prettierrc | 7 + README.md | 117 +- client/.eslintrc.cjs | 18 - client/.gitignore | 1 - client/index.html | 35 +- client/package-lock.json | 1853 +++-------------- client/package.json | 9 +- client/src/App.tsx | 72 +- client/src/Index.tsx | 22 +- .../src/components/header-components/Auth.tsx | 93 +- .../header-components/Hamburger.tsx | 18 +- .../components/header-components/MainNav.tsx | 18 +- .../components/header-components/Profile.tsx | 12 +- .../components/header-components/Theme.tsx | 20 +- .../pages-components/blog/CardPlaceholder.tsx | 8 +- .../blog/CardPublicationBlog.tsx | 72 +- .../pages-components/blog/FormPublication.tsx | 103 +- .../pages-components/blog/Pagination.tsx | 24 +- .../pages-components/main/Carrousel.tsx | 42 +- .../pages-components/main/FormSuscribe.tsx | 69 +- .../pages-components/main/Prices.tsx | 23 +- .../pages-components/main/Profile.tsx | 79 +- .../publications/CommentCard.tsx | 32 +- .../publications/CommentsPublication.tsx | 34 +- .../publications/PlaceholderPublication.tsx | 2 +- .../publications/Response.tsx | 133 +- client/src/components/reusable/Backdrop.tsx | 6 +- client/src/components/reusable/Button.tsx | 10 +- .../src/components/reusable/ButtonClose.tsx | 6 +- client/src/components/reusable/Mantenince.tsx | 16 +- .../components/reusable/MultiSelectTag.tsx | 124 +- .../components/reusable/PlaceholderImg.tsx | 22 +- .../src/components/reusable/ShowPassword.tsx | 26 +- client/src/components/svg-component/Edit.tsx | 12 +- client/src/components/svg-component/Exit.tsx | 6 +- .../src/components/svg-component/ImgUser.tsx | 2 +- client/src/components/svg-component/Likes.tsx | 22 +- .../svg-component/OptionsComment.tsx | 28 +- .../svg-component/ReplyToComment.tsx | 6 +- .../src/components/svg-component/Settings.tsx | 44 +- client/src/constants/global.ts | 20 +- client/src/layouts/AdminPanel.tsx | 95 +- client/src/layouts/Footer.tsx | 16 +- client/src/layouts/Header.tsx | 32 +- client/src/pages/404.tsx | 12 +- client/src/pages/AboutMe.tsx | 61 +- client/src/pages/Account.tsx | 121 +- client/src/pages/Blog.tsx | 26 +- client/src/pages/CallbackVerify.tsx | 64 +- client/src/pages/Contact.tsx | 70 +- client/src/pages/Info.tsx | 12 +- client/src/pages/Main.tsx | 10 +- client/src/pages/Newsletter.tsx | 169 +- client/src/pages/Publication.tsx | 26 +- client/src/scripts/firebase-auth-users.tsx | 38 +- client/src/scripts/firebase-config.tsx | 138 +- client/src/scripts/firebase-db.tsx | 45 +- client/src/scripts/firebase-options-users.tsx | 49 +- client/src/scripts/helper.tsx | 41 +- client/src/scripts/modal.tsx | 8 +- client/src/scripts/oauth2-0.tsx | 33 +- client/src/scripts/render-data.tsx | 66 +- client/src/styles/comments.css | 14 +- client/src/styles/index.css | 24 +- client/src/styles/layouts/404.css | 2 +- client/src/styles/layouts/header.css | 4 +- client/src/styles/main-aboutme.css | 4 +- client/src/styles/main-contact.css | 13 +- client/src/styles/main-newsettler.css | 22 +- client/src/styles/main-publication.css | 2 +- client/src/styles/main.css | 23 +- client/src/styles/maintenance.css | 46 +- client/src/styles/modal-auth.css | 8 +- client/src/styles/reusables/edit.css | 2 +- client/src/styles/uploadfiles.css | 10 +- client/src/utilities/utilities-types.ts | 66 +- client/src/utilities/utilities.ts | 72 +- client/tsconfig.json | 2 +- client/types/types.d.ts | 17 +- client/vite.config.ts | 10 +- package.json | 4 +- server/.gitignore | 1 - server/custom.d.ts | 5 - server/lib/firebase/firebase-config.ts | 14 +- server/lib/firebase/firebase-db.ts | 4 +- server/lib/mailchimp/mailchimp.ts | 30 +- server/lib/resend/resend.ts | 18 +- server/middelware/token-logs.ts | 16 +- server/package-lock.json | 719 +------ server/package.json | 2 - server/playwright-report/index.html | 68 - server/playwright.config.ts | 22 +- server/routes/comments.ts | 268 +-- server/routes/firebase.ts | 15 +- server/routes/mailchimp.ts | 407 ++-- server/routes/publications.ts | 186 +- server/routes/resend.ts | 50 +- server/routes/routes.ts | 18 +- server/src/index.ts | 58 +- server/src/mongodb/models.ts | 12 +- server/src/mongodb/mongodb.ts | 6 +- server/test-results/.last-run.json | 4 - server/tests/comments.spec.ts | 75 +- server/tests/index.spec.ts | 10 +- server/tests/mailchimp.spec.ts | 155 +- server/tests/mandril.spec.ts | 28 +- server/tests/publications.spec.ts | 53 +- server/types/types.d.ts | 18 +- server/utilities/axios-utils.ts | 7 +- server/utilities/delete-logic.ts | 8 +- server/utilities/errorHandle.ts | 4 +- server/vercel.json | 15 - 115 files changed, 2851 insertions(+), 4327 deletions(-) create mode 100644 .prettierignore create mode 100644 .prettierrc delete mode 100644 client/.eslintrc.cjs delete mode 100644 client/.gitignore delete mode 100644 server/.gitignore delete mode 100644 server/custom.d.ts delete mode 100644 server/playwright-report/index.html delete mode 100644 server/test-results/.last-run.json delete mode 100644 server/vercel.json diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ed948b63..2c5bf494 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -6,77 +6,72 @@ on: - main jobs: - deploy-frontend: + build-frontend: runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Set up Node.js - uses: actions/setup-node@v3 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: node-version: "21.2.0" - - - name: Install Vercel CLI - run: npm install -g vercel@latest - - - name: List files in client directory - run: ls -la ./client - - - name: Link and pull Vercel project for frontend - run: | - vercel link --yes --project ${{ secrets.FRONTEND_PROJECT_ID }} --scope ${{ secrets.VERCEL_TEAM }} --token=${{ secrets.VERCEL_TOKEN }} - vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} - working-directory: ./client - - name: Install frontend dependencies run: npm install working-directory: ./client - - name: Build frontend run: npm run build working-directory: ./client + - name: Upload frontend build + uses: actions/upload-artifact@v3 + with: + name: frontend-build + path: ./client/dist - - name: Deploy frontend to Vercel - run: vercel --token ${{ secrets.VERCEL_TOKEN }} - working-directory: ./client - - deploy-backend: + build-backend: runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Set up Node.js - uses: actions/setup-node@v3 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: node-version: "21.2.0" - - - name: Install Vercel CLI - run: npm install -g vercel@latest - - - name: List files in server directory - run: ls -la ./server - - - name: Link and pull Vercel project for backend - run: | - vercel link --yes --project ${{ secrets.BACKEND_PROJECT_ID }} --scope ${{ secrets.VERCEL_TEAM }} --token=${{ secrets.VERCEL_TOKEN }} - vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} - working-directory: ./server - - name: Install backend dependencies run: npm install working-directory: ./server - - name: Build backend run: npm run build working-directory: ./server + - name: Upload backend build + uses: actions/upload-artifact@v3 + with: + name: backend-build + path: ./server/public - - name: List files in server directory after build - run: ls -la ./server/public + deploy-both: + needs: [build-frontend, build-backend] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install Vercel CLI + run: npm install -g vercel@latest + + # Frontend deployment + - name: Download frontend build + uses: actions/download-artifact@v3 + with: + name: frontend-build + path: ./client/build + - name: Deploy frontend + run: | + vercel link --yes --project ${{ secrets.FRONTEND_PROJECT_ID }} --scope ${{ secrets.VERCEL_TEAM }} --token=${{ secrets.VERCEL_TOKEN }} + vercel --token ${{ secrets.VERCEL_TOKEN }} + working-directory: ./client - - name: Deploy backend to Vercel - run: vercel --token ${{ secrets.VERCEL_TOKEN }} - working-directory: ./server + # Backend deployment + - name: Download backend build + uses: actions/download-artifact@v3 + with: + name: backend-build + path: ./server/public + - name: Deploy backend + run: | + vercel link --yes --project ${{ secrets.BACKEND_PROJECT_ID }} --scope ${{ secrets.VERCEL_TEAM }} --token=${{ secrets.VERCEL_TOKEN }} + vercel --token ${{ secrets.VERCEL_TOKEN }} + working-directory: ./server \ No newline at end of file diff --git a/.gitignore b/.gitignore index 7d1bee05..7cb05302 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,11 @@ dist-ssr client/dist *.local +# Debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + # Editor directories and files .vscode/* !.vscode/extensions.json @@ -26,8 +31,25 @@ client/dist # Environment Variables .env +.env.local +.env.development.local +.env.test.local +.env.production.local # Petitions *.http .vercel -peticiones \ No newline at end of file +peticiones + +# Vercel +.vercel +vercel.json + +# Testing +/test-results/ +/playwright-report/ +/blob-report/ +/playwright/.cache/ + +# TypeScript cache +*.tsbuildinfo \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..87b46a35 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,18 @@ +# Dependencies +node_modules +package-lock.json + +# Build directories +dist +build +public + +# GitHub specific +.github +.git + +# Environment files +.env* + +# Cache +.cache \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..961f08f0 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,7 @@ +{ + "tabWidth": 2, + "singleQuote": true, + "trailingComma": "es5", + "semi": true, + "printWidth": 80 +} diff --git a/README.md b/README.md index dc2793ea..42919022 100644 --- a/README.md +++ b/README.md @@ -1,56 +1,61 @@ -# Marta - Spanish Teacher - -Welcome to the official website of Marta, your trusted Spanish teacher. Here you'll find all the necessary information about her classes, prices, and teaching methods. -**Official URL: https://thefluentspanishhouse.com** - -## About Marta - -Marta is a Spanish teacher with years of experience teaching students of all ages and levels. Her dynamic and personalized approach has helped many students achieve their language goals. - -## Classes - -We offer a variety of classes to suit your needs: - -- **Individual Classes:** Perfect for personalized attention and learning at your own pace. -- **Group Classes:** Ideal for learning in a collaborative environment and making new friends. -- **Online Classes:** Complete flexibility to learn from anywhere in the world. - -## Prices - -Class prices vary depending on the type and duration. Here's a breakdown: - -- **Individual Classes: €21** - -- **Group Classes: €15** - -- **Free Beginner Classes with Test Included: €0** - -## Contact - -For more information or to book a class, you can contact Marta through: - -- **Email:** mar411geca@gmail.com -- **Phone:** +34 617 286 125 -- [Contact Form](https://thefluentspanishhouse.com/contact) - -## Social Media - -Follow me on my social media to stay updated with the latest news and promotions! - -- [Facebook](https://www.facebook.com/thefluentspanishhouse/) - -## Contributions - -If you have any suggestions or want to contribute to the development of this website, feel free to fork and send a pull request. ❤️ -Or if you find any bugs or issues, report them via an Issue. 🪲 -Thank you in advance. - -## License - -This project is under the MIT License. For more details, see the [LICENSE](LICENSE) file. -[Terms and Conditions](https://thefluentspanishhouse.vercel.app/info) -[Privacy Policy](https://thefluentspanishhouse.vercel.app/info) - ---- - -We hope you enjoy learning Spanish with me. See you in class! +# Marta - Spanish Teacher + +Welcome to the official website of Marta, your trusted Spanish teacher. Here you'll find all the necessary information about her classes, prices, and teaching methods. +**Official URL: https://thefluentspanishhouse.com** + +## About Marta + +Marta is a Spanish teacher with years of experience teaching students of all ages and levels. Her dynamic and personalized approach has helped many students achieve their language goals. + +## Classes + +We offer a variety of classes to suit your needs: + +- **Individual Classes:** Perfect for personalized attention and learning at your own pace. +- **Group Classes:** Ideal for learning in a collaborative environment and making new friends. +- **Online Classes:** Complete flexibility to learn from anywhere in the world. + +## Prices + +Class prices vary depending on the type and duration. Here's a breakdown: + +- **Individual Classes: €21** + +- **Group Classes: €15** +- **Free Beginner Classes with Test Included: €0** + +## Contact + +For more information or to book a class, you can contact Marta through: + +- **Email:** mar411geca@gmail.com +- **Phone:** +34 617 286 125 +- [Contact Form](https://thefluentspanishhouse.com/contact) + +## Social Media + +Follow me on my social media to stay updated with the latest news and promotions! + +- [Facebook](https://www.facebook.com/thefluentspanishhouse/) + +## Contributions + +If you have any suggestions or want to contribute to the development of this website, feel free to fork and send a pull request. ❤️ +Or if you find any bugs or issues, report them via an Issue. 🪲 + +**Before submitting a PR, please ensure your code is properly formatted using Prettier:** + +1. Check formatting: `npm run format` +2. Fix formatting issues: `npm run format:fix` + +Thank you in advance. + +## License + +This project is under the MIT License. For more details, see the [LICENSE](LICENSE) file. +[Terms and Conditions](https://thefluentspanishhouse.vercel.app/info) +[Privacy Policy](https://thefluentspanishhouse.vercel.app/info) + +--- + +We hope you enjoy learning Spanish with me. See you in class! diff --git a/client/.eslintrc.cjs b/client/.eslintrc.cjs deleted file mode 100644 index d6c95379..00000000 --- a/client/.eslintrc.cjs +++ /dev/null @@ -1,18 +0,0 @@ -module.exports = { - root: true, - env: { browser: true, es2020: true }, - extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - 'plugin:react-hooks/recommended', - ], - ignorePatterns: ['dist', '.eslintrc.cjs'], - parser: '@typescript-eslint/parser', - plugins: ['react-refresh'], - rules: { - 'react-refresh/only-export-components': [ - 'warn', - { allowConstantExport: true }, - ], - }, -} diff --git a/client/.gitignore b/client/.gitignore deleted file mode 100644 index e985853e..00000000 --- a/client/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.vercel diff --git a/client/index.html b/client/index.html index a254369e..11c12707 100644 --- a/client/index.html +++ b/client/index.html @@ -1,30 +1,43 @@ - +
- + - +