diff --git a/global.d.ts b/global.d.ts index 2799e9a..b1db87e 100644 --- a/global.d.ts +++ b/global.d.ts @@ -1,4 +1,4 @@ // Use type safe message keys with `next-intl` -type Messages = typeof import("./messages/fr.json"); +type Messages = typeof import("./src/messages/fr.json"); declare interface IntlMessages extends Messages {} diff --git a/next.config.js b/next.config.js index 85a81ea..b1689fd 100644 --- a/next.config.js +++ b/next.config.js @@ -5,7 +5,7 @@ const withBundleAnalyzer = require("@next/bundle-analyzer")({ enabled: process.env.ANALYZE === "true", }); -const withNextIntl = require("next-intl/plugin")("./i18n.ts"); +const withNextIntl = require("next-intl/plugin")("./src/i18n.ts"); const withPWA = require("next-pwa")({ dest: "public", diff --git a/app/[locale]/add-tournament/Map.tsx b/src/app/[locale]/add-tournament/Map.tsx similarity index 97% rename from app/[locale]/add-tournament/Map.tsx rename to src/app/[locale]/add-tournament/Map.tsx index 3cd66b4..1c24eaa 100644 --- a/app/[locale]/add-tournament/Map.tsx +++ b/src/app/[locale]/add-tournament/Map.tsx @@ -10,7 +10,7 @@ import "leaflet/dist/leaflet.css"; import { useFormContext, useWatch } from "react-hook-form"; import { MapContainer, Marker, TileLayer } from "react-leaflet"; -import { mapBoundsAtom } from "@/app/atoms"; +import { mapBoundsAtom } from "@/atoms"; import MapEvents from "@/components/MapEvents"; const center: LatLngLiteral = { lat: 47.0844, lng: 2.3964 }; diff --git a/app/[locale]/add-tournament/TournamentForm.tsx b/src/app/[locale]/add-tournament/TournamentForm.tsx similarity index 100% rename from app/[locale]/add-tournament/TournamentForm.tsx rename to src/app/[locale]/add-tournament/TournamentForm.tsx diff --git a/app/[locale]/add-tournament/page.tsx b/src/app/[locale]/add-tournament/page.tsx similarity index 100% rename from app/[locale]/add-tournament/page.tsx rename to src/app/[locale]/add-tournament/page.tsx diff --git a/app/[locale]/clubs/ClubMap.tsx b/src/app/[locale]/clubs/ClubMap.tsx similarity index 95% rename from app/[locale]/clubs/ClubMap.tsx rename to src/app/[locale]/clubs/ClubMap.tsx index 79aa364..ba4a007 100644 --- a/app/[locale]/clubs/ClubMap.tsx +++ b/src/app/[locale]/clubs/ClubMap.tsx @@ -10,7 +10,7 @@ import "leaflet.smooth_marker_bouncing"; import "leaflet/dist/leaflet.css"; import { countBy, groupBy } from "lodash"; -import { clubsAtom } from "@/app/atoms"; +import { clubsAtom } from "@/atoms"; import { Map, MapMarker } from "@/components/Map"; import { ClubMarker } from "./ClubMarker"; diff --git a/app/[locale]/clubs/ClubMarker.tsx b/src/app/[locale]/clubs/ClubMarker.tsx similarity index 96% rename from app/[locale]/clubs/ClubMarker.tsx rename to src/app/[locale]/clubs/ClubMarker.tsx index 1eb70b7..d34af8c 100644 --- a/app/[locale]/clubs/ClubMarker.tsx +++ b/src/app/[locale]/clubs/ClubMarker.tsx @@ -6,9 +6,9 @@ import { useSetAtom } from "jotai"; import L from "leaflet"; import { Marker, MarkerProps, Popup } from "react-leaflet"; -import { debouncedHoveredMapIdAtom } from "@/app/atoms"; -import { TimeControlColours } from "@/app/constants"; +import { debouncedHoveredMapIdAtom } from "@/atoms"; import type { MarkerRef } from "@/components/Map"; +import { TimeControlColours } from "@/constants"; import type { BouncingMarker } from "@/leafletTypes"; import { Club } from "@/types"; diff --git a/app/[locale]/clubs/ClubTable.tsx b/src/app/[locale]/clubs/ClubTable.tsx similarity index 99% rename from app/[locale]/clubs/ClubTable.tsx rename to src/app/[locale]/clubs/ClubTable.tsx index de17c2c..f68bb39 100644 --- a/app/[locale]/clubs/ClubTable.tsx +++ b/src/app/[locale]/clubs/ClubTable.tsx @@ -13,7 +13,7 @@ import { filteredClubsListAtom, hoveredMapIdAtom, syncVisibleAtom, -} from "@/app/atoms"; +} from "@/atoms"; import ScrollToTopButton from "@/components/ScrollToTopButton"; import SearchBar from "@/components/SearchBar"; import { useBreakpoint } from "@/hooks/tailwind"; diff --git a/app/[locale]/clubs/ClubsDisplay.tsx b/src/app/[locale]/clubs/ClubsDisplay.tsx similarity index 95% rename from app/[locale]/clubs/ClubsDisplay.tsx rename to src/app/[locale]/clubs/ClubsDisplay.tsx index 3df8305..0ad39cf 100644 --- a/app/[locale]/clubs/ClubsDisplay.tsx +++ b/src/app/[locale]/clubs/ClubsDisplay.tsx @@ -3,7 +3,7 @@ import { useHydrateAtoms } from "jotai/utils"; import dynamic from "next/dynamic"; -import { clubsAtom } from "@/app/atoms"; +import { clubsAtom } from "@/atoms"; import LoadingMap from "@/components/LoadingMap"; import { Club } from "@/types"; diff --git a/app/[locale]/clubs/page.tsx b/src/app/[locale]/clubs/page.tsx similarity index 100% rename from app/[locale]/clubs/page.tsx rename to src/app/[locale]/clubs/page.tsx diff --git a/app/[locale]/components/Footer.tsx b/src/app/[locale]/components/Footer.tsx similarity index 100% rename from app/[locale]/components/Footer.tsx rename to src/app/[locale]/components/Footer.tsx diff --git a/app/[locale]/components/Hamburger.tsx b/src/app/[locale]/components/Hamburger.tsx similarity index 96% rename from app/[locale]/components/Hamburger.tsx rename to src/app/[locale]/components/Hamburger.tsx index 8b37f76..186da0e 100644 --- a/app/[locale]/components/Hamburger.tsx +++ b/src/app/[locale]/components/Hamburger.tsx @@ -3,7 +3,7 @@ import { useAtom } from "jotai"; import { twMerge } from "tailwind-merge"; -import { burgerMenuIsOpenAtom } from "@/app/atoms"; +import { burgerMenuIsOpenAtom } from "@/atoms"; import HamburgerMenu from "./HamburgerMenu"; diff --git a/app/[locale]/components/HamburgerMenu.tsx b/src/app/[locale]/components/HamburgerMenu.tsx similarity index 97% rename from app/[locale]/components/HamburgerMenu.tsx rename to src/app/[locale]/components/HamburgerMenu.tsx index cb2a934..bdcc462 100644 --- a/app/[locale]/components/HamburgerMenu.tsx +++ b/src/app/[locale]/components/HamburgerMenu.tsx @@ -4,7 +4,7 @@ import { useAtom } from "jotai"; import { useTranslations } from "next-intl"; import { twMerge } from "tailwind-merge"; -import { burgerMenuIsOpenAtom } from "@/app/atoms"; +import { burgerMenuIsOpenAtom } from "@/atoms"; import { Link } from "@/utils/navigation"; const HamburgerMenu = () => { diff --git a/app/[locale]/components/Navbar.tsx b/src/app/[locale]/components/Navbar.tsx similarity index 100% rename from app/[locale]/components/Navbar.tsx rename to src/app/[locale]/components/Navbar.tsx diff --git a/app/[locale]/components/ThemeSwitcher.tsx b/src/app/[locale]/components/ThemeSwitcher.tsx similarity index 100% rename from app/[locale]/components/ThemeSwitcher.tsx rename to src/app/[locale]/components/ThemeSwitcher.tsx diff --git a/app/[locale]/contact-us/ContactForm.tsx b/src/app/[locale]/contact-us/ContactForm.tsx similarity index 100% rename from app/[locale]/contact-us/ContactForm.tsx rename to src/app/[locale]/contact-us/ContactForm.tsx diff --git a/app/[locale]/contact-us/page.tsx b/src/app/[locale]/contact-us/page.tsx similarity index 100% rename from app/[locale]/contact-us/page.tsx rename to src/app/[locale]/contact-us/page.tsx diff --git a/app/[locale]/elo/KFactor.tsx b/src/app/[locale]/elo/KFactor.tsx similarity index 100% rename from app/[locale]/elo/KFactor.tsx rename to src/app/[locale]/elo/KFactor.tsx diff --git a/app/[locale]/elo/ManualEloForm.tsx b/src/app/[locale]/elo/ManualEloForm.tsx similarity index 100% rename from app/[locale]/elo/ManualEloForm.tsx rename to src/app/[locale]/elo/ManualEloForm.tsx diff --git a/app/[locale]/elo/TournamentResults.tsx b/src/app/[locale]/elo/TournamentResults.tsx similarity index 100% rename from app/[locale]/elo/TournamentResults.tsx rename to src/app/[locale]/elo/TournamentResults.tsx diff --git a/app/[locale]/elo/page.tsx b/src/app/[locale]/elo/page.tsx similarity index 100% rename from app/[locale]/elo/page.tsx rename to src/app/[locale]/elo/page.tsx diff --git a/app/[locale]/layout.tsx b/src/app/[locale]/layout.tsx similarity index 98% rename from app/[locale]/layout.tsx rename to src/app/[locale]/layout.tsx index 58f56a8..d5fba4f 100644 --- a/app/[locale]/layout.tsx +++ b/src/app/[locale]/layout.tsx @@ -7,8 +7,7 @@ import { notFound } from "next/navigation"; import Script from "next/script"; import "@/css/globals.css"; - -import Providers from "../providers"; +import Providers from "@/providers"; import Footer from "./components/Footer"; import Navbar from "./components/Navbar"; diff --git a/app/[locale]/page.tsx b/src/app/[locale]/page.tsx similarity index 96% rename from app/[locale]/page.tsx rename to src/app/[locale]/page.tsx index 3d85a82..7e1ddcc 100644 --- a/app/[locale]/page.tsx +++ b/src/app/[locale]/page.tsx @@ -1,7 +1,7 @@ import { useTranslations } from "next-intl"; import Image from "next/image"; -import bgImage from "@/public/images/map-bg.jpg"; +import bgImage from "@/img/map-bg.jpg"; import { Link } from "@/utils/navigation"; export default function Home() { diff --git a/app/[locale]/tournaments/Legend.tsx b/src/app/[locale]/tournaments/Legend.tsx similarity index 93% rename from app/[locale]/tournaments/Legend.tsx rename to src/app/[locale]/tournaments/Legend.tsx index d91b7e1..9e09523 100644 --- a/app/[locale]/tournaments/Legend.tsx +++ b/src/app/[locale]/tournaments/Legend.tsx @@ -5,8 +5,8 @@ import L from "leaflet"; import { useTranslations } from "next-intl"; import { useMap } from "react-leaflet"; -import { filteredTournamentsByTimeControlAtom } from "@/app/atoms"; -import { TimeControlColours } from "@/app/constants"; +import { filteredTournamentsByTimeControlAtom } from "@/atoms"; +import { TimeControlColours } from "@/constants"; import { TimeControl } from "@/types"; const Legend = () => { diff --git a/app/[locale]/tournaments/TimeControlFilters.tsx b/src/app/[locale]/tournaments/TimeControlFilters.tsx similarity index 98% rename from app/[locale]/tournaments/TimeControlFilters.tsx rename to src/app/[locale]/tournaments/TimeControlFilters.tsx index 10a78af..5022359 100644 --- a/app/[locale]/tournaments/TimeControlFilters.tsx +++ b/src/app/[locale]/tournaments/TimeControlFilters.tsx @@ -7,7 +7,7 @@ import { otherAtom, rapidAtom, tournamentsAtom, -} from "@/app/atoms"; +} from "@/atoms"; import { TimeControl } from "@/types"; const TimeControlFilters = () => { diff --git a/app/[locale]/tournaments/TournamentMap.tsx b/src/app/[locale]/tournaments/TournamentMap.tsx similarity index 94% rename from app/[locale]/tournaments/TournamentMap.tsx rename to src/app/[locale]/tournaments/TournamentMap.tsx index a513f70..5ee6e4f 100644 --- a/app/[locale]/tournaments/TournamentMap.tsx +++ b/src/app/[locale]/tournaments/TournamentMap.tsx @@ -10,12 +10,9 @@ import "leaflet.smooth_marker_bouncing"; import "leaflet/dist/leaflet.css"; import { countBy, groupBy } from "lodash"; -import { - filteredTournamentsByTimeControlAtom, - normsOnlyAtom, -} from "@/app/atoms"; -import { TimeControlColours } from "@/app/constants"; +import { filteredTournamentsByTimeControlAtom, normsOnlyAtom } from "@/atoms"; import { Map, MapMarker } from "@/components/Map"; +import { TimeControlColours } from "@/constants"; import { generatePieSVG } from "@/lib/pie"; import { TimeControl } from "@/types"; diff --git a/app/[locale]/tournaments/TournamentMarker.tsx b/src/app/[locale]/tournaments/TournamentMarker.tsx similarity index 96% rename from app/[locale]/tournaments/TournamentMarker.tsx rename to src/app/[locale]/tournaments/TournamentMarker.tsx index 75d7423..9a6395f 100644 --- a/app/[locale]/tournaments/TournamentMarker.tsx +++ b/src/app/[locale]/tournaments/TournamentMarker.tsx @@ -9,9 +9,9 @@ import { useTranslations } from "next-intl"; import { FaTrophy } from "react-icons/fa"; import { Marker, MarkerProps, Popup } from "react-leaflet"; -import { debouncedHoveredMapIdAtom } from "@/app/atoms"; -import { TimeControlColours } from "@/app/constants"; +import { debouncedHoveredMapIdAtom } from "@/atoms"; import type { MarkerRef } from "@/components/Map"; +import { TimeControlColours } from "@/constants"; import type { BouncingMarker } from "@/leafletTypes"; import { Tournament } from "@/types"; diff --git a/app/[locale]/tournaments/TournamentTable.tsx b/src/app/[locale]/tournaments/TournamentTable.tsx similarity index 99% rename from app/[locale]/tournaments/TournamentTable.tsx rename to src/app/[locale]/tournaments/TournamentTable.tsx index 13a66bc..a4b7fe2 100644 --- a/app/[locale]/tournaments/TournamentTable.tsx +++ b/src/app/[locale]/tournaments/TournamentTable.tsx @@ -16,7 +16,7 @@ import { hoveredMapIdAtom, normsOnlyAtom, syncVisibleAtom, -} from "@/app/atoms"; +} from "@/atoms"; import ScrollToTopButton from "@/components/ScrollToTopButton"; import SearchBar from "@/components/SearchBar"; import { useBreakpoint } from "@/hooks/tailwind"; diff --git a/app/[locale]/tournaments/TournamentsDisplay.tsx b/src/app/[locale]/tournaments/TournamentsDisplay.tsx similarity index 95% rename from app/[locale]/tournaments/TournamentsDisplay.tsx rename to src/app/[locale]/tournaments/TournamentsDisplay.tsx index c918d6e..a9570d8 100644 --- a/app/[locale]/tournaments/TournamentsDisplay.tsx +++ b/src/app/[locale]/tournaments/TournamentsDisplay.tsx @@ -3,7 +3,7 @@ import { useHydrateAtoms } from "jotai/utils"; import dynamic from "next/dynamic"; -import { tournamentsAtom } from "@/app/atoms"; +import { tournamentsAtom } from "@/atoms"; import LoadingMap from "@/components/LoadingMap"; import { Tournament } from "@/types"; diff --git a/app/[locale]/tournaments/page.tsx b/src/app/[locale]/tournaments/page.tsx similarity index 100% rename from app/[locale]/tournaments/page.tsx rename to src/app/[locale]/tournaments/page.tsx diff --git a/app/api/trpc/[trpc]/route.ts b/src/app/api/trpc/[trpc]/route.ts similarity index 89% rename from app/api/trpc/[trpc]/route.ts rename to src/app/api/trpc/[trpc]/route.ts index d7a73c9..062cc47 100644 --- a/app/api/trpc/[trpc]/route.ts +++ b/src/app/api/trpc/[trpc]/route.ts @@ -3,7 +3,7 @@ import { fetchRequestHandler, } from "@trpc/server/adapters/fetch"; -import { appRouter } from "@/app/server/appRouter"; +import { appRouter } from "@/server/appRouter"; const handler = (request: Request) => { return fetchRequestHandler({ diff --git a/app/favicon.ico b/src/app/favicon.ico similarity index 100% rename from app/favicon.ico rename to src/app/favicon.ico diff --git a/app/icon.png b/src/app/icon.png similarity index 100% rename from app/icon.png rename to src/app/icon.png diff --git a/app/robots.ts b/src/app/robots.ts similarity index 100% rename from app/robots.ts rename to src/app/robots.ts diff --git a/app/sitemap.ts b/src/app/sitemap.ts similarity index 100% rename from app/sitemap.ts rename to src/app/sitemap.ts diff --git a/app/atoms.ts b/src/atoms.ts similarity index 100% rename from app/atoms.ts rename to src/atoms.ts diff --git a/components/InfoMessage.tsx b/src/components/InfoMessage.tsx similarity index 100% rename from components/InfoMessage.tsx rename to src/components/InfoMessage.tsx diff --git a/components/LoadingMap.tsx b/src/components/LoadingMap.tsx similarity index 100% rename from components/LoadingMap.tsx rename to src/components/LoadingMap.tsx diff --git a/components/Map.tsx b/src/components/Map.tsx similarity index 99% rename from components/Map.tsx rename to src/components/Map.tsx index 4edc903..41b2558 100644 --- a/components/Map.tsx +++ b/src/components/Map.tsx @@ -18,7 +18,7 @@ import { FaAngleDoubleDown } from "react-icons/fa"; import { LayerGroup, MapContainer, TileLayer } from "react-leaflet"; import MarkerClusterGroup from "react-leaflet-cluster"; -import { debouncedHoveredListIdAtom, mapBoundsAtom } from "@/app/atoms"; +import { debouncedHoveredListIdAtom, mapBoundsAtom } from "@/atoms"; import MapEvents from "@/components/MapEvents"; export type MarkerRef = { diff --git a/components/MapEvents.tsx b/src/components/MapEvents.tsx similarity index 95% rename from components/MapEvents.tsx rename to src/components/MapEvents.tsx index 8a4d489..b3f5710 100644 --- a/components/MapEvents.tsx +++ b/src/components/MapEvents.tsx @@ -4,7 +4,7 @@ import { useSetAtom } from "jotai"; import L from "leaflet"; import { useMapEvent } from "react-leaflet"; -import { mapBoundsAtom } from "@/app/atoms"; +import { mapBoundsAtom } from "@/atoms"; const MapEvents = () => { const setMapBounds = useSetAtom(mapBoundsAtom); diff --git a/components/ScrollToTopButton.tsx b/src/components/ScrollToTopButton.tsx similarity index 100% rename from components/ScrollToTopButton.tsx rename to src/components/ScrollToTopButton.tsx diff --git a/components/SearchBar.tsx b/src/components/SearchBar.tsx similarity index 97% rename from components/SearchBar.tsx rename to src/components/SearchBar.tsx index 7cbded9..ed3310c 100644 --- a/components/SearchBar.tsx +++ b/src/components/SearchBar.tsx @@ -4,7 +4,7 @@ import { useAtom } from "jotai/index"; import { useTranslations } from "next-intl"; import { IoCloseOutline } from "react-icons/io5"; -import { searchStringAtom } from "@/app/atoms"; +import { searchStringAtom } from "@/atoms"; const SearchBar = () => { const t = useTranslations("Tournaments"); diff --git a/components/Spinner.tsx b/src/components/Spinner.tsx similarity index 100% rename from components/Spinner.tsx rename to src/components/Spinner.tsx diff --git a/components/form/DateField/components/DatePickerCustomHeader.tsx b/src/components/form/DateField/components/DatePickerCustomHeader.tsx similarity index 100% rename from components/form/DateField/components/DatePickerCustomHeader.tsx rename to src/components/form/DateField/components/DatePickerCustomHeader.tsx diff --git a/components/form/DateField/components/InputDatePicker.tsx b/src/components/form/DateField/components/InputDatePicker.tsx similarity index 100% rename from components/form/DateField/components/InputDatePicker.tsx rename to src/components/form/DateField/components/InputDatePicker.tsx diff --git a/components/form/DateField/components/index.ts b/src/components/form/DateField/components/index.ts similarity index 100% rename from components/form/DateField/components/index.ts rename to src/components/form/DateField/components/index.ts diff --git a/components/form/DateField/index.tsx b/src/components/form/DateField/index.tsx similarity index 100% rename from components/form/DateField/index.tsx rename to src/components/form/DateField/index.tsx diff --git a/components/form/ErrorMessage.tsx b/src/components/form/ErrorMessage.tsx similarity index 100% rename from components/form/ErrorMessage.tsx rename to src/components/form/ErrorMessage.tsx diff --git a/components/form/Field.tsx b/src/components/form/Field.tsx similarity index 100% rename from components/form/Field.tsx rename to src/components/form/Field.tsx diff --git a/components/form/Label.tsx b/src/components/form/Label.tsx similarity index 100% rename from components/form/Label.tsx rename to src/components/form/Label.tsx diff --git a/components/form/RadioGroupField.tsx b/src/components/form/RadioGroupField.tsx similarity index 100% rename from components/form/RadioGroupField.tsx rename to src/components/form/RadioGroupField.tsx diff --git a/components/form/SelectField.tsx b/src/components/form/SelectField.tsx similarity index 100% rename from components/form/SelectField.tsx rename to src/components/form/SelectField.tsx diff --git a/components/form/SwitchField.tsx b/src/components/form/SwitchField.tsx similarity index 100% rename from components/form/SwitchField.tsx rename to src/components/form/SwitchField.tsx diff --git a/components/form/TextAreaField.tsx b/src/components/form/TextAreaField.tsx similarity index 100% rename from components/form/TextAreaField.tsx rename to src/components/form/TextAreaField.tsx diff --git a/components/form/TextField.tsx b/src/components/form/TextField.tsx similarity index 100% rename from components/form/TextField.tsx rename to src/components/form/TextField.tsx diff --git a/app/constants.ts b/src/constants.ts similarity index 100% rename from app/constants.ts rename to src/constants.ts diff --git a/css/globals.css b/src/css/globals.css similarity index 100% rename from css/globals.css rename to src/css/globals.css diff --git a/hooks/tailwind.ts b/src/hooks/tailwind.ts similarity index 97% rename from hooks/tailwind.ts rename to src/hooks/tailwind.ts index c96ea79..1314125 100644 --- a/hooks/tailwind.ts +++ b/src/hooks/tailwind.ts @@ -2,7 +2,7 @@ import { useEffect, useLayoutEffect, useMemo, useRef, useState } from "react"; import resolveConfig from "tailwindcss/resolveConfig"; -import tailwindConfig from "@/tailwind.config.js"; +import tailwindConfig from "@/../tailwind.config.js"; const config = resolveConfig(tailwindConfig); diff --git a/hooks/useDarkMode.ts b/src/hooks/useDarkMode.ts similarity index 96% rename from hooks/useDarkMode.ts rename to src/hooks/useDarkMode.ts index 53fffe0..31af34c 100644 --- a/hooks/useDarkMode.ts +++ b/src/hooks/useDarkMode.ts @@ -22,7 +22,7 @@ function useDarkMode(): [string, Dispatch>] { if (typeof window !== "undefined") { localStorage.setItem("theme", theme); } - }, [theme]); + }, [colorTheme, theme]); return [colorTheme, setTheme]; } diff --git a/hooks/useDynamicViewportUnits.ts b/src/hooks/useDynamicViewportUnits.ts similarity index 100% rename from hooks/useDynamicViewportUnits.ts rename to src/hooks/useDynamicViewportUnits.ts diff --git a/i18n.ts b/src/i18n.ts similarity index 100% rename from i18n.ts rename to src/i18n.ts diff --git a/public/images/map-bg.jpg b/src/img/map-bg.jpg similarity index 100% rename from public/images/map-bg.jpg rename to src/img/map-bg.jpg diff --git a/leafletTypes.ts b/src/leafletTypes.ts similarity index 100% rename from leafletTypes.ts rename to src/leafletTypes.ts diff --git a/lib/mongodb.ts b/src/lib/mongodb.ts similarity index 100% rename from lib/mongodb.ts rename to src/lib/mongodb.ts diff --git a/lib/pie.ts b/src/lib/pie.ts similarity index 100% rename from lib/pie.ts rename to src/lib/pie.ts diff --git a/lib/sendMail.ts b/src/lib/sendMail.ts similarity index 100% rename from lib/sendMail.ts rename to src/lib/sendMail.ts diff --git a/messages/en.json b/src/messages/en.json similarity index 100% rename from messages/en.json rename to src/messages/en.json diff --git a/messages/fr.json b/src/messages/fr.json similarity index 100% rename from messages/fr.json rename to src/messages/fr.json diff --git a/middleware.ts b/src/middleware.ts similarity index 87% rename from middleware.ts rename to src/middleware.ts index a3c1ec1..b7bfb33 100644 --- a/middleware.ts +++ b/src/middleware.ts @@ -1,6 +1,6 @@ import createMiddleware from "next-intl/middleware"; -import { locales, pathnames } from "@/utils//navigation"; +import { locales, pathnames } from "@/utils/navigation"; export default createMiddleware({ defaultLocale: "fr", diff --git a/app/providers/TrpcProvider.tsx b/src/providers/TrpcProvider.tsx similarity index 100% rename from app/providers/TrpcProvider.tsx rename to src/providers/TrpcProvider.tsx diff --git a/app/providers/index.tsx b/src/providers/index.tsx similarity index 100% rename from app/providers/index.tsx rename to src/providers/index.tsx diff --git a/resources/AppLogo.psd b/src/resources/AppLogo.psd similarity index 100% rename from resources/AppLogo.psd rename to src/resources/AppLogo.psd diff --git a/schemas.ts b/src/schemas.ts similarity index 100% rename from schemas.ts rename to src/schemas.ts diff --git a/app/server/appRouter.ts b/src/server/appRouter.ts similarity index 100% rename from app/server/appRouter.ts rename to src/server/appRouter.ts diff --git a/app/server/procedures/addTournament.ts b/src/server/procedures/addTournament.ts similarity index 56% rename from app/server/procedures/addTournament.ts rename to src/server/procedures/addTournament.ts index 00c83e7..f039045 100644 --- a/app/server/procedures/addTournament.ts +++ b/src/server/procedures/addTournament.ts @@ -31,7 +31,7 @@ export const addTournament = publicProcedure coordinates: tournament.coordinates as [number, number], entry_method: "manual", pending: true, - status: 'scheduled' + status: "scheduled", }; const result = await db.insertOne(tournamentData); @@ -39,32 +39,37 @@ export const addTournament = publicProcedure if (result.insertedId) { const { tournament, country, date, time_control } = tournamentData; - if (typeof process.env.DISCORD_WEBHOOK_ADD_TOURNAMENT_URL === "string") { - await fetch(process.env.DISCORD_WEBHOOK_ADD_TOURNAMENT_URL as string, { - method: "POST", - headers: { - "Content-Type": "application/json", + if ( + typeof process.env.DISCORD_WEBHOOK_ADD_TOURNAMENT_URL === "string" + ) { + await fetch( + process.env.DISCORD_WEBHOOK_ADD_TOURNAMENT_URL as string, + { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + embeds: [ + { + title: "Tournament Submitted", + fields: [ + { name: "Tournament", value: tournament }, + { name: "Country", value: country }, + { name: "Date", value: date }, + { + name: "Time Control", + value: time_control, + }, + { name: "Sender", value: name }, + { name: "Sender Email", value: email }, + { name: "Message", value: message ?? "" }, + ], + }, + ], + }), }, - body: JSON.stringify({ - embeds: [ - { - title: "Tournament Submitted", - fields: [ - { name: "Tournament", value: tournament }, - { name: "Country", value: country }, - { name: "Date", value: date }, - { - name: "Time Control", - value: time_control, - }, - { name: "Sender", value: name }, - { name: "Sender Email", value: email }, - { name: "Message", value: message ?? "" }, - ], - }, - ], - }), - }); + ); } return true; diff --git a/app/server/procedures/contactUs.ts b/src/server/procedures/contactUs.ts similarity index 100% rename from app/server/procedures/contactUs.ts rename to src/server/procedures/contactUs.ts diff --git a/app/server/procedures/fetchTournamentResults.ts b/src/server/procedures/fetchTournamentResults.ts similarity index 95% rename from app/server/procedures/fetchTournamentResults.ts rename to src/server/procedures/fetchTournamentResults.ts index 8cb6e4b..410329a 100644 --- a/app/server/procedures/fetchTournamentResults.ts +++ b/src/server/procedures/fetchTournamentResults.ts @@ -118,18 +118,18 @@ export const fetchTournamentResults = publicProcedure throw new Error("ERR_NO_TOURNAMENT_ID"); } - const headers = new Headers() - const apiKey = process.env.RESULTS_API_KEY + const headers = new Headers(); + const apiKey = process.env.RESULTS_API_KEY; if (apiKey) { - headers.append('api-key', apiKey) + headers.append("api-key", apiKey); } const rawResults = await fetch( `${process.env.RESULTS_SCRAPER_URL}${tournamentId}`, - { - headers: headers - } + { + headers: headers, + }, ); const results = await rawResults.json(); diff --git a/app/server/trpc.ts b/src/server/trpc.ts similarity index 100% rename from app/server/trpc.ts rename to src/server/trpc.ts diff --git a/types.ts b/src/types.ts similarity index 100% rename from types.ts rename to src/types.ts diff --git a/utils/atomWithDebounce.ts b/src/utils/atomWithDebounce.ts similarity index 100% rename from utils/atomWithDebounce.ts rename to src/utils/atomWithDebounce.ts diff --git a/utils/eloCalculator.ts b/src/utils/eloCalculator.ts similarity index 100% rename from utils/eloCalculator.ts rename to src/utils/eloCalculator.ts diff --git a/utils/formatDate.ts b/src/utils/formatDate.ts similarity index 100% rename from utils/formatDate.ts rename to src/utils/formatDate.ts diff --git a/utils/logger.ts b/src/utils/logger.ts similarity index 100% rename from utils/logger.ts rename to src/utils/logger.ts diff --git a/utils/navigation.ts b/src/utils/navigation.ts similarity index 100% rename from utils/navigation.ts rename to src/utils/navigation.ts diff --git a/utils/scrollHandlers.ts b/src/utils/scrollHandlers.ts similarity index 100% rename from utils/scrollHandlers.ts rename to src/utils/scrollHandlers.ts diff --git a/utils/string.ts b/src/utils/string.ts similarity index 100% rename from utils/string.ts rename to src/utils/string.ts diff --git a/utils/trpc.ts b/src/utils/trpc.ts similarity index 86% rename from utils/trpc.ts rename to src/utils/trpc.ts index c6e7ae5..1f838dc 100644 --- a/utils/trpc.ts +++ b/src/utils/trpc.ts @@ -1,7 +1,7 @@ import { createTRPCReact } from "@trpc/react-query"; import type { inferRouterInputs, inferRouterOutputs } from "@trpc/server"; -import type { AppRouter } from "@/app/server/appRouter"; +import type { AppRouter } from "@/server/appRouter"; export type APIRouterInput = inferRouterInputs; export type APIRouterOutput = inferRouterOutputs; diff --git a/tailwind.config.js b/tailwind.config.js index faa92c6..e554bae 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -3,9 +3,9 @@ module.exports = { darkMode: "class", content: [ - "./pages/**/*.{js,ts,jsx,tsx,mdx}", - "./components/**/*.{js,ts,jsx,tsx,mdx}", - "./app/**/*.{js,ts,jsx,tsx,mdx}", + "./src/pages/**/*.{js,ts,jsx,tsx,mdx}", + "./src/components/**/*.{js,ts,jsx,tsx,mdx}", + "./src/app/**/*.{js,ts,jsx,tsx,mdx}", ], theme: { extend: { diff --git a/tsconfig.json b/tsconfig.json index 48a103a..13f4e45 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -20,7 +20,7 @@ } ], "paths": { - "@/*": ["./*"] + "@/*": ["./src/*"] } }, "include": [