From 1468fac1cc4b638cfb769793a9c90315a52ee04c Mon Sep 17 00:00:00 2001 From: Alibek Date: Wed, 7 Feb 2024 23:24:59 +0600 Subject: [PATCH] remade folder structure, fixed problem with build --- .env | 2 - .gitignore | 1 + app/about-us/page.tsx | 7 - app/layout.tsx | 3 - app/page.tsx | 3 - app/profile/page.tsx | 7 - app/sign-in/page.tsx | 7 - lib/next-auth.d.ts | 3 +- next.config.mjs | 1 + package.json | 4 +- src/App/App.tsx | 21 -- src/App/Providers.tsx | 11 + src/App/about-us/page.tsx | 7 + src/App/api/auth/[...nextauth]/route.ts | 6 + src/App/fonts.scss | 9 - src/App/globals.scss | 33 +-- src/App/layout.tsx | 30 +++ src/{pages/Home/Home.tsx => App/page.tsx} | 20 +- src/App/profile/page.tsx | 5 + src/App/sign-in/page.tsx | 8 + .../sign-in/styles.module.scss} | 0 src/Shared/API/baseAPI.ts | 2 - src/Shared/config/apiConfig.ts | 7 + src/Shared/config/authConfig.ts | 89 ++++++++ .../fonts/TildaSans-Black/TildaSans-Black.css | 1 + .../TildaSans-Regular/TildaSans-Regular.css | 1 + .../fonts/{TildaSans.css => fonts.scss} | 2 +- src/Widgets/Footer/Footer.scss | 2 +- src/Widgets/Footer/Footer.tsx | 10 +- src/Widgets/Header/HeaderLink/HeaderLink.scss | 3 + src/Widgets/MapSection/mapSectionStore.ts | 7 +- src/Widgets/Navbar/Navbar.scss | 2 +- src/Widgets/NewsSection/newsSectionStore.ts | 5 +- .../RatingSection/ratingSectionStore.ts | 7 +- .../StatisticsSection/StatisticsSection.tsx | 2 +- .../statisticsSection.store.ts | 8 +- src/middleware.ts | 3 + tsconfig.json | 17 +- yarn.lock | 197 +++++++++++++++++- 39 files changed, 436 insertions(+), 117 deletions(-) delete mode 100644 .env delete mode 100644 app/about-us/page.tsx delete mode 100644 app/layout.tsx delete mode 100644 app/page.tsx delete mode 100644 app/profile/page.tsx delete mode 100644 app/sign-in/page.tsx delete mode 100644 src/App/App.tsx create mode 100644 src/App/Providers.tsx create mode 100644 src/App/about-us/page.tsx create mode 100644 src/App/api/auth/[...nextauth]/route.ts delete mode 100644 src/App/fonts.scss create mode 100644 src/App/layout.tsx rename src/{pages/Home/Home.tsx => App/page.tsx} (73%) create mode 100644 src/App/profile/page.tsx create mode 100644 src/App/sign-in/page.tsx rename src/{pages/Home/Home.scss => App/sign-in/styles.module.scss} (100%) delete mode 100644 src/Shared/API/baseAPI.ts create mode 100644 src/Shared/config/apiConfig.ts create mode 100644 src/Shared/config/authConfig.ts rename src/Shared/fonts/{TildaSans.css => fonts.scss} (84%) create mode 100644 src/middleware.ts diff --git a/.env b/.env deleted file mode 100644 index efab21d..0000000 --- a/.env +++ /dev/null @@ -1,2 +0,0 @@ -NEXTAUTH_SECRET=";sadmfxflpdk" -NEXTAUTH_URL="http://localhost:3000" \ No newline at end of file diff --git a/.gitignore b/.gitignore index fd3dbb5..7e43796 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ /.pnp .pnp.js .yarn/install-state.gz +.env # testing /coverage diff --git a/app/about-us/page.tsx b/app/about-us/page.tsx deleted file mode 100644 index a54c709..0000000 --- a/app/about-us/page.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import React from "react"; - -const page = () => { - return
page
; -}; - -export default page; diff --git a/app/layout.tsx b/app/layout.tsx deleted file mode 100644 index d592330..0000000 --- a/app/layout.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import RootLayout from "@/app/App"; - -export default RootLayout; diff --git a/app/page.tsx b/app/page.tsx deleted file mode 100644 index 9d4589f..0000000 --- a/app/page.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import Home from "@/pages/Home/Home"; - -export default Home; diff --git a/app/profile/page.tsx b/app/profile/page.tsx deleted file mode 100644 index a54c709..0000000 --- a/app/profile/page.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import React from "react"; - -const page = () => { - return
page
; -}; - -export default page; diff --git a/app/sign-in/page.tsx b/app/sign-in/page.tsx deleted file mode 100644 index a54c709..0000000 --- a/app/sign-in/page.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import React from "react"; - -const page = () => { - return
page
; -}; - -export default page; diff --git a/lib/next-auth.d.ts b/lib/next-auth.d.ts index f526420..eb66a0c 100644 --- a/lib/next-auth.d.ts +++ b/lib/next-auth.d.ts @@ -4,6 +4,7 @@ declare module "next-auth" { interface Session { refresh_token: string; access_token: string; + expires_in: string; } } @@ -13,6 +14,6 @@ declare module "next-auth/jwt" { interface JWT { refresh_token: string; access_token: string; - exp: number; + expires_in: string; } } diff --git a/next.config.mjs b/next.config.mjs index e8b1ccf..22adadb 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,5 +1,6 @@ /** @type {import('next').NextConfig} */ const nextConfig = { + distDir: "build", images: { remotePatterns: [ { diff --git a/package.json b/package.json index 774b7ae..f2aae33 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ }, "dependencies": { "axios": "^1.6.5", + "dotenv": "^16.4.1", "leaflet": "^1.9.4", "next": "14.1.0", "next-auth": "^4.24.5", @@ -17,12 +18,13 @@ "react-dom": "^18", "react-leaflet": "^4.2.1", "sass": "^1.70.0", + "sharp": "^0.33.2", "use-debounce": "^10.0.0", "zustand": "^4.5.0" }, "devDependencies": { "@types/leaflet": "^1.9.8", - "@types/node": "^20", + "@types/node": "^20.11.16", "@types/react": "^18", "@types/react-dom": "^18", "@types/react-leaflet": "^3.0.0", diff --git a/src/App/App.tsx b/src/App/App.tsx deleted file mode 100644 index 64c0881..0000000 --- a/src/App/App.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import "./globals.scss"; -import "./fonts.scss"; -import "./App.scss"; -import Footer from "@/widgets/Footer/Footer"; -import Navbar from "@/widgets/Navbar/Navbar"; - -export default function RootLayout({ - children, -}: Readonly<{ - children: React.ReactNode; -}>) { - return ( - - - -
{children}
-