diff --git a/client/package-lock.json b/client/package-lock.json
index e855fe7..d41092c 100644
--- a/client/package-lock.json
+++ b/client/package-lock.json
@@ -8,16 +8,22 @@
"name": "client",
"version": "0.0.0",
"dependencies": {
+ "@dnd-kit/core": "^6.3.1",
+ "@dnd-kit/modifiers": "^9.0.0",
+ "@dnd-kit/sortable": "^10.0.0",
"@tailwindcss/vite": "^4.0.13",
+ "@tanstack/react-query": "^5.74.8",
"@telegram-apps/sdk-react": "^3.1.2",
"axios": "^1.8.3",
"motion": "^12.5.0",
"node": "^23.9.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
+ "react-hook-form": "^7.56.3",
"react-router-dom": "^7.3.0",
"shamps-tunnel": "^1.1.3",
"tailwindcss": "^4.0.13",
+ "uuid": "^11.1.0",
"zustand": "^5.0.3"
},
"devDependencies": {
@@ -332,6 +338,73 @@
"node": ">=6.9.0"
}
},
+ "node_modules/@dnd-kit/accessibility": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/@dnd-kit/accessibility/-/accessibility-3.1.1.tgz",
+ "integrity": "sha512-2P+YgaXF+gRsIihwwY1gCsQSYnu9Zyj2py8kY5fFvUM1qm2WA2u639R6YNVfU4GWr+ZM5mqEsfHZZLoRONbemw==",
+ "license": "MIT",
+ "dependencies": {
+ "tslib": "^2.0.0"
+ },
+ "peerDependencies": {
+ "react": ">=16.8.0"
+ }
+ },
+ "node_modules/@dnd-kit/core": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/@dnd-kit/core/-/core-6.3.1.tgz",
+ "integrity": "sha512-xkGBRQQab4RLwgXxoqETICr6S5JlogafbhNsidmrkVv2YRs5MLwpjoF2qpiGjQt8S9AoxtIV603s0GIUpY5eYQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@dnd-kit/accessibility": "^3.1.1",
+ "@dnd-kit/utilities": "^3.2.2",
+ "tslib": "^2.0.0"
+ },
+ "peerDependencies": {
+ "react": ">=16.8.0",
+ "react-dom": ">=16.8.0"
+ }
+ },
+ "node_modules/@dnd-kit/modifiers": {
+ "version": "9.0.0",
+ "resolved": "https://registry.npmjs.org/@dnd-kit/modifiers/-/modifiers-9.0.0.tgz",
+ "integrity": "sha512-ybiLc66qRGuZoC20wdSSG6pDXFikui/dCNGthxv4Ndy8ylErY0N3KVxY2bgo7AWwIbxDmXDg3ylAFmnrjcbVvw==",
+ "license": "MIT",
+ "dependencies": {
+ "@dnd-kit/utilities": "^3.2.2",
+ "tslib": "^2.0.0"
+ },
+ "peerDependencies": {
+ "@dnd-kit/core": "^6.3.0",
+ "react": ">=16.8.0"
+ }
+ },
+ "node_modules/@dnd-kit/sortable": {
+ "version": "10.0.0",
+ "resolved": "https://registry.npmjs.org/@dnd-kit/sortable/-/sortable-10.0.0.tgz",
+ "integrity": "sha512-+xqhmIIzvAYMGfBYYnbKuNicfSsk4RksY2XdmJhT+HAC01nix6fHCztU68jooFiMUB01Ky3F0FyOvhG/BZrWkg==",
+ "license": "MIT",
+ "dependencies": {
+ "@dnd-kit/utilities": "^3.2.2",
+ "tslib": "^2.0.0"
+ },
+ "peerDependencies": {
+ "@dnd-kit/core": "^6.3.0",
+ "react": ">=16.8.0"
+ }
+ },
+ "node_modules/@dnd-kit/utilities": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/@dnd-kit/utilities/-/utilities-3.2.2.tgz",
+ "integrity": "sha512-+MKAJEOfaBe5SmV6t34p80MMKhjvUz0vRrvVJbPT0WElzaOJ/1xs+D+KDv+tD/NE5ujfrChEcshd4fLn0wpiqg==",
+ "license": "MIT",
+ "dependencies": {
+ "tslib": "^2.0.0"
+ },
+ "peerDependencies": {
+ "react": ">=16.8.0"
+ }
+ },
"node_modules/@esbuild/aix-ppc64": {
"version": "0.25.1",
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.1.tgz",
@@ -1511,6 +1584,32 @@
"vite": "^5.2.0 || ^6"
}
},
+ "node_modules/@tanstack/query-core": {
+ "version": "5.74.7",
+ "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.74.7.tgz",
+ "integrity": "sha512-X3StkN/Y6KGHndTjJf8H8th7AX4bKfbRpiVhVqevf0QWlxl6DhyJ0TYG3R0LARa/+xqDwzU9mA4pbJxzPCI29A==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/tannerlinsley"
+ }
+ },
+ "node_modules/@tanstack/react-query": {
+ "version": "5.74.8",
+ "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.74.8.tgz",
+ "integrity": "sha512-Hs3QHLYyyc/yUI8tS7CIM8vRmlm+2gPBiNsHzcDclvqZNCgTc0LdXRrZDhSxxhcnXJrIMnIcoNPwj9BshsCT+Q==",
+ "license": "MIT",
+ "dependencies": {
+ "@tanstack/query-core": "5.74.7"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/tannerlinsley"
+ },
+ "peerDependencies": {
+ "react": "^18 || ^19"
+ }
+ },
"node_modules/@telegram-apps/bridge": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/@telegram-apps/bridge/-/bridge-2.4.0.tgz",
@@ -3917,6 +4016,22 @@
"react": "^19.0.0"
}
},
+ "node_modules/react-hook-form": {
+ "version": "7.56.3",
+ "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.56.3.tgz",
+ "integrity": "sha512-IK18V6GVbab4TAo1/cz3kqajxbDPGofdF0w7VHdCo0Nt8PrPlOZcuuDq9YYIV1BtjcX78x0XsldbQRQnQXWXmw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/react-hook-form"
+ },
+ "peerDependencies": {
+ "react": "^16.8.0 || ^17 || ^18 || ^19"
+ }
+ },
"node_modules/react-refresh": {
"version": "0.14.2",
"resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.2.tgz",
@@ -4350,6 +4465,19 @@
"punycode": "^2.1.0"
}
},
+ "node_modules/uuid": {
+ "version": "11.1.0",
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz",
+ "integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==",
+ "funding": [
+ "https://github.com/sponsors/broofa",
+ "https://github.com/sponsors/ctavan"
+ ],
+ "license": "MIT",
+ "bin": {
+ "uuid": "dist/esm/bin/uuid"
+ }
+ },
"node_modules/valibot": {
"version": "1.0.0-beta.14",
"resolved": "https://registry.npmjs.org/valibot/-/valibot-1.0.0-beta.14.tgz",
diff --git a/client/package.json b/client/package.json
index e935da6..e223f47 100644
--- a/client/package.json
+++ b/client/package.json
@@ -11,16 +11,22 @@
"preview": "vite preview"
},
"dependencies": {
+ "@dnd-kit/core": "^6.3.1",
+ "@dnd-kit/modifiers": "^9.0.0",
+ "@dnd-kit/sortable": "^10.0.0",
"@tailwindcss/vite": "^4.0.13",
+ "@tanstack/react-query": "^5.74.8",
"@telegram-apps/sdk-react": "^3.1.2",
"axios": "^1.8.3",
"motion": "^12.5.0",
"node": "^23.9.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
+ "react-hook-form": "^7.56.3",
"react-router-dom": "^7.3.0",
"shamps-tunnel": "^1.1.3",
"tailwindcss": "^4.0.13",
+ "uuid": "^11.1.0",
"zustand": "^5.0.3"
},
"devDependencies": {
diff --git a/client/public/config.js b/client/public/config.js
index 0832de4..b44b81a 100644
--- a/client/public/config.js
+++ b/client/public/config.js
@@ -1,4 +1,4 @@
window.api = {
- BOT_USERNAME: "vaniog_tglink_bot",
+ BOT_USERNAME: "leenky_dev_bot",
API_URL: "https://app.dev.leenky.ru",
};
diff --git a/client/src/App.tsx b/client/src/App.tsx
index ab71084..08c6269 100644
--- a/client/src/App.tsx
+++ b/client/src/App.tsx
@@ -1,20 +1,45 @@
import "./App.css";
import { Route, Routes, useLocation, useNavigate } from "react-router-dom";
-import { AboutFirstPage, AboutSecondPage } from "./pages/about.page";
-import ChatPage from "./pages/chat.page";
-import ChatsPage from "./pages/chats.page";
-import { useCallback, useEffect } from "react";
-import { getMePreview } from "./api/api";
-import { backButton, initData } from "@telegram-apps/sdk-react";
-import useUserStore from "./stores/user.store";
-import ProtectedRoute from "./components/protectedRoute.component";
-import CurrentProfilePage from "./pages/currentProfile.page";
-import EditProfilePage from "./pages/editProfile.page";
-import RegistrationPage from "./pages/registration.page";
+import { useCallback, useEffect, useMemo } from "react";
+import { backButton } from "@telegram-apps/sdk-react";
import InitialPage from "./pages/initial.page";
-import InvitationPage from "./pages/invitation.page";
-import ProfilePage from "./pages/profile.page";
import { AnimatePresence, motion } from "framer-motion";
+import InitDataWrapper from "./utils/InitDataWrapper";
+import ProtectedRoute from "./utils/protectedRoute";
+import {
+ AboutDeclinePolicy,
+ AboutFirstPage,
+ AboutSecondPage,
+ AboutThirdPage,
+} from "./pages/about.page";
+import ChatPage from "./pages/community.page";
+import CurrentProfilePage from "./pages/communityCurrentProfile.page";
+import ProfilePage from "./pages/profile.page";
+import CommunitiesPage from "./pages/communities.page";
+import ProfileRedirection from "./utils/profileRedirection";
+import RegistrationPage from "./pages/registration.page";
+import InvitationPage from "./pages/invitation.page";
+import EditProfileCommunityPage from "./pages/editProfileCommunity.page";
+import CreateCommunityLayout from "./pages/create_community/createLayout";
+import CreateCommunityInitial from "./pages/create_community/createCommunityInitial";
+import CreateCommunityWithChatLayout from "./pages/create_community/withChat/createCommunityWithChatLayout";
+import CreateCommunityWithoutChatLayout from "./pages/create_community/withoutChat/createCommunityWithoutChatLayout";
+import CommunityWithoutChatDescriptionPage from "./pages/create_community/withoutChat/communityWithoutChatDescriptionPage";
+import CommunityWithChatProfilePage from "./pages/create_community/withChat/communityWithChatProfilePage";
+import CommunityWithChatDescriptionPage from "./pages/create_community/withChat/communityWithChatDescriptionPage";
+import CommunityWithChatConnectPage from "./pages/create_community/withChat/communityWithChatConnectPage";
+import CommunityWithoutChatProfilePage from "./pages/create_community/withoutChat/communityWithoutChatProfilePage";
+import useCommunityWithChatInfoStore from "./stores/create_community/communityWithChatInfo.store";
+import useCommunityWithoutChatInfoStore from "./stores/create_community/communityWithoutChatInfo.store";
+import CommunityLinksPage from "./pages/create_community/communityLinksPage";
+import CommunitySettingsPage from "./pages/community_settings/communitySettingsPage";
+import CommunitySettingsProfilePage from "./pages/community_settings/communitySettingsProfilePage";
+import CommunitySettingsChatPage from "./pages/community_settings/communitySettingsChatPage";
+import CommunitySettingsDescriptionPage from "./pages/community_settings/communitySettingsDescriptionPage";
+import CommunitySettingsLinksPage from "./pages/community_settings/communitySettingsLinksPage";
+import CommunityWithChatSettingsDescriptionEditPage from "./pages/community_settings/communityWithChatSettingsDescriptionEditPage";
+import CommunityWithoutChatSettingsDescriptionEditPage from "./pages/community_settings/communityWithoutChatSettingsDescriptionEditPage";
+import PolicyPage from "./pages/policy.page";
const pageVariants = {
initial: { opacity: 0, y: 20 },
@@ -25,18 +50,15 @@ const pageVariants = {
function App() {
const navigate = useNavigate();
const location = useLocation();
- const userStore = useUserStore();
-
- const checkAuth = async () => {
- const userData = await getMePreview(initData.raw() ?? "");
- if (userData?.isRegistered) {
- userStore.authenticate();
- userStore.setIsLoading(false);
- userStore.updateUserData(userData);
- } else {
- userStore.setIsLoading(false);
- }
- };
+ const { resetStore: resetWithChatStore } = useCommunityWithChatInfoStore();
+ const { resetStore: resetWithoutChatStore } =
+ useCommunityWithoutChatInfoStore();
+ const disableAnimation = useMemo(
+ () =>
+ location.pathname.startsWith("/community/create/with_chat") ||
+ location.pathname.startsWith("/community/create/without_chat"),
+ [location.pathname]
+ );
const setBackButtonHandler = useCallback(() => {
backButton.onClick(() => {
@@ -44,41 +66,138 @@ function App() {
});
}, []);
+ useEffect(() => setBackButtonHandler(), [setBackButtonHandler]);
+
useEffect(() => {
- checkAuth();
- setBackButtonHandler();
- }, []);
+ if (!location.pathname.startsWith("/community/create")) {
+ resetWithChatStore();
+ resetWithoutChatStore();
+ }
+ }, [location.pathname]);
+
+ const routes = (
+
{props.contentText}