├── .gitignore
├── README.md
├── package-lock.json
├── package.json
├── public
├── Logo.png
├── favicon.ico
├── index.html
├── logo192.png
├── logo512.png
├── manifest.json
└── robots.txt
├── src
├── App.jsx
├── components
│ ├── About.jsx
│ ├── AstroKundli.jsx
│ ├── AstroProfile.jsx
│ ├── AstroProfileBottom.jsx
│ ├── AstrologersCallPage.jsx
│ ├── AstrologersTalk.jsx
│ ├── Body.jsx
│ ├── Call.jsx
│ ├── CallCard.jsx
│ ├── Card.jsx
│ ├── CardContainer.jsx
│ ├── Chat.jsx
│ ├── Chatbot.jsx
│ ├── Coming.jsx
│ ├── Error.jsx
│ ├── Explore.jsx
│ ├── Fetch.jsx
│ ├── Following.jsx
│ ├── FootIcons.jsx
│ ├── Footer.jsx
│ ├── Header.jsx
│ ├── Hero.jsx
│ ├── Horoscope.jsx
│ ├── HoroscopeBottom.jsx
│ ├── LoginForm.jsx
│ ├── LoginPage.jsx
│ ├── SignSearch.jsx
│ ├── TopAstro.jsx
│ ├── TopAstroCard.jsx
│ ├── ZodiacCard.jsx
│ ├── ZodiacCardsList.jsx
│ └── ZodiacContainer.jsx
├── custom hooks
│ ├── useAstroProfile.jsx
│ ├── useCall.jsx
│ ├── useChat.jsx
│ └── useHoroscope.jsx
├── image
│ ├── Click.jpeg
│ ├── Cors (1).png
│ ├── Cors (2).png
│ ├── Logo text.png
│ ├── Logo.png
│ ├── Sign
│ │ ├── sign1.svg
│ │ ├── sign10.svg
│ │ ├── sign11.svg
│ │ ├── sign12.svg
│ │ ├── sign2.svg
│ │ ├── sign3.svg
│ │ ├── sign4.svg
│ │ ├── sign5.svg
│ │ ├── sign6.svg
│ │ ├── sign7.svg
│ │ ├── sign8.svg
│ │ └── sign9.svg
│ ├── Snapshots
│ │ ├── AstroBot.png
│ │ ├── Home.png
│ │ ├── Horoscope.png
│ │ ├── Kundli.png
│ │ ├── List.png
│ │ ├── Login.png
│ │ └── Profile.png
│ ├── bg1.jpg
│ ├── cycle.jpg
│ ├── hand.png
│ ├── hand_bg.png
│ ├── jyotish 1.jpeg
│ ├── jyotish 2.jpeg
│ ├── kundli rishi.webp
│ ├── loading.png
│ ├── pandit aarti.webp
│ ├── pandit hand checking.png
│ ├── pandit headphones.png
│ ├── pandit on pc.png
│ ├── pandit on phone.webp
│ ├── pandit reading.webp
│ ├── pandit showing phone screen.png
│ └── pandit welcome.webp
├── index.css
├── index.js
├── reportWebVitals.js
├── setupTests.js
├── shimmer
│ ├── ShimmerCard.jsx
│ ├── ShimmerList.jsx
│ └── ShimmerProfile.jsx
├── store
│ ├── AstroSlice.jsx
│ ├── CommentsSlice.jsx
│ ├── appStore.jsx
│ ├── configAppSlice.jsx
│ ├── followSlice.jsx
│ └── userSlice.jsx
└── utils
│ ├── Loading.jsx
│ ├── constants.jsx
│ ├── firebase.jsx
│ ├── langConstants.jsx
│ ├── openai.jsx
│ └── validate.jsx
└── tailwind.config.js
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
25 | day
26 |
27 | .env
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | > ## Introducing AstroGPT, your ultimate astrology app featuring personalized Kundli, daily horoscope, live chat with astrologers, and an intuitive chatbot powered by ChatGPT. Follow your favorite astrologers, receive personalized insights, and explore the cosmos like never before. Discover the universe's secrets with AstroGPT! Welcome to AstroGPT, the pinnacle of astrology applications, boasting a high-performance and scalable architecture, enriched with the extraordinary capabilities of ChatGPT.
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | ## 🎯 Key Features
26 |
27 | > ### 🌏 Real-time AstroTalk API Integration: Connect with real-life astrologers, engage in live chats, and receive personalized guidance and insights for your cosmic journey.
28 |
29 | > ### 🌟 Personalized Kundli: Unlock the secrets of the stars with personalized Kundli readings tailored to your birth details, providing deep insights into your destiny and potential.
30 |
31 | > ### 🌌 Daily Horoscope: Stay updated with daily horoscope predictions based on your zodiac sign, offering guidance and advice for navigating life's challenges and opportunities.
32 |
33 | > ### 💬 Astrobot Assistance: Meet Astrobot, your astrological assistant powered by ChatGPT, providing personalized insights, predictions, and advice through interactive chat.
34 |
35 | > ### 🔍 Follow/Unfollow Astrologers: Stay connected with your favorite astrologers, receive updates on their latest insights, and unfollow them at any time for a tailored experience.
36 |
37 | > ### 🎯 Multi-Language Support: Explore AstroGPT in your preferred language, with support for 7 different languages covering up to 90% of the app's content.
38 |
39 | > ### 🔐 Secure Authentication: Enjoy a safe and private experience with Firebase authentication, ensuring your personal data and interactions are protected.
40 |
41 | > ### ✨ Fully Responsive Design: Experience AstroGPT seamlessly across devices, with a fully responsive design that adapts to different screen sizes and resolutions.
42 |
43 | > ### 🚀 Lazy Loading & Memoization: Optimize performance with lazy loading and memoization techniques, ensuring fast load times and efficient data retrieval.
44 |
45 | ---
46 |
47 | ## 🚀 Live Demo
48 |
49 | - Click Below
50 |
51 |
52 |
53 |
54 |
55 | ---
56 |
57 |
58 | ## 🔧 AstroGPT's Tech Stack:
59 |
60 | - React: Powering the dynamic and interactive user interface.
61 |
62 | - Redux Toolkit: Managing application state for a scalable and organized architecture.
63 |
64 | - Firebase: Ensuring secure authentication and data management.
65 |
66 | - ChatGPT: Enabling personalized astrological insights and guidance through interactive chat.
67 |
68 | - Tailwind CSS: Crafting a visually appealing and responsive design.
69 |
70 | - React Router: Enabling seamless navigation within the application.
71 |
72 | ---
73 |
74 | ## ⭐️ Show your support
75 |
76 | > "If you find value in this project, I would sincerely appreciate your support. Feel free to share it with others who may benefit from it. Your contribution is crucial for my growth and enhancement. 🚀, Please don't hesitate to star this GitHub repository!"
77 |
78 | ---
79 |
80 |
81 |
82 |
AstroGPT is made with ❤️ (An Idea into Reality)
83 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "astro-gpt",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@reduxjs/toolkit": "^2.1.0",
7 | "@testing-library/jest-dom": "^5.17.0",
8 | "@testing-library/react": "^13.4.0",
9 | "@testing-library/user-event": "^13.5.0",
10 | "aztro-js": "^0.1.5",
11 | "firebase": "^10.8.0",
12 | "openai": "^4.28.4",
13 | "react": "^18.2.0",
14 | "react-dom": "^18.2.0",
15 | "react-redux": "^9.1.0",
16 | "react-router-dom": "^6.22.0",
17 | "react-scripts": "5.0.1",
18 | "react-toastify": "^10.0.4",
19 | "web-vitals": "^2.1.4"
20 | },
21 | "scripts": {
22 | "start": "react-scripts start",
23 | "build": "react-scripts build",
24 | "test": "react-scripts test",
25 | "eject": "react-scripts eject"
26 | },
27 | "eslintConfig": {
28 | "extends": [
29 | "react-app",
30 | "react-app/jest"
31 | ]
32 | },
33 | "browserslist": {
34 | "production": [
35 | ">0.2%",
36 | "not dead",
37 | "not op_mini all"
38 | ],
39 | "development": [
40 | "last 1 chrome version",
41 | "last 1 firefox version",
42 | "last 1 safari version"
43 | ]
44 | },
45 | "devDependencies": {
46 | "tailwindcss": "^3.4.1"
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/public/Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/public/Logo.png
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/public/favicon.ico
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
17 |
21 |
22 |
31 | AstroGPT
32 |
33 |
34 | You need to enable JavaScript to run this app.
35 |
36 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/public/logo192.png
--------------------------------------------------------------------------------
/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/public/logo512.png
--------------------------------------------------------------------------------
/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/src/App.jsx:
--------------------------------------------------------------------------------
1 | import { Provider, useSelector } from 'react-redux';
2 | import Body from './components/Body';
3 | import appStore from './store/appStore';
4 | import { ToastContainer } from 'react-toastify';
5 | import LoginForm from './components/LoginForm';
6 |
7 | function App() {
8 |
9 | return (
10 | <>
11 |
12 |
13 |
14 |
15 |
16 |
17 | >
18 | );
19 | }
20 |
21 | export default App;
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/components/About.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import bg from "../image/bg1.jpg"
3 |
4 |
5 | const About = () => {
6 | const liCSS = "text-lg font-normal text-purple-200 opacity-95"
7 | const ptCSS = "text-purple-300 pt-8 text-xl tracking-wide font-medium"
8 | return (
9 |
10 |
15 |
16 |
17 | ABOUT US
18 | AstroGPT is a highly performant, large scalable astrology web app, ready for production, empowered with the superpowers of ChatGPT. This cutting-edge platform seamlessly blends traditional astrological practices with advanced technologies, offering users a unique and immersive astrological experience. With a focus on scalability, performance, and user satisfaction, AstroGPT boasts an array of innovative features designed to enhance the user experience and provide invaluable insights into the mystical world of astrology.
19 |
20 |
21 | Key Features:
22 |
23 |
24 | Kundli Access:
Enabled users to access their Kundli, providing them with valuable insights into their astrological profiles and characteristics.
25 |
26 | Personalized Daily Horoscope: Delivered personalized daily horoscope readings to users, offering them guidance and predictions tailored to their individual zodiac signs.
27 |
28 | Astro Chatbot Powered by ChatGPT: Integrated an intelligent chatbot powered by ChatGPT, allowing users to interact with the app and receive instant responses to their astrological queries and concerns.
29 |
30 | Scalable Architecture: Engineered a robust and scalable architecture to accommodate a large user base and handle extensive data processing without compromising performance.
31 |
32 | Key Features: Implemented essential features such as Kundli access, personalized daily horoscope, and an astro chatbot powered by ChatGPT, catering to diverse user needs.
33 |
34 | OpenAI Integration: Integrated OpenAI API for dynamic tasks, enhancing the app's functionality and responsiveness to user interactions.
35 |
36 | Optimization Techniques: Utilized lazy loading and chunking techniques to optimize loading times and improve overall app responsiveness, resulting in a 20% reduction in loading times and a 15% improvement in performance.
37 |
38 | API Management: Efficiently managed over 10 API calls, leveraging memoization to prevent unnecessary calls and streamline data retrieval processes.
39 |
40 | Multilingual Support: Implemented advanced multilingual features, covering 90% of the app's content in 7 different languages, enhancing accessibility and user experience for a global audience.
41 |
42 | Authentication: Integrated Google Firebase for secure authentication, ensuring access only for authenticated users and safeguarding sensitive user data.
43 |
44 | Real-time Communication: Incorporated AstroTalk live API for real-time communication with astrologers, facilitating seamless interaction and consultation via the app's chatbot feature.
45 |
46 | Styling and Responsiveness: Utilized Tailwind for styling, ensuring a visually appealing user interface and 100% responsiveness across all devices, enhancing user engagement and satisfaction.
47 |
48 | Ongoing Development: Continuously developing the app with plans to implement advanced functionalities, including dynamic search using debouncing to optimize API calls.
49 |
50 | Proof of Work: Documented the journey and achievements of AstroGPT on LinkedIn, providing insights into the development process and milestones achieved. Interested users can explore the live demo and access the AstroGPT GitHub repository for further information and collaboration opportunities.
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 | );
61 | };
62 |
63 | export default About;
64 |
--------------------------------------------------------------------------------
/src/components/AstroProfile.jsx:
--------------------------------------------------------------------------------
1 | import { useDispatch, useSelector } from "react-redux";
2 | import useAstroProfile from "../custom hooks/useAstroProfile";
3 | import { Link, useParams } from "react-router-dom";
4 | import { PROFILE_BG, PROFILE_IMG } from "../utils/constants";
5 | import ShimmerProfile from "../shimmer/ShimmerProfile";
6 | import { toast, Bounce } from "react-toastify";
7 | import "react-toastify/dist/ReactToastify.css";
8 | import { addFollow, removeFollow } from "../store/followSlice";
9 | import { useState } from "react";
10 | import { addForm } from "../store/configAppSlice";
11 | import Chatbot from "./Chatbot";
12 | import bg from "../image/bg1.jpg";
13 | import AstroProfileBottom from "./AstroProfileBottom";
14 |
15 | const AstroProfile = () => {
16 | const [follow, setfollow] = useState(false);
17 |
18 | const { id } = useParams();
19 | useAstroProfile(id);
20 |
21 | const dispatch = useDispatch();
22 |
23 | const Bot = useSelector((store) => store.configApp.Bot);
24 | const astroProfile = useSelector((store) => store.astro.astroProfile);
25 | const user = useSelector((store) => store.user);
26 |
27 | if (!astroProfile) {
28 | return ;
29 | }
30 | const { data } = astroProfile;
31 |
32 | const handlefollow = (data) => {
33 | if (!user) {
34 | toast.error("You're not logged In", {
35 | position: "top-right",
36 | autoClose: 1200,
37 | hideProgressBar: false,
38 | closeOnClick: true,
39 | pauseOnHover: false,
40 | draggable: true,
41 | progress: undefined,
42 | theme: "dark",
43 | transition: Bounce,
44 | });
45 |
46 | dispatch(addForm());
47 | return;
48 | }
49 |
50 | toast("🔥 Followed " + data?.name, {
51 | position: "top-right",
52 | autoClose: 1000,
53 | hideProgressBar: false,
54 | closeOnClick: true,
55 | pauseOnHover: false,
56 | draggable: true,
57 | progress: undefined,
58 | theme: "dark",
59 | transition: Bounce,
60 | });
61 |
62 | dispatch(addFollow(data));
63 | setfollow(!follow);
64 | };
65 | const handleUnfollow = () => {
66 | toast("👎 Unfollowed " + data?.name, {
67 | position: "top-right",
68 | autoClose: 1000,
69 | hideProgressBar: false,
70 | closeOnClick: true,
71 | pauseOnHover: false,
72 | draggable: true,
73 | progress: undefined,
74 | theme: "dark",
75 | transition: Bounce,
76 | });
77 | dispatch(removeFollow(data));
78 | setfollow(!follow);
79 | };
80 |
81 | return (
82 |
83 | {Bot &&
}
84 |
89 |
90 |
91 |
92 | {" "}
93 |
94 | HOME
95 |
96 |
97 |
98 |
99 |
100 |
101 | {data?.name}
102 |
103 |
104 |
105 |
106 |
107 |
112 |
117 |
118 |
119 |
120 | {!follow ? (
121 | handlefollow(data)}
124 | >
125 | Follow
126 |
127 | ) : (
128 | handleUnfollow(data)}
131 | >
132 | UnFollow
133 |
134 | )}
135 |
136 |
137 |
138 |
139 |
140 |
141 | {data?.name}
142 |
143 |
144 |
145 | {data?.skill}
146 |
147 |
148 |
149 | {data?.lang}
150 |
151 |
152 | Exp:{" "}
153 | {data?.exp} Years
154 |
155 |
156 |
157 | ₹{data?.callPrice}/min
158 |
159 |
160 |
161 |
162 |
163 | {data?.totalCallDurationInMin}
164 | {" "}
165 | mins
166 |
167 |
168 |
169 |
170 | {data?.totalChatDurationInMin}
171 | {" "}
172 | mins
173 |
174 |
175 |
176 |
180 |
181 |
182 |
183 |
184 |
185 | Start Chat
186 |
187 | Wait time - 2m
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 | Start Call
199 |
200 | Wait time - 2m
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 | {data?.verified && (
209 |
210 | )}
211 |
212 |
213 |
214 |
215 |
216 |
217 | );
218 | };
219 | export default AstroProfile;
220 |
--------------------------------------------------------------------------------
/src/components/AstroProfileBottom.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | const AstroProfileBottom = ({data}) => {
4 | return (
5 |
6 |
7 |
8 | About me
9 | {data?.shortBio && (
10 |
11 | ({data?.shortBio})
12 |
13 | )}
14 |
15 |
19 | {data?.longBio}
20 |
21 |
22 |
23 |
24 | Problem Area:{" "}
25 |
26 |
27 | {data?.problemArea}
28 |
29 |
30 |
31 | {data?.album.map((img) => (
32 |
36 |
37 |
38 | ))}
39 |
40 |
41 | )
42 | }
43 |
44 | export default AstroProfileBottom
45 |
--------------------------------------------------------------------------------
/src/components/AstrologersCallPage.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Link } from "react-router-dom";
3 | import pandit from "../image/pandit on phone.webp";
4 | import bg from "../image/bg1.jpg";
5 |
6 | const AstrologersCallPage = () => {
7 | return (
8 |
9 |
14 |
15 |
16 |
17 |
18 | Developer is working on it!
19 |
20 |
21 | {" "}
22 |
23 | Till you can Chat with them
24 |
25 |
26 |
27 |
28 |
29 | );
30 | };
31 |
32 | export default AstrologersCallPage;
33 |
--------------------------------------------------------------------------------
/src/components/AstrologersTalk.jsx:
--------------------------------------------------------------------------------
1 | import { useDispatch, useSelector } from "react-redux";
2 | import { PROFILE_IMG, TALK_PROMPT } from "../utils/constants";
3 | import bg from "../image/bg1.jpg";
4 | import openai from "./../utils/openai";
5 | import React, { useRef, useState } from "react";
6 | import { addBot, addForm, addLimit } from "../store/configAppSlice";
7 | import { toast, Bounce } from "react-toastify";
8 | import { useNavigate } from "react-router-dom";
9 |
10 | const AstrologersTalk = () => {
11 | const astroProfile = useSelector((store) => store.astro.astroProfile);
12 |
13 | const { data } = astroProfile;
14 | const info = data;
15 | const input = useRef();
16 | const [result, setresult] = useState([info?.name + ": Hi"]);
17 | const [apiLimit, setapiLimit] = useState(1);
18 |
19 | const user = useSelector((store) => store.user);
20 | const form = useSelector((store) => store.configApp.form);
21 | const navigate = useNavigate();
22 |
23 | const dispatch = useDispatch();
24 |
25 | const handlebot = () => {
26 | navigate("/astroProfile/" + info?.name);
27 | };
28 |
29 | const handleSearch = async () => {
30 | if (!user) {
31 | toast.error("Please Login to Continue", {
32 | position: "top-right",
33 | autoClose: 1200,
34 | hideProgressBar: false,
35 | closeOnClick: true,
36 | pauseOnHover: false,
37 | draggable: true,
38 | progress: undefined,
39 | theme: "dark",
40 | transition: Bounce,
41 | });
42 | dispatch(addBot());
43 | dispatch(addForm());
44 | return;
45 | }
46 | if (apiLimit > 4) {
47 | dispatch(addLimit(false));
48 | toast.error("Please come tommorow Api limit exceded", {
49 | position: "top-right",
50 | autoClose: 1200,
51 | hideProgressBar: false,
52 | closeOnClick: true,
53 | pauseOnHover: false,
54 | draggable: true,
55 | progress: undefined,
56 | theme: "dark",
57 | transition: Bounce,
58 | });
59 | return;
60 | }
61 |
62 | const gptSearch =
63 | TALK_PROMPT +
64 | "name=" +
65 | info?.name +
66 | "skills=" +
67 | info?.skills +
68 | "experience =" +
69 | info?.exp +
70 | "user input =" +
71 | input.current.value;
72 |
73 | const data = await openai.chat.completions.create({
74 | messages: [{ role: "user", content: gptSearch }],
75 | model: "gpt-3.5-turbo",
76 | });
77 | const Responce = data?.choices?.[0]?.message?.content;
78 |
79 | setresult([
80 | ...result,
81 | "You: " + input.current.value,
82 | info?.name + ": " + Responce,
83 | ]);
84 | input.current.value = "";
85 |
86 | setapiLimit(apiLimit + 1);
87 | };
88 |
89 | return (
90 |
91 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
107 |
108 |
109 | {info?.name}
110 |
111 |
112 |
116 |
117 |
118 | {result?.map((result, index) => (
119 |
123 |
124 | {result}
125 |
126 |
127 | ))}
128 |
129 |
130 |
147 |
148 |
149 |
150 | );
151 | };
152 |
153 | export default AstrologersTalk;
154 |
--------------------------------------------------------------------------------
/src/components/Body.jsx:
--------------------------------------------------------------------------------
1 | import { Outlet, RouterProvider, createBrowserRouter } from "react-router-dom";
2 | import Hero from "./Hero";
3 | import Chat from "./Chat";
4 | import Call from "./Call";
5 | import AstroProfile from "./AstroProfile";
6 | import Header from "./Header";
7 | import Following from "./Following";
8 | import Chatbot from "./Chatbot";
9 | import AstroKundli from "./AstroKundli";
10 | import LoginForm from "./LoginForm";
11 | import Horoscope from "./Horoscope";
12 | import FootIcons from "./FootIcons";
13 | import Loading from "../utils/Loading";
14 | import AstrologersTalk from "./AstrologersTalk";
15 | import AstrologersCallPage from "./AstrologersCallPage";
16 | import About from "./About";
17 | import Error from "./Error";
18 | import Footer from "./Footer";
19 |
20 | const Body = () => {
21 | const appLayout = createBrowserRouter([
22 | {
23 | path: "/",
24 | element: (
25 | <>
26 |
27 |
28 |
29 |
30 | >
31 | ),
32 | children: [
33 | {
34 | path: "/",
35 | element: ,
36 | },
37 | {
38 | path: "/chat",
39 | element: ,
40 | },
41 | {
42 | path: "/call",
43 | element: ,
44 | },
45 | {
46 | path: "/astroProfile/:id",
47 | element: ,
48 | },
49 | {
50 | path: "/following",
51 | element: ,
52 | },
53 | {
54 | path: "/chatbot",
55 | element: ,
56 | },
57 | {
58 | path: "/kundligpt",
59 | element: ,
60 | },
61 | {
62 | path: "/horoscope/:id",
63 | element: ,
64 | },
65 | {
66 | path: "/astrologerschat/:id",
67 | element: ,
68 | },
69 | {
70 | path: "/astrologerscall",
71 | element: ,
72 | },
73 | {
74 | path: "/login",
75 | element: ,
76 | },
77 | {
78 | path: "/about",
79 | element: ,
80 | },
81 | {
82 | path: "/error",
83 | element: ,
84 | },
85 |
86 | ],
87 | },
88 |
89 | ]);
90 |
91 | return (
92 | <>
93 |
94 | >
95 | );
96 | };
97 | export default Body;
98 |
--------------------------------------------------------------------------------
/src/components/Call.jsx:
--------------------------------------------------------------------------------
1 | import { useSelector } from "react-redux";
2 | import { CallCardContainer } from "./CardContainer";
3 | import ShimmerList from "../shimmer/ShimmerList";
4 | import useCall from "../custom hooks/useCall";
5 | import { useState } from "react";
6 | import lang from "../utils/langConstants";
7 | import Chatbot from "./Chatbot";
8 | import bg from "../image/bg1.jpg";
9 |
10 | const Call = () => {
11 | const [search, setSearch] = useState("");
12 | const [mainCallList, setMaincallList] = useState(null);
13 |
14 | const Langkey = useSelector((store) => store.configApp.lang);
15 | const Bot = useSelector((store) => store.configApp.Bot);
16 |
17 | useCall();
18 | const callList = useSelector((store) => store.astro.callList);
19 |
20 | if (!callList) return ;
21 |
22 | const handleSearch = (e) => {
23 | const searchTerm = e.target.value.toLowerCase();
24 | setSearch(searchTerm);
25 |
26 | const filteredList = callList.filter((name) =>
27 | name.slug.toLowerCase().includes(searchTerm)
28 | );
29 | setMaincallList(filteredList);
30 | };
31 |
32 | const btnCSS =
33 | "lg:text-base active:bg-purple-900 focus:bg-purple-800 active:bg-purple-800 active:text-purple-100 bg-purple-600 bg-opacity-10 hover:bg-purple-800 transition-all text-sm border px-4 lg:px-4 py-2 lg:py-1.5 border-purple-600 text-purple-300 font-normal rounded-3xl sm:rounded-full cursor-pointer";
34 | return (
35 |
36 | {Bot &&
}
37 |
42 |
43 |
44 |
45 | {lang[Langkey].call}
46 |
47 |
48 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 | {lang[Langkey].filter}
63 |
64 | {
67 | setMaincallList(callList);
68 | }}
69 | >
70 | {lang[Langkey].all}
71 |
72 | {
75 | let top = callList.filter((top) => top.rating === 5);
76 | setMaincallList(top);
77 | }}
78 | >
79 | {lang[Langkey].topRated}
80 |
81 | {
84 | let off = callList.filter((off) => off.isShowOffer === true);
85 | setMaincallList(off);
86 | }}
87 | >
88 | {lang[Langkey].offer}
89 |
90 | {
93 | let vedic = callList.filter((vedic) =>
94 | vedic.skill.includes("Vedic")
95 | );
96 | setMaincallList(vedic);
97 | }}
98 | >
99 | {lang[Langkey].vedic}
100 |
101 | {
104 | let num = callList.filter((num) =>
105 | num.skill.includes("Numerology")
106 | );
107 | setMaincallList(num);
108 | }}
109 | >
110 | {lang[Langkey].numerology}
111 |
112 | {
115 | let Tarot = callList.filter((Tarot) =>
116 | Tarot.skill.includes("Tarot")
117 | );
118 | setMaincallList(Tarot);
119 | }}
120 | >
121 | {lang[Langkey].tarot}
122 |
123 |
124 | {
127 | let FaceReading = callList.filter((FaceReading) =>
128 | FaceReading.skill.includes(" Face Reading")
129 | );
130 | setMaincallList(FaceReading);
131 | }}
132 | >
133 | {lang[Langkey].faceReading}
134 |
135 | {
138 | let Vastu = callList.filter((Vastu) =>
139 | Vastu.skill.includes("Vastu")
140 | );
141 | setMaincallList(Vastu);
142 | }}
143 | >
144 | {lang[Langkey].vastu}
145 |
146 | {
149 | let LifeCoach = callList.filter((LifeCoach) =>
150 | LifeCoach.skill.includes("Life Coach")
151 | );
152 | setMaincallList(LifeCoach);
153 | }}
154 | >
155 | {lang[Langkey].lifeCoach}
156 |
157 | {
160 | let Psychologist = callList.filter((Psychologist) =>
161 | Psychologist.skill.includes("Psychologist")
162 | );
163 | setMaincallList(Psychologist);
164 | }}
165 | >
166 | {lang[Langkey].psychologist}
167 |
168 | {
171 | let Palmistry = callList.filter((Palmistry) =>
172 | Palmistry.skill.includes("Palmistry")
173 | );
174 | setMaincallList(Palmistry);
175 | }}
176 | >
177 | {lang[Langkey].palmistry}
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 | );
187 | };
188 |
189 | export default Call;
190 |
--------------------------------------------------------------------------------
/src/components/CallCard.jsx:
--------------------------------------------------------------------------------
1 | import { PROFILE_IMG } from "../utils/constants";
2 | import ShimmerList from "../shimmer/ShimmerList";
3 |
4 | import lang from "../utils/langConstants";
5 | import { useSelector } from "react-redux";
6 |
7 | const CallCard = ({ info }) => {
8 | const Langkey = useSelector((store) => store.configApp.lang);
9 |
10 | if (!info) {
11 | return ;
12 | }
13 |
14 | return (
15 |
16 |
17 |
18 |
19 |
24 |
25 |
26 | {info?.rating > 4.9 ? (
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | ) : (
35 |
36 |
37 |
38 |
39 |
40 |
41 | )}
42 |
43 |
44 |
45 | {" "}
46 | {info?.order} {lang[Langkey].orders}
47 |
48 |
49 |
50 | {info?.name}
51 |
52 | {info?.skill.length > 20
53 | ? `${info?.skill.slice(0, 20)}...`
54 | : info?.skill}
55 |
56 |
57 | {info?.lang}
58 |
59 |
60 | {lang[Langkey].exp} : {info?.exp} {lang[Langkey].years}
61 |
62 |
63 | {" "}
64 |
65 | ₹{info?.price}
66 |
67 | /{lang[Langkey].min}
68 |
69 |
70 |
71 |
72 | {info?.tick && (
73 |
74 |
75 |
76 | )}
77 |
78 |
79 |
80 | Call
81 |
82 |
83 |
84 |
85 | );
86 | };
87 | export default CallCard;
88 |
--------------------------------------------------------------------------------
/src/components/Card.jsx:
--------------------------------------------------------------------------------
1 | import { PROFILE_IMG } from "../utils/constants";
2 | import ShimmerList from "../shimmer/ShimmerList";
3 |
4 | import lang from "../utils/langConstants";
5 | import { useSelector } from "react-redux";
6 |
7 | const Card = ({ info }) => {
8 |
9 | const Langkey = useSelector(store => store.configApp.lang)
10 |
11 | if (!info) {
12 | return
13 | }
14 |
15 |
16 |
17 | return (
18 |
19 |
20 |
21 | {/*
*/}
22 |
23 |
28 |
29 |
30 | {info?.rating > 4.9 ?
31 |
32 |
33 |
34 |
35 |
36 |
37 |
:
38 |
39 |
40 |
41 |
42 |
}
43 |
44 |
45 |
46 | {" "}
47 | {info?.order} {lang[Langkey].orders}
48 |
49 |
50 |
51 | {info?.name}
52 |
53 | {info?.skill.length > 20 ? `${info?.skill.slice(0, 20)}...` : info?.skill}
54 |
55 |
56 | {info?.lang}
57 |
58 |
59 | {lang[Langkey].exp} : {info?.exp} {lang[Langkey].years}
60 |
61 | ₹{info?.price} /{lang[Langkey].min}
62 |
63 |
64 |
65 | {info?.tick &&
66 |
67 | }
68 |
69 |
70 |
71 |
72 | Chat
73 |
74 |
75 |
76 |
77 | );
78 | };
79 | export default Card;
80 |
--------------------------------------------------------------------------------
/src/components/CardContainer.jsx:
--------------------------------------------------------------------------------
1 | import { Link } from "react-router-dom";
2 | import Card from "./Card";
3 | import CallCard from "./CallCard";
4 |
5 | export const ChatCardContainer = ({list})=>{
6 | return (
7 |
8 | {
9 | list?.map(astro =>
)
10 | }
11 |
12 | )
13 | }
14 |
15 |
16 | export const CallCardContainer = ({list})=>{
17 | return (
18 |
19 | {
20 | list?.map(astro =>
)
21 | }
22 |
23 | )
24 | }
--------------------------------------------------------------------------------
/src/components/Chat.jsx:
--------------------------------------------------------------------------------
1 | import useChat from "../custom hooks/useChat";
2 | import { useSelector } from "react-redux";
3 | import { ChatCardContainer } from "./CardContainer";
4 | import ShimmerList from "../shimmer/ShimmerList";
5 | import { useState } from "react";
6 | import lang from "../utils/langConstants";
7 | import Chatbot from "./Chatbot";
8 | import bg from "../image/bg1.jpg"
9 | import Error from "./Error";
10 |
11 | const Chat = () => {
12 |
13 | const [search, setSearch] = useState("");
14 | const [mainchatList, setMainchatList] = useState(null);
15 |
16 | const Langkey = useSelector(store => store.configApp.lang)
17 | const Bot = useSelector(store => store.configApp.Bot)
18 |
19 |
20 | useChat()
21 | const chatList = useSelector(store => store.astro.chatList)
22 | if (!chatList) return
23 |
24 |
25 |
26 | const handleSearch = (e) => {
27 | const searchTerm = e.target.value.toLowerCase();
28 | setSearch(searchTerm);
29 |
30 |
31 | const filteredList = chatList.filter(name => name.slug.toLowerCase().includes(searchTerm));
32 | setMainchatList(filteredList);
33 |
34 | };
35 |
36 | const btnCSS = "lg:text-base focus:bg-purple-800 active:bg-purple-800 active:bg-purple-900 active:text-purple-100 bg-purple-600 bg-opacity-10 hover:bg-purple-800 transition-all text-sm border px-4 lg:px-4 py-2 lg:py-1.5 border-purple-600 text-purple-300 font-normal rounded-3xl sm:rounded-full cursor-pointer"
37 |
38 | return (
39 |
40 | { Bot &&
}
41 |
42 |
43 |
44 |
{lang[Langkey].chat}
45 |
46 |
53 |
54 |
55 |
56 |
57 |
58 | {lang[Langkey].filter}
59 | {
60 | setMainchatList(chatList)}
61 | }>{lang[Langkey].all}
62 | {
63 | let top = chatList.filter((top)=> top.rating === 5)
64 | setMainchatList(top)
65 | }}>{lang[Langkey].topRated}
66 | {
67 | let off = chatList.filter((off)=> off.isShowOffer === true)
68 | setMainchatList(off)
69 | }}>{lang[Langkey].offer}
70 | {
71 | let vedic = chatList.filter((vedic)=> vedic.skill.includes("Vedic"))
72 | setMainchatList(vedic)
73 | }}>{lang[Langkey].vedic}
74 | {
75 | let num = chatList.filter((num)=> num.skill.includes("Numerology"))
76 | setMainchatList(num)
77 | }}>{lang[Langkey].numerology}
78 | {
79 | let Tarot = chatList.filter((Tarot)=> Tarot.skill.includes("Tarot"))
80 | setMainchatList(Tarot)
81 | }}>{lang[Langkey].tarot}
82 |
83 | {
84 | let FaceReading = chatList.filter(( FaceReading)=> FaceReading.skill.includes(" Face Reading"))
85 | setMainchatList(FaceReading)
86 | }}>{lang[Langkey].faceReading}
87 | {
88 | let Vastu = chatList.filter((Vastu)=> Vastu.skill.includes("Vastu"))
89 | setMainchatList(Vastu)
90 | }}>{lang[Langkey].vastu}
91 | {
92 | let LifeCoach = chatList.filter((LifeCoach)=> LifeCoach.skill.includes("Life Coach"))
93 | setMainchatList(LifeCoach)
94 | }}>{lang[Langkey].lifeCoach}
95 | {
96 | let Psychologist = chatList.filter((Psychologist)=> Psychologist.skill.includes("Psychologist"))
97 | setMainchatList(Psychologist)
98 | }}>{lang[Langkey].psychologist}
99 | {
100 | let Palmistry = chatList.filter((Palmistry)=> Palmistry.skill.includes("Palmistry"))
101 | setMainchatList(Palmistry)
102 | }}>{lang[Langkey].palmistry}
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 | )
113 | }
114 | export default Chat;
--------------------------------------------------------------------------------
/src/components/Chatbot.jsx:
--------------------------------------------------------------------------------
1 | import { useDispatch, useSelector } from "react-redux";
2 | import { CHAT_BOT } from "../utils/constants";
3 | import openai from "./../utils/openai";
4 | import React, { useRef, useState } from "react";
5 | import { addBot, addForm, addLimit } from "../store/configAppSlice";
6 | import { toast, Bounce } from "react-toastify";
7 | import logo from "../image/Logo.png"
8 | import lang from "../utils/langConstants";
9 |
10 | const Chatbot = () => {
11 | const input = useRef();
12 |
13 | const [apiLimit, setapiLimit] = useState(1);
14 |
15 | const user = useSelector((store) => store.user);
16 | const form = useSelector((store) => store.configApp.form);
17 | const dispatch = useDispatch();
18 |
19 | const [result, setresult] = useState(["AstroBot: Hi"]);
20 |
21 | const handlebot = () => {
22 | dispatch(addBot());
23 | };
24 |
25 | const handleSearch = async () => {
26 |
27 | if (!user) {
28 | toast.error("Please Login to Continue", {
29 | position: "top-right",
30 | autoClose: 1200,
31 | hideProgressBar: false,
32 | closeOnClick: true,
33 | pauseOnHover: false,
34 | draggable: true,
35 | progress: undefined,
36 | theme: "dark",
37 | transition: Bounce,
38 | });
39 | dispatch(addBot());
40 | dispatch(addForm());
41 | return;
42 | }
43 | if (apiLimit > 6) {
44 | dispatch(addLimit(false));
45 | toast.error("Please come tommorow Api limit excedd", {
46 | position: "top-right",
47 | autoClose: 1200,
48 | hideProgressBar: false,
49 | closeOnClick: true,
50 | pauseOnHover: false,
51 | draggable: true,
52 | progress: undefined,
53 | theme: "dark",
54 | transition: Bounce,
55 | });
56 | return;
57 | }
58 |
59 | const gptSearch = CHAT_BOT + input.current.value + `?`;
60 |
61 | const data = await openai.chat.completions.create({
62 | messages: [{ role: "user", content: gptSearch }],
63 | model: "gpt-3.5-turbo",
64 | });
65 | const Responce = data?.choices?.[0]?.message?.content;
66 | console.log(data)
67 |
68 | setresult([
69 | ...result,
70 | "You: " + input.current.value,
71 | "AstroBot: " + Responce,
72 | ]);
73 | input.current.value = "";
74 |
75 | setapiLimit(apiLimit + 1);
76 | };
77 |
78 | const LangKey = useSelector(store => store.configApp.lang)
79 |
80 | return (
81 |
82 |
83 |
84 |
85 |
86 |
87 |
{lang[LangKey].astroBot}
88 |
89 |
90 |
91 |
95 |
96 |
97 | {result?.map((result, index) => (
98 |
102 |
103 | {result}
104 |
105 |
106 | ))}
107 |
108 |
109 |
126 |
127 |
128 |
129 | );
130 | };
131 |
132 | export default Chatbot;
133 |
--------------------------------------------------------------------------------
/src/components/Coming.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | const Coming = () => {
4 | return (
5 |
6 | In the Development Stage..
7 |
8 | )
9 | }
10 |
11 | export default Coming
12 |
--------------------------------------------------------------------------------
/src/components/Error.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import pandit from "../image/pandit hand checking.png";
3 | import cors from "../image/Cors (1).png";
4 | import cors2 from "../image/Cors (2).png";
5 |
6 |
7 | import bg from "../image/bg1.jpg";
8 |
9 | const Error = () => {
10 | return (
11 |
12 |
17 |
18 |
19 |
20 |
21 | Sorry! Failed to fetch
22 | Know why?
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | Please download this extension cors
31 |
32 |
33 |
34 |
35 |
36 |
37 | );
38 | };
39 |
40 | export default Error;
41 |
--------------------------------------------------------------------------------
/src/components/Explore.jsx:
--------------------------------------------------------------------------------
1 | import { useDispatch, useSelector } from "react-redux";
2 | import lang from "../utils/langConstants";
3 | import ZodiacContainer from "./ZodiacContainer";
4 | import handbg from "../image/hand_bg.png";
5 | import hand from "../image/hand.png";
6 | import { addBot } from "../store/configAppSlice";
7 | import { Link } from "react-router-dom";
8 |
9 | const Explore = () => {
10 | const Langkey = useSelector((store) => store.configApp.lang);
11 | const dispatch = useDispatch()
12 |
13 | const handlebot = ()=>{
14 | dispatch(addBot())
15 | }
16 |
17 | return (
18 |
19 |
20 |
21 |
22 | {lang[Langkey].welcome}
23 |
24 |
25 | {" "}
26 | {lang[Langkey].astroGPT}
27 |
28 |
29 | {lang[Langkey].finger}
30 |
31 |
32 | {lang[Langkey].loginDescription}
33 |
34 |
35 |
36 | {lang[Langkey].astroBot}
37 |
38 |
39 | {lang[Langkey].astroKundli}
40 |
41 |
42 |
43 |
44 |
49 |
54 |
55 |
56 |
57 |
58 |
59 | );
60 | };
61 | export default Explore;
62 |
--------------------------------------------------------------------------------
/src/components/Fetch.jsx:
--------------------------------------------------------------------------------
1 | // import React, { useEffect } from 'react';
2 |
3 | // const Fetch = () => {
4 | // useEffect(() => {
5 | // const fetchData = async () => {
6 | // try {
7 | // const todayResponse = await fetch("https://aztro.sameerkumar.website?sign=leo&day=today", { method: "POST" });
8 |
9 | // const todayData = await todayResponse.json();
10 |
11 | // console.log("Today's Horoscope:", todayData);
12 |
13 | // } catch (error) {
14 | // console.error("Error fetching data:", error);
15 | // }
16 | // };
17 |
18 | // fetchData();
19 | // }, []);
20 |
21 | // return null; // This component doesn't render anything, it's just for fetching data
22 | // };
23 |
24 | // export default Fetch;
25 |
--------------------------------------------------------------------------------
/src/components/Following.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { useDispatch, useSelector } from "react-redux";
3 | import { PROFILE_IMG } from "../utils/constants";
4 | import { clearFollow, removeFollow } from "../store/followSlice";
5 | import { Link } from "react-router-dom";
6 | import bg from "../image/bg1.jpg"
7 | import Chatbot from "./Chatbot";
8 | import panditphone from "../image/pandit showing phone screen.png"
9 | import panditwelcome from "../image/pandit welcome.webp"
10 | import lang from "../utils/langConstants";
11 |
12 | const Following = () => {
13 | const dispatch = useDispatch();
14 |
15 | const data = useSelector((store) => store.follow.follow);
16 | const Bot = useSelector(store => store.configApp.Bot)
17 | const LangKey = useSelector(store => store.configApp.lang)
18 |
19 |
20 | const handleUnfollow = () => {
21 | dispatch(clearFollow());
22 | };
23 | const handleClear = () =>{
24 | dispatch(clearFollow())
25 | }
26 |
27 | return (
28 |
29 | { Bot &&
}
30 |
35 | {data.length === 0 &&
36 |
37 |
38 |
39 |
{lang[LangKey].notfollowing}
40 |
{lang[LangKey].expFollow}
41 |
42 |
43 | }
44 | {data.length > 0 && (
45 | <>
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 | {lang[LangKey].following}
54 | {lang[LangKey].clearFollow}
55 |
56 |
57 | {data?.map((data) => (
58 |
59 |
60 |
61 |
66 |
67 |
68 |
69 |
70 |
71 | {data?.name}
72 |
73 | {data?.shortBio && (
74 |
75 | ({data?.shortBio})
76 |
77 | )}
78 |
79 |
80 |
81 |
82 |
83 |
84 |
88 | {lang[LangKey].unfollow}
89 |
90 |
91 |
92 | ))}
93 |
94 |
95 |
96 | >
97 | )}
98 |
99 | );
100 | };
101 |
102 | export default Following;
103 |
--------------------------------------------------------------------------------
/src/components/FootIcons.jsx:
--------------------------------------------------------------------------------
1 | import { signOut } from 'firebase/auth';
2 | import React from 'react'
3 | import { useDispatch, useSelector } from 'react-redux';
4 | import { Link } from 'react-router-dom';
5 | import { addBot, addForm } from '../store/configAppSlice';
6 | import { auth } from '../utils/firebase';
7 | import { Bounce, toast } from 'react-toastify';
8 | import { clearFollow } from '../store/followSlice';
9 |
10 | const FootIcons = () => {
11 |
12 | const dispatch = useDispatch()
13 | const user = useSelector(store => store.user)
14 |
15 | const handleform = () => {
16 | dispatch(addForm());
17 |
18 | };
19 |
20 | const handleSignOut = () => {
21 | signOut(auth)
22 | .then(() => {
23 | // Sign-out successful.
24 | toast.success("Logged out successfully.", {
25 | position: "top-center",
26 | autoClose: 1000,
27 | hideProgressBar: false,
28 | closeOnClick: true,
29 | pauseOnHover: false,
30 | draggable: true,
31 | progress: undefined,
32 | theme: "dark",
33 | transition: Bounce,
34 | });
35 | })
36 | .catch((error) => {
37 |
38 | });
39 |
40 | dispatch(clearFollow());
41 | };
42 |
43 | const handlebot =()=>{
44 | dispatch(addBot())
45 | }
46 |
47 | const liCSS =
48 | "font-light uppercase tracking-wide text-[10px] text-purple-200 cursor-pointer hover:text-purple-400 focus:text-purple-400 ";
49 |
50 | return (
51 |
52 |
53 | {" "}
54 |
55 |
56 | Home
57 |
58 |
59 |
60 |
61 |
62 |
63 | Following
64 |
65 |
66 |
67 |
68 |
69 | Bot
70 |
71 |
72 |
73 |
74 |
75 | Kundli
76 |
77 |
78 | {user ? (
79 |
80 |
81 |
82 | Signout
83 |
84 |
85 | ) : (
86 |
87 |
88 |
89 | Login
90 |
91 |
92 | )}
93 |
94 | )
95 | }
96 |
97 | export default FootIcons
98 |
--------------------------------------------------------------------------------
/src/components/Footer.jsx:
--------------------------------------------------------------------------------
1 |
2 | import { Link } from "react-router-dom";
3 | import logo from "../image/Logo.png";
4 |
5 | const Footer = () => {
6 | const LiCss =
7 | "font-normal lg:text-base md:text-base text-xs lg:pt-3 md:pt-3 pt-2 text-zinc-400 lg:tracking-wide tracking-wider md:tracking-wide cursor-pointer";
8 | const titleCss =
9 | "font-extrabold lg:text-lg md:text-lg text-base text-gray-50 tracking-wide lg:pb-4 md:pb-4 pb-2";
10 |
11 | return (
12 |
13 |
14 |
15 |
16 |
17 |
18 | AstroGPT
19 |
20 |
21 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
Company
53 |
54 | About
55 | Careers
56 | Team
57 | Foody Instamart
58 | Foody One
59 |
60 |
61 |
62 |
Contact Us
63 |
64 | Help & Support
65 | Partner with us
66 | Ride with us
67 | Privacy Policy
68 | Cookies
69 |
70 |
71 |
72 |
We deliver to:
73 |
74 | Bangalore
75 | Pune
76 | Gurgaon
77 | Hyderabad
78 | Delhi
79 | Mumbai
80 |
81 |
82 |
83 |
84 |
85 | © 2023 All Rights Reserved Vivek Khule
86 |
87 |
88 |
89 | );
90 | };
91 | export default Footer;
92 |
--------------------------------------------------------------------------------
/src/components/Header.jsx:
--------------------------------------------------------------------------------
1 | import { Link, useNavigate } from "react-router-dom";
2 | import Logo from "../image/Logo text.png";
3 | import { onAuthStateChanged, signOut } from "firebase/auth";
4 | import { auth } from "../utils/firebase";
5 | import { useEffect } from "react";
6 | import { useDispatch, useSelector } from "react-redux";
7 | import { addUser, removeUser } from "../store/userSlice";
8 | import { toast, Bounce } from "react-toastify";
9 | import "react-toastify/dist/ReactToastify.css";
10 | import { clearFollow, removeFollow } from "../store/followSlice";
11 | import { MULTI_LANG } from "../utils/constants";
12 | import { addBot, addForm, addLang, removeForm } from "../store/configAppSlice";
13 | import LoginForm from "./LoginForm";
14 | import lang from "../utils/langConstants";
15 |
16 | const Header = () => {
17 | const user = useSelector((store) => store.user);
18 | const form = useSelector((store) => store.configApp.form);
19 | const Langkey = useSelector((store)=> store.configApp.lang);
20 |
21 | const navigate = useNavigate();
22 | const liCSS =
23 | "font-semibold focus:text-purple-300 hover:text-purple-300 uppercase tracking-wide text-sm 2xl:text-lg lg:text-sm cursor-pointer focus:border-purple-400 hover:border-purple-400 border-b-2 border-transparent lii pb-1";
24 | const dispatch = useDispatch();
25 |
26 | const handleform = () => {
27 | dispatch(addForm());
28 | };
29 |
30 | const handleSignOut = () => {
31 | signOut(auth)
32 | .then(() => {
33 | // Sign-out successful.
34 | toast.success("Logged out successfully.", {
35 | position: "top-center",
36 | autoClose: 1000,
37 | hideProgressBar: false,
38 | closeOnClick: true,
39 | pauseOnHover: false,
40 | draggable: true,
41 | progress: undefined,
42 | theme: "dark",
43 | transition: Bounce,
44 | });
45 | })
46 | .catch((error) => {
47 | // An error happened.
48 | });
49 |
50 | dispatch(clearFollow());
51 | };
52 |
53 | useEffect(() => {
54 | const unsubscribe = onAuthStateChanged(auth, (user) => {
55 | if (user) {
56 | //destructing the user object and pushing it to store
57 | const { uid, displayName, email } = user;
58 | dispatch(addUser({ uid: uid, displayName: displayName, email: email }));
59 | dispatch(removeForm())
60 | } else {
61 | dispatch(removeUser());
62 | }
63 | });
64 | return () => unsubscribe();
65 | }, []);
66 |
67 | const handleLang = (e) => {
68 | dispatch(addLang(e.target.value));
69 | };
70 |
71 | const handlebot =()=>{
72 | dispatch(addBot())
73 | }
74 | return (
75 | <>
76 |
77 |
78 |
79 | {" "}
80 |
85 |
86 |
87 |
88 |
89 | {" "}
90 | {lang[Langkey].CHAT}
91 |
92 |
93 | {" "}
94 | {lang[Langkey].CALL}
95 |
96 | {!user ? (
97 |
98 | {lang[Langkey].LOGIN}
99 |
100 | ) : (
101 |
102 | {lang[Langkey].SIGNOUT}
103 |
104 | )}
105 |
106 |
107 | {lang[Langkey].FOLLOWING}
108 |
109 |
110 | {lang[Langkey].ABOUT}
111 |
112 |
113 |
114 |
115 | {lang[Langkey].KUNDLIGPT}
116 |
117 | {
118 | // user && {user?.displayName}
119 | }
120 |
121 |
122 |
123 |
124 |
128 | {MULTI_LANG.map((lang) => (
129 |
134 | {lang?.name}
135 |
136 | ))}
137 |
138 |
139 |
140 | {form && (
141 |
142 |
143 |
144 | )}
145 | >
146 | );
147 | };
148 | export default Header;
149 |
--------------------------------------------------------------------------------
/src/components/Hero.jsx:
--------------------------------------------------------------------------------
1 | import { useDispatch, useSelector } from "react-redux";
2 | import Explore from "./Explore";
3 | import { useEffect, useState } from "react";
4 | import TopAstro from "./TopAstro";
5 | import SignSearch from "./SignSearch";
6 | import Chatbot from "./Chatbot";
7 | import bg from "../image/bg1.jpg";
8 | import Coming from "./Coming";
9 | import logo from "../image/Logo.png"
10 | import { addBot } from "../store/configAppSlice";
11 |
12 | const Hero = () => {
13 | const [topAstro, settopAstro] = useState();
14 | const dispatch = useDispatch()
15 |
16 | const Bot = useSelector((store) => store.configApp.Bot);
17 |
18 | const fetchData = async () => {
19 | const data = await fetch(
20 | "https://api.consultant.list.astrotalk.com/AstroTalk/freeAPI/consultant/get-list/filter?appId=4&businessId=1&consultantTypeId=1&timezone=Asia/Kolkata&pageNo=0&pageSize=18&version=1.19.09.23&serviceId=4&languageId=1&hardwareId=&countryCode=&sortByRating=false&sortByExperience=false&sortByPrice=false&sortByOrder=false&isDesc=false&isPoAstrologer=true&userId=34925941"
21 | );
22 | const json = await data.json();
23 | settopAstro(json?.content);
24 | };
25 | useEffect(() => {
26 | fetchData();
27 | }, []);
28 |
29 | const handleBot = ()=>{
30 | dispatch(addBot())
31 | }
32 |
33 | return (
34 |
35 |
40 | {Bot &&
}
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | );
51 | };
52 | export default Hero;
53 |
--------------------------------------------------------------------------------
/src/components/Horoscope.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { useParams } from "react-router-dom";
3 | import useHoroscope from "../custom hooks/useHoroscope";
4 | import { useSelector } from "react-redux";
5 | import Chatbot from "./Chatbot";
6 | import HoroscopeBottom from "./HoroscopeBottom";
7 | import bg from "../image/bg1.jpg";
8 | import panditreading from "../image/pandit reading.webp";
9 | import lang from "../utils/langConstants";
10 |
11 | const Horoscope = () => {
12 | const { id } = useParams();
13 | // call the gpt api in useEffect by using custom hook
14 |
15 | useHoroscope(id);
16 |
17 | const Bot = useSelector((store) => store.configApp.Bot);
18 | const LangKey = useSelector((store) => store.configApp.lang);
19 | const horoscope = useSelector((store) => store.astro.horoscope);
20 |
21 | return (
22 |
23 | {Bot &&
}
24 |
29 |
30 |
31 |
32 | {" "}
33 | {lang[LangKey].yourHoroscope}
34 |
35 |
40 |
41 |
42 |
43 |
44 |
49 |
50 |
51 |
52 |
53 | {lang[LangKey].todaysHoroof} {id} :
54 |
55 |
56 | {horoscope}
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 | );
67 | };
68 |
69 | export default Horoscope;
70 |
--------------------------------------------------------------------------------
/src/components/HoroscopeBottom.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { useSelector } from "react-redux";
3 | import lang from "../utils/langConstants";
4 |
5 | const HoroscopeBottom = () => {
6 | const LangKey = useSelector(store => store.configApp.lang)
7 | return (
8 |
9 |
10 |
11 |
12 | {lang[LangKey].horobottomtitle1}
13 |
14 |
15 | ({lang[LangKey].horobottomtitle2})
16 |
17 |
22 |
23 |
24 |
25 | {lang[LangKey].horobottomdesc1}
26 |
27 |
28 |
29 |
30 |
31 | {lang[LangKey].horobottomtitle3}
32 |
33 |
34 | {lang[LangKey].horobottomdesc2}
35 |
36 |
37 |
38 |
39 |
40 | {lang[LangKey].horobottomtitle4}
41 |
42 |
43 |
44 | {lang[LangKey].horopoint1}
45 |
46 |
47 |
48 |
49 | {lang[LangKey].horopoint2}
50 |
51 |
52 |
53 |
54 | {lang[LangKey].horopoint3}
55 |
56 |
57 |
58 |
59 | {lang[LangKey].horopoint4}
60 |
61 |
62 |
63 |
64 | {lang[LangKey].horopoint5}
65 |
66 |
67 |
68 |
69 | {lang[LangKey].horopoint6}
70 |
71 |
72 |
73 |
74 | );
75 | };
76 |
77 | export default HoroscopeBottom;
78 |
--------------------------------------------------------------------------------
/src/components/LoginForm.jsx:
--------------------------------------------------------------------------------
1 | import React, { useRef, useState } from "react";
2 | import { checkValidData, checkValidData2 } from "../utils/validate";
3 | import {
4 | createUserWithEmailAndPassword,
5 | signInWithEmailAndPassword,
6 | updateProfile,
7 | } from "firebase/auth";
8 | import { auth } from "../utils/firebase";
9 | import { toast, Bounce } from "react-toastify";
10 | import "react-toastify/dist/ReactToastify.css";
11 | import { useDispatch, useSelector } from "react-redux";
12 | import { addUser } from "../store/userSlice";
13 | import lang from "../utils/langConstants";
14 | import { addForm } from "../store/configAppSlice";
15 | import { useNavigate } from "react-router-dom";
16 |
17 | const LoginForm = () => {
18 | const [signIn, setsignIn] = useState(true);
19 | const [errorMessage, seterrorMessage] = useState(null);
20 | const navigate = useNavigate()
21 |
22 | const dispatch = useDispatch();
23 | const Langkey = useSelector((store) => store.configApp.lang);
24 |
25 | const handleToggle = () => {
26 | setsignIn(!signIn);
27 | };
28 | const name = useRef(null);
29 | const email = useRef(null);
30 | const password = useRef(null);
31 |
32 | const handleSignIn = () => {
33 | const message = checkValidData(email.current.value, password.current.value);
34 | seterrorMessage(message);
35 |
36 | if (message) return;
37 |
38 | signInWithEmailAndPassword(
39 | auth,
40 | email.current.value,
41 | password.current.value
42 | )
43 | .then((userCredential) => {
44 | const user = userCredential.user;
45 | toast.success("Welcome to AstroGPT!", {
46 | position: "top-center",
47 | autoClose: 1000,
48 | hideProgressBar: true,
49 | closeOnClick: true,
50 | pauseOnHover: false,
51 | draggable: true,
52 | progress: undefined,
53 | theme: "dark",
54 | transition: Bounce,
55 | });
56 | })
57 | .catch((error) => {
58 | const errorCode = error.code;
59 | const errorMessage = error.message;
60 | if (errorCode === "auth/invalid-credential") {
61 | seterrorMessage("Incorrect Details Please Try Again");
62 | }
63 | });
64 |
65 | };
66 | const handleSignUp = () => {
67 | const message = checkValidData2(
68 | name.current.value,
69 | email.current.value,
70 | password.current.value
71 | );
72 | seterrorMessage(message);
73 |
74 | if (message) return;
75 |
76 | createUserWithEmailAndPassword(
77 | auth,
78 | email.current.value,
79 | password.current.value
80 | )
81 | .then((userCredential) => {
82 | const user = userCredential.user;
83 |
84 | updateProfile(user, {
85 | displayName: name.current.value,
86 | })
87 | .then(() => {
88 | const { uid, email, displayName } = auth;
89 | dispatch(
90 | addUser({ uid: uid, email: email, displayName: displayName })
91 | );
92 | })
93 | .catch((error) => {
94 | seterrorMessage(error.message);
95 | });
96 | toast.success("Welcome to AstroGPT!", {
97 | position: "top-center",
98 | autoClose: 10000,
99 | hideProgressBar: true,
100 | closeOnClick: true,
101 | pauseOnHover: false,
102 | draggable: true,
103 | progress: undefined,
104 | theme: "dark",
105 | transition: Bounce,
106 | });
107 | })
108 | .catch((error) => {
109 | const errorCode = error.code;
110 | const errorMessage = error.message;
111 | seterrorMessage(errorMessage);
112 | });
113 |
114 | };
115 |
116 | const handleform =()=>{
117 | dispatch(addForm())
118 | }
119 |
120 | return (
121 |
200 | );
201 | };
202 |
203 | export default LoginForm;
204 |
--------------------------------------------------------------------------------
/src/components/LoginPage.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import LoginForm from "./LoginForm";
3 | import { useSelector } from "react-redux";
4 | import { useNavigate } from "react-router-dom";
5 | import { toast, Bounce } from "react-toastify";
6 | import Header from "./Header";
7 | import lang from "../utils/langConstants";
8 | import bg from "../image/bg1.jpg";
9 | import hand from "../image/hand.png"
10 | import handbg from "../image/hand_bg.png"
11 |
12 | const LoginPage = () => {
13 | const user = useSelector((store) => store.user);
14 | const navigate = useNavigate();
15 | const Langkey = useSelector((store) => store.configApp.lang);
16 |
17 | const handleform = () => {
18 | {
19 | user
20 | ? navigate("/")
21 | : toast.warn("Please Login", {
22 | position: "top-center",
23 | autoClose: 1000,
24 | hideProgressBar: true,
25 | closeOnClick: true,
26 | pauseOnHover: false,
27 | draggable: true,
28 | progress: undefined,
29 | theme: "dark",
30 | transition: Bounce,
31 | });
32 | }
33 | };
34 |
35 | return (
36 | <>
37 |
38 |
39 |
44 |
48 |
49 |
50 | {lang[Langkey].welcome}
51 |
52 |
53 | {" "}
54 | {lang[Langkey].astroGPT}
55 |
56 |
57 | Your Horoscope Realm
58 |
59 |
60 | {lang[Langkey].loginDescription}
61 |
62 |
63 |
67 | {lang[Langkey].explore}
68 |
69 |
70 | AstroKundli
71 |
72 |
73 |
74 |
75 |
79 |
80 |
84 |
85 |
86 |
87 | >
88 | );
89 | };
90 |
91 | export default LoginPage;
92 |
--------------------------------------------------------------------------------
/src/components/SignSearch.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { useSelector } from 'react-redux'
3 | import lang from '../utils/langConstants'
4 | import { Link } from 'react-router-dom'
5 |
6 |
7 | const SignSearch = () => {
8 |
9 | const LangKey = useSelector(store => store.configApp.lang)
10 |
11 | const divCSS = 'flex justify-center items-center flex-col'
12 | const numCSS = 'text-2xl font-semibold text-purple-100 pb-2'
13 | const nameCSS = 'text-xl font-medium text-purple-200'
14 |
15 |
16 | return (
17 |
18 |
19 |
20 | {lang[LangKey].zodiacTitle}
21 |
22 |
27 |
28 | {lang[LangKey].zodiacDesc}
29 |
30 |
31 |
32 |
33 |
34 |
35 | {lang[LangKey].zodiacBirth}
36 |
37 |
38 |
39 | {lang[LangKey].zodiacTime}
40 |
41 |
42 |
43 |
44 | {lang[LangKey].zodiacPlace}
45 |
46 |
47 |
48 | {lang[LangKey].zodiacFind}
49 |
50 |
51 |
52 |
53 | )
54 | }
55 |
56 | export default SignSearch
57 |
--------------------------------------------------------------------------------
/src/components/TopAstro.jsx:
--------------------------------------------------------------------------------
1 | import React, { useState } from "react";
2 | import TopAstroCard from "./TopAstroCard";
3 | import { useSelector } from "react-redux";
4 | import { Link } from "react-router-dom";
5 | import lang from "../utils/langConstants";
6 |
7 | const TopAstro = ({ list }) => {
8 |
9 | const LangKey = useSelector(store => store.configApp.lang)
10 | return (
11 |
12 |
13 |
14 | {lang[LangKey].ourAstrologers}
15 |
16 |
21 |
22 | {lang[LangKey].astroDesc}
23 |
24 |
25 |
26 | {list?.map((data) => (
27 |
28 | ))}
29 |
30 |
31 | );
32 | };
33 |
34 | export default TopAstro;
35 |
--------------------------------------------------------------------------------
/src/components/TopAstroCard.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { PROFILE_IMG } from "../utils/constants";
3 |
4 | const TopAstroCard = ({ info }) => {
5 | return (
6 |
7 |
8 |
9 |
10 |
15 |
16 |
17 | {info?.rating > 4.9 ? (
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | ) : (
26 |
27 |
28 |
29 |
30 |
31 |
32 | )}
33 |
34 |
35 |
36 |
37 | {info?.name}
38 |
39 |
40 | {" "}
41 | (
42 | {info?.skill.length > 20
43 | ? `${info?.skill.slice(0, 20)}...`
44 | : info?.skill}
45 | )
46 |
47 |
48 |
49 |
50 | );
51 | };
52 |
53 | export default TopAstroCard;
54 |
--------------------------------------------------------------------------------
/src/components/ZodiacCard.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | const ZodiacCard = ({name,value,img}) => {
4 | return (
5 |
6 |
7 |
8 |
9 |
10 |
11 | {name}
12 | {value}
13 |
14 |
15 |
16 | )
17 | }
18 |
19 | export default ZodiacCard
20 |
--------------------------------------------------------------------------------
/src/components/ZodiacCardsList.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ZodiacCard from "./ZodiacCard";
3 | import Aries from "../image/Sign/sign1.svg";
4 | import Taurus from "../image/Sign/sign2.svg";
5 | import Gemini from "../image/Sign/sign3.svg";
6 | import Cancer from "../image/Sign/sign4.svg";
7 | import Leo from "../image/Sign/sign5.svg";
8 | import Virgo from "../image/Sign/sign6.svg";
9 | import Libra from "../image/Sign/sign7.svg";
10 | import Scorpio from "../image/Sign/sign8.svg";
11 | import Sagittarius from "../image/Sign/sign9.svg";
12 | import Capricorn from "../image/Sign/sign10.svg";
13 | import Aquarius from "../image/Sign/sign11.svg";
14 | import Pisces from "../image/Sign/sign12.svg";
15 | import { Link } from "react-router-dom";
16 | import kundli from "../image/kundli rishi.webp";
17 | import load from "../image/loading.png";
18 | import lang from "../utils/langConstants";
19 | import { useSelector } from "react-redux";
20 |
21 | const ZodiacCardsList = () => {
22 |
23 | const LangKey = useSelector(store => store.configApp.lang)
24 |
25 | return (
26 |
27 |
32 |
37 |
38 |
39 | {" "}
40 |
41 |
42 |
43 | {" "}
44 |
45 |
46 |
47 |
48 |
49 | {" "}
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | {" "}
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 | {" "}
78 |
79 |
80 |
81 | {" "}
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 | {" "}
91 |
96 |
97 |
98 |
99 | );
100 | };
101 |
102 | export default ZodiacCardsList;
103 |
--------------------------------------------------------------------------------
/src/components/ZodiacContainer.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import {useSelector} from "react-redux"
3 |
4 | import ZodiacCardsList from "./ZodiacCardsList";
5 | import lang from "../utils/langConstants";
6 |
7 | const ZodiacContainer = () => {
8 |
9 | const LangKey = useSelector(store => store.configApp.lang)
10 |
11 | return (
12 |
13 |
14 |
15 |
{lang[LangKey].horoTitle}
16 |
20 |
21 |
22 | {lang[LangKey].horoDesc}
23 |
24 |
25 |
26 |
27 |
28 | );
29 | };
30 |
31 | export default ZodiacContainer;
32 |
--------------------------------------------------------------------------------
/src/custom hooks/useAstroProfile.jsx:
--------------------------------------------------------------------------------
1 | //
2 |
3 | import { useEffect } from "react";
4 | import { useDispatch } from "react-redux";
5 | import { addAstroProfile } from "../store/AstroSlice";
6 |
7 | const useAstroProfile = (id)=>{
8 |
9 | const dispatch = useDispatch()
10 |
11 | const fetchData = async () =>{
12 | const data = await fetch("https://api.consultant.list.astrotalk.com/AstroTalk/freeAPI/consultant/get/by/slug/v2?languageId=1&timezone=Asia/Kolkata&hardwareId=&appVersionUser=1.19.09.23&businessId=1&appId=4&isOfferV3=&serviceId=4&slug="+ id +"&userId=")
13 | const json = await data.json();
14 | dispatch(addAstroProfile(json))
15 | }
16 | useEffect(()=>{
17 | fetchData()
18 | },[])
19 | }
20 | export default useAstroProfile;
--------------------------------------------------------------------------------
/src/custom hooks/useCall.jsx:
--------------------------------------------------------------------------------
1 | import { useEffect } from "react";
2 | import { useDispatch } from "react-redux";
3 | import { addCall } from "../store/AstroSlice";
4 | import Error from "../components/Error";
5 | import { useNavigate } from "react-router-dom";
6 | import { Bounce, toast } from "react-toastify";
7 |
8 | const useCall = ()=>{
9 |
10 | const dispatch = useDispatch()
11 | const navigate = useNavigate()
12 |
13 |
14 | const fetchData = async () => {
15 | try {
16 | const data = await fetch("https://api.consultant.list.astrotalk.com/AstroTalk/freeAPI/consultant/get-list/filter?appId=4&businessId=1&consultantTypeId=1&timezone=Asia/Kolkata&pageNo=0&pageSize=18&version=1.19.09.23&serviceId=4&languageId=1&hardwareId=&countryCode=&sortByRating=false&sortByExperience=false&sortByPrice=false&sortByOrder=false&isDesc=false&isPoAstrologer=true&userId=34925941")
17 | const json = await data.json();
18 | console.log(json);
19 | dispatch(addCall(json?.content));
20 | } catch (error) {
21 | console.error("Error fetching data:", error);
22 |
23 | if (error.message === 'Failed to fetch') {
24 | toast.error("Failed to fetch", {
25 | position: "top-center",
26 | autoClose: 3000,
27 | hideProgressBar: true,
28 | closeOnClick: true,
29 | pauseOnHover: false,
30 | draggable: true,
31 | progress: undefined,
32 | theme: "dark",
33 | transition: Bounce,
34 | });
35 | navigate("/error")
36 | navigate("/error")
37 |
38 |
39 | }
40 | }
41 | }
42 |
43 | useEffect(()=>{
44 | fetchData()
45 | },[])
46 | }
47 | export default useCall;
--------------------------------------------------------------------------------
/src/custom hooks/useChat.jsx:
--------------------------------------------------------------------------------
1 | import { useEffect } from "react";
2 | import { useDispatch } from "react-redux";
3 | import { addChat } from "../store/AstroSlice";
4 | import { useNavigate } from "react-router-dom";
5 | import { Bounce, toast } from "react-toastify";
6 |
7 | const useChat = () => {
8 |
9 | const dispatch = useDispatch()
10 | const navigate = useNavigate()
11 |
12 |
13 | const fetchData = async () =>{
14 | try {
15 | const data = await fetch("https://api.consultant.list.astrotalk.com/AstroTalk/freeAPI/consultant/get-list/filter?appId=4&businessId=1&consultantTypeId=1&timezone=Asia/Kolkata&pageNo=0&pageSize=18&version=1.19.09.23&serviceId=4&languageId=1&hardwareId=&countryCode=&sortByRating=false&sortByExperience=false&sortByPrice=false&sortByOrder=false&isDesc=false&isPoAstrologer=true&userId=34925941")
16 | const json = await data.json();
17 | dispatch(addChat(json?.content))
18 | } catch (error) {
19 | console.error("Error fetching data:", error);
20 |
21 | if (error.message === 'Failed to fetch') {
22 |
23 | toast.error("Failed to fetch", {
24 | position: "top-center",
25 | autoClose: 3000,
26 | hideProgressBar: true,
27 | closeOnClick: true,
28 | pauseOnHover: false,
29 | draggable: true,
30 | progress: undefined,
31 | theme: "dark",
32 | transition: Bounce,
33 | });
34 | navigate("/error")
35 |
36 |
37 | }
38 | }
39 | }
40 | useEffect(()=>{
41 | fetchData();
42 | },[])
43 | }
44 | export default useChat;
--------------------------------------------------------------------------------
/src/custom hooks/useHoroscope.jsx:
--------------------------------------------------------------------------------
1 | import { useEffect } from 'react'
2 | import openai from '../utils/openai';
3 | import { HOROSCOPE } from '../utils/constants';
4 | import { useDispatch, useSelector } from 'react-redux';
5 | import { addHoroscope } from '../store/AstroSlice';
6 |
7 | const useHoroscope = (id) => {
8 |
9 | const dispatch = useDispatch()
10 |
11 |
12 |
13 | const fetch = async (id) =>{
14 | const horoscope = (HOROSCOPE + id);
15 |
16 | const data = await openai.chat.completions.create({
17 | messages: [{ role: 'user', content: horoscope }],
18 | model: 'gpt-3.5-turbo',
19 | });
20 | dispatch(addHoroscope(data?.choices?.[0]?.message?.content))
21 | }
22 |
23 | useEffect(()=>{
24 | fetch();
25 | },[])
26 |
27 | }
28 |
29 | export default useHoroscope
30 |
--------------------------------------------------------------------------------
/src/image/Click.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/src/image/Click.jpeg
--------------------------------------------------------------------------------
/src/image/Cors (1).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/src/image/Cors (1).png
--------------------------------------------------------------------------------
/src/image/Cors (2).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/src/image/Cors (2).png
--------------------------------------------------------------------------------
/src/image/Logo text.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/src/image/Logo text.png
--------------------------------------------------------------------------------
/src/image/Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/src/image/Logo.png
--------------------------------------------------------------------------------
/src/image/Sign/sign1.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/image/Sign/sign10.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/image/Sign/sign12.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/image/Sign/sign2.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/image/Sign/sign5.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/image/Sign/sign7.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/image/Snapshots/AstroBot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/src/image/Snapshots/AstroBot.png
--------------------------------------------------------------------------------
/src/image/Snapshots/Home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/src/image/Snapshots/Home.png
--------------------------------------------------------------------------------
/src/image/Snapshots/Horoscope.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/src/image/Snapshots/Horoscope.png
--------------------------------------------------------------------------------
/src/image/Snapshots/Kundli.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/src/image/Snapshots/Kundli.png
--------------------------------------------------------------------------------
/src/image/Snapshots/List.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/src/image/Snapshots/List.png
--------------------------------------------------------------------------------
/src/image/Snapshots/Login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/src/image/Snapshots/Login.png
--------------------------------------------------------------------------------
/src/image/Snapshots/Profile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/src/image/Snapshots/Profile.png
--------------------------------------------------------------------------------
/src/image/bg1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/src/image/bg1.jpg
--------------------------------------------------------------------------------
/src/image/cycle.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/src/image/cycle.jpg
--------------------------------------------------------------------------------
/src/image/hand.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/src/image/hand.png
--------------------------------------------------------------------------------
/src/image/hand_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/src/image/hand_bg.png
--------------------------------------------------------------------------------
/src/image/jyotish 1.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/src/image/jyotish 1.jpeg
--------------------------------------------------------------------------------
/src/image/jyotish 2.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/src/image/jyotish 2.jpeg
--------------------------------------------------------------------------------
/src/image/kundli rishi.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/src/image/kundli rishi.webp
--------------------------------------------------------------------------------
/src/image/loading.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/src/image/loading.png
--------------------------------------------------------------------------------
/src/image/pandit aarti.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/src/image/pandit aarti.webp
--------------------------------------------------------------------------------
/src/image/pandit hand checking.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/src/image/pandit hand checking.png
--------------------------------------------------------------------------------
/src/image/pandit headphones.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/src/image/pandit headphones.png
--------------------------------------------------------------------------------
/src/image/pandit on pc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/src/image/pandit on pc.png
--------------------------------------------------------------------------------
/src/image/pandit on phone.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/src/image/pandit on phone.webp
--------------------------------------------------------------------------------
/src/image/pandit reading.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/src/image/pandit reading.webp
--------------------------------------------------------------------------------
/src/image/pandit showing phone screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/src/image/pandit showing phone screen.png
--------------------------------------------------------------------------------
/src/image/pandit welcome.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VKoder/AstroGPT/b2798024071b1444f40572f990ebb707897fd2e8/src/image/pandit welcome.webp
--------------------------------------------------------------------------------
/src/index.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
5 | *{
6 | padding: 0;
7 | margin: 0;
8 | box-sizing: border-box;
9 | }
10 | *::selection {
11 | background-color: white;
12 | color: rgb(166, 30, 166);
13 | }
14 |
15 | *::-webkit-scrollbar {
16 | display: none;
17 | background-color: #040404;
18 | width: 0.4vw;
19 | z-index: 99;
20 | }
21 | *::-webkit-scrollbar-thumb {
22 | background-color: rgb(109, 30, 166);;
23 | border-radius: 2vw;
24 | }
25 | @media (max-width: 400px) {
26 | *::-webkit-scrollbar-thumb {
27 | display: none;
28 | }
29 | }
30 |
31 |
32 | .no-scrollbar::-webkit-scrollbar {
33 | display: none;
34 | }
35 |
36 | /* Hide scrollbar for IE, Edge and Firefox */
37 | .no-scrollbar {
38 | -ms-overflow-style: none; /* IE and Edge */
39 | scrollbar-width: none; /* Firefox */
40 | }
41 | .stroke {
42 | max-height: 380px;
43 | background: #d6d6d6;
44 | }
45 | .animate {
46 | animation: shimmer 3s infinite;
47 | background: linear-gradient(to right, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
48 | background-size: 1000px 100%;
49 | }
50 | .btn.btn-bg-slide::before{
51 | content: '';
52 | position: absolute;
53 | top: 0;
54 | left: 0;
55 | bottom: 0;
56 | right: 0;
57 | background: linear-gradient(to bottom right, rgba(89, 21, 134, 0.783), rgba(92, 6, 138, 0.82), rgba(47, 0, 78, 0.783));
58 | z-index: 1;
59 |
60 | z-index: -1;
61 | transform: scaleX(0);
62 | transform-origin: left;
63 | }
64 | .btn.btn-bg-slide:hover::before,
65 | .btn.btn-bg-slide:focus::before{
66 | transform: scaleX(1);
67 | transition: transform 280ms ease-in-out;
68 | }
69 | .btn.btn-bg-slide{
70 | z-index: 1;
71 | background-color: rgba(43, 5, 74, 0.753);
72 | }
73 |
74 | .foot{
75 | box-shadow: 0px -4px 40px rgba(26, 26, 26, 0.712);
76 | }
77 |
78 |
79 | .lii{
80 | transition-duration: 0.4s;
81 | transition-timing-function: ease-in-out;
82 |
83 | }
84 |
85 | @keyframes shimmer {
86 | from {
87 | background-position: -1000px 0;
88 | }
89 | to {
90 | background-position: 1000px 0;
91 | }
92 | }
93 | .hand {
94 | animation-name: hand;
95 | animation-duration: 10s; /* Adjust duration as needed */
96 | animation-iteration-count: infinite;
97 | animation-timing-function: linear;
98 | }
99 |
100 | @keyframes hand {
101 | from {
102 | transform: rotate(0deg);
103 | }
104 | to {
105 | transform: rotate(360deg);
106 | }
107 | }
108 | .spanCSS{
109 | transition: 0.1s;
110 | transition-timing-function: ease-in-out;
111 |
112 | }
113 |
114 |
115 | .inputCSS:focus + .spanCSS,
116 | .inputCSS:valid + .spanCSS{
117 | top: -15px;
118 | font-size: 14px;
119 |
120 | }
121 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 | import reportWebVitals from './reportWebVitals';
6 |
7 | const root = ReactDOM.createRoot(document.getElementById('root'));
8 | root.render(
9 |
10 |
11 | )
12 |
13 | // If you want to start measuring performance in your app, pass a function
14 | // to log results (for example: reportWebVitals(console.log))
15 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
16 | reportWebVitals();
17 |
--------------------------------------------------------------------------------
/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/src/shimmer/ShimmerCard.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | const ShimmerCard = () => {
4 | return (
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | );
16 | };
17 |
18 | export default ShimmerCard;
19 |
--------------------------------------------------------------------------------
/src/shimmer/ShimmerList.jsx:
--------------------------------------------------------------------------------
1 | import ShimmerCard from "./ShimmerCard";
2 |
3 | const ShimmerList = () => {
4 | return (
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | );
28 | };
29 | export default ShimmerList;
30 |
--------------------------------------------------------------------------------
/src/shimmer/ShimmerProfile.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | const ShimmerProfile = () => {
4 | return (
5 |
6 |
7 |
8 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
23 |
24 |
25 |
26 |
27 | );
28 | };
29 |
30 | export default ShimmerProfile;
31 |
--------------------------------------------------------------------------------
/src/store/AstroSlice.jsx:
--------------------------------------------------------------------------------
1 | import { createSlice } from "@reduxjs/toolkit";
2 |
3 | const AstroSlice = createSlice({
4 | name :"AstroSlice",
5 | initialState:{
6 | chatList:null,
7 | callList:null,
8 | astroProfile:null,
9 | horoscope: null,
10 | },
11 | reducers:{
12 | addChat:(state,action)=>{
13 | state.chatList = action.payload;
14 | },
15 | addCall :(state, action)=>{
16 | state.callList = action.payload;
17 | },
18 | addAstroProfile:(state,action)=>{
19 | state.astroProfile = action.payload;
20 | },
21 | addHoroscope:(state, action)=>{
22 | state.horoscope = action.payload;
23 | }
24 | }
25 | })
26 | export default AstroSlice.reducer;
27 | export const {addChat, addCall,addAstroProfile , addHoroscope} = AstroSlice.actions;
--------------------------------------------------------------------------------
/src/store/CommentsSlice.jsx:
--------------------------------------------------------------------------------
1 |
2 | import { createSlice } from "@reduxjs/toolkit";
3 |
4 | const CommentsSlice = createSlice({
5 | name:"comment",
6 | initialState: {
7 | comment: null,
8 | },
9 | reducers:{
10 | addComment:(state, action)=>{
11 | state.comment = action.payload;
12 | }
13 | }
14 | })
15 |
16 | export default CommentsSlice.reducer;
17 | export const {addComment} = CommentsSlice.actions
--------------------------------------------------------------------------------
/src/store/appStore.jsx:
--------------------------------------------------------------------------------
1 | import { configureStore } from "@reduxjs/toolkit";
2 | import astroReducer from "./AstroSlice"
3 | import commentReducer from "./CommentsSlice"
4 | import userReducer from "./userSlice"
5 | import followReducer from "./followSlice"
6 | import configAppSliceReducer from "./configAppSlice";
7 |
8 |
9 | const appStore = configureStore({
10 | reducer:{
11 | astro : astroReducer,
12 | comment : commentReducer,
13 | user: userReducer,
14 | follow: followReducer,
15 | configApp: configAppSliceReducer,
16 | }
17 | })
18 | export default appStore;
--------------------------------------------------------------------------------
/src/store/configAppSlice.jsx:
--------------------------------------------------------------------------------
1 | import { createSlice } from "@reduxjs/toolkit";
2 |
3 | const configAppSlice = createSlice({
4 | name:"appslice",
5 | initialState:{
6 | lang : "en",
7 | form: false,
8 | Limit: null,
9 | Bot: false,
10 | },
11 | reducers:{
12 | addLang : (state,action)=>{
13 | state.lang = action.payload;
14 | },
15 | addForm: (state,action)=>{
16 | state.form = !state.form;
17 | },
18 | removeForm:(state,action)=>{
19 | state.form = false;
20 | },
21 | addLimit:(state, action)=>{
22 | state.Limit = action.payload;
23 | },
24 | addBot:(state,action)=>{
25 | state.Bot = !state.Bot
26 | }
27 |
28 |
29 | }
30 | })
31 |
32 | export default configAppSlice.reducer;
33 | export const {addLang, addForm, removeForm, addLimit,addBot} = configAppSlice.actions;
--------------------------------------------------------------------------------
/src/store/followSlice.jsx:
--------------------------------------------------------------------------------
1 | import { createSlice } from "@reduxjs/toolkit";
2 |
3 | const followSlice = createSlice({
4 | name:"follow",
5 | initialState:({
6 | follow:[],
7 | }),
8 | reducers:{
9 | addFollow:(state,action)=>{
10 | state.follow.push(action.payload);
11 | },
12 | clearFollow:(state, action)=>{
13 | state.follow.length = 0;
14 | },
15 | removeFollow:(state,action)=>{
16 | const index = state.follow.findIndex(item => item === action.payload);
17 | if (index !== -1) {
18 | state.follow.splice(index, 1);
19 | }
20 | }
21 |
22 | }
23 | })
24 |
25 | export default followSlice.reducer;
26 | export const {addFollow, clearFollow, removeFollow} = followSlice.actions;
--------------------------------------------------------------------------------
/src/store/userSlice.jsx:
--------------------------------------------------------------------------------
1 | import { createSlice } from "@reduxjs/toolkit";
2 |
3 | const userSlice = createSlice({
4 | name: "user",
5 | initialState: null,
6 | reducers:{
7 | addUser:(state,action)=>{
8 | return action.payload;
9 | },
10 | removeUser:(state,action)=>{
11 | return null;
12 | }
13 |
14 | }
15 | })
16 | export const {addUser,removeUser, addLimit} = userSlice.actions;
17 | export default userSlice.reducer;
--------------------------------------------------------------------------------
/src/utils/Loading.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | const Loading = () => {
4 | return (
5 |
6 |
7 |
8 |
9 |
10 | )
11 | }
12 |
13 | export default Loading
14 |
--------------------------------------------------------------------------------
/src/utils/constants.jsx:
--------------------------------------------------------------------------------
1 | export const PROFILE_IMG = "http://aws.astrotalk.com/consultant_pic/"
2 |
3 | export const TICKED = "https://d1gcna0o0ldu5v.cloudfront.net/fit-in/24x24/assets/images/Chat_with_astrologers/webp/tick_icon.webp";
4 |
5 | export const PROFILE_BG = "https://aws.astrotalk.com/assets/images/astro-background-gray.webp"
6 |
7 | export const MULTI_LANG = [
8 | { identifier: "en", name: "English" },
9 | { identifier: "hindi", name: "Hindi" },
10 | { identifier: "marathi", name: "Marathi" },
11 | { identifier: "spanish", name: "Spanish" },
12 | {identifier:"telugu",name:"Telugu"},
13 | {identifier:"japanese",name:"Japanese"}
14 | ];
15 |
16 |
17 | export const GPT_LANG = [
18 | { identifier: "en", name: "English" },
19 | { identifier: "hindi", name: "Hindi" },
20 | { identifier: "marathi", name: "Marathi" },
21 | { identifier: "telugu", name: "Telugu" },
22 | { identifier: "tamil", name: "Tamil" },
23 | { identifier: "bengali", name: "Bengali" },
24 | { identifier: "gujarati", name: "Gujarati" },
25 | { identifier: "kannada", name: "Kannada" },
26 | { identifier: "malayalam", name: "Malayalam" },
27 | { identifier: "punjabi", name: "Punjabi" },
28 | { identifier: "hinglish", name: "Hinglish" },
29 | { identifier: "french", name: "French" },
30 | { identifier: "german", name: "German" },
31 | { identifier: "russian", name: "Russian" },
32 | { identifier: "italian", name: "Italian" },
33 | { identifier: "arabic", name: "Arabic" },
34 | { identifier: "chinese", name: "Chinese" },
35 | { identifier: "portuguese", name: "Portuguese" },
36 | { identifier: "dutch", name: "Dutch" }
37 |
38 | ];
39 |
40 |
41 | export const OPEN_AI_KEY = process.env.REACT_APP_OPEN_AI_KEY;
42 |
43 | export const CHAT_BOT = process.env.REACT_APP_BOT_PROMPT;
44 |
45 | export const HOROSCOPE = process.env.REACT_APP_HOROSCOPE_PROMPT;
46 |
47 | export const TALK_PROMPT = process.env.REACT_APP_TALK_PROMPT;
48 |
49 | export const ASTRO_KUNDLI_PROMPT = `Hey, I am an AstroKundli integrated in AstroGPT, created by Sir Vivek Khule, a visionary mind behind AstroGPT. Please note that these readings may not be fully accurate.
50 |
51 |
52 |
Zodiac Sign: [Zodiac Sign]
53 |
As Per your Vedic astrological reading, you are born under the zodiac sign of [Zodiac Sign]. This influences your personality and life path.
54 |
55 |
Personality:
56 |
You are known for your [Personality Traits]. You are recognized for your [Strengths] and [Weaknesses], which shape your interactions and decisions.
57 |
58 |
Career Prospects:
59 |
Your career prospects show [Career Outlook]. Your strengths lie in [Career Strengths], which can lead to success in [Career Fields].
60 |
61 |
Love Life:
62 |
Your love life is influenced by [Love Life Insights]. Your romantic relationships are shaped by [Love Life Factors], affecting your emotional fulfillment.
63 |
64 |
65 |
Financial Situation:
66 |
Your financial situation presents [Financial Challenges/Opportunities]. It's crucial to follow [Financial Advice] for stability and prosperity.
67 |
68 |
Happiness:
69 |
Your happiness is influenced by [Factors Affecting Happiness]. By focusing on [Happiness Tips], you can enhance your well-being and fulfillment.
70 |
71 |
Motivational Message:
72 |
Remember, [Motivational Message]. Stay true to yourself, embrace opportunities, and navigate challenges with resilience. Your journey is unique, and your potential is limitless.
73 |
74 |
(remember always give responce like in this format only just change the insights for each but that h1 div and all styling part keep it as it is heading title and all okay)
75 | `
76 |
--------------------------------------------------------------------------------
/src/utils/firebase.jsx:
--------------------------------------------------------------------------------
1 | // Import the functions you need from the SDKs you need
2 | import { initializeApp } from "firebase/app";
3 | import { getAnalytics } from "firebase/analytics";
4 | import {getAuth} from "firebase/auth"
5 | // TODO: Add SDKs for Firebase products that you want to use
6 | // https://firebase.google.com/docs/web/setup#available-libraries
7 |
8 | // Your web app's Firebase configuration
9 | // For Firebase JS SDK v7.20.0 and later, measurementId is optional
10 | const firebaseConfig = {
11 | apiKey: "AIzaSyBe_w8GXHfHBfNugyC4T0WEiEODYnrW0TU",
12 | authDomain: "astrogpt-1aaae.firebaseapp.com",
13 | projectId: "astrogpt-1aaae",
14 | storageBucket: "astrogpt-1aaae.appspot.com",
15 | messagingSenderId: "414375149018",
16 | appId: "1:414375149018:web:86664eb2207c53568954e3",
17 | measurementId: "G-91R73BRPJS"
18 | };
19 |
20 | // Initialize Firebase
21 | const app = initializeApp(firebaseConfig);
22 | const analytics = getAnalytics(app);
23 |
24 | export const auth = getAuth();
--------------------------------------------------------------------------------
/src/utils/openai.jsx:
--------------------------------------------------------------------------------
1 | import OpenAI from 'openai';
2 | import { OPEN_AI_KEY } from './constants';
3 |
4 | const openai = new OpenAI({
5 | apiKey: OPEN_AI_KEY,
6 | dangerouslyAllowBrowser:true,
7 | });
8 | export default openai;
--------------------------------------------------------------------------------
/src/utils/validate.jsx:
--------------------------------------------------------------------------------
1 | export const checkValidData = (email, password) => {
2 | // This Validate variables will test and store TRUE / FALSE depends on test()
3 | const emailValidate = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/.test(email);
4 | const passwordValidate = /(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/.test(password);
5 | // const nameValidate = name !== null && name !== undefined;
6 |
7 | // If they are false Give Error Message
8 | // if (!nameValidate) return "Name is not Valid";
9 | if (!emailValidate) return "Email is not Valid";
10 | if (!passwordValidate) return "Password is not Valid";
11 |
12 | return null;
13 | };
14 |
15 | export const checkValidData2 = (name, email, password) => {
16 | // This Validate variables will test and store TRUE / FALSE depends on test()
17 | const emailValidate = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/.test(email);
18 | const passwordValidate = /(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/.test(password);
19 | const nameValidate = name !== "" && name !== undefined;
20 |
21 | // If they are false Give Error Message
22 | if (!nameValidate) return "Name is not Valid";
23 | if (!emailValidate) return "Email is not Valid";
24 | if (!passwordValidate) return "Password must contain 6 digits one symbol, one capital letter";
25 |
26 | return null;
27 |
28 | };
29 |
30 | export const kundlicheck = (name, place, district, time,gen)=>{
31 |
32 | const nameValidate = name !== "" && name !== undefined
33 | const placeValidate = place !== "" && place !== undefined
34 | const districtValidate = district !== "" && district !== undefined
35 | const timeValidate = time !== "" && time !== undefined
36 | const gender = gen !== "" && gen!== undefined
37 |
38 | if (!nameValidate) {
39 | return "Please Enter a Valid Name"
40 | }
41 | if (!placeValidate) {
42 | return "Please Enter a Valid Place"
43 | }
44 | if (!districtValidate) {
45 | return "Please Enter a Valid District"
46 | }
47 |
48 | if (!timeValidate) {
49 | return "Please Enter a Valid Time"
50 | }
51 |
52 | if (!gender) {
53 | return "Please Enter a Valid Gender"
54 | }
55 | return null;
56 |
57 | }
--------------------------------------------------------------------------------
/tailwind.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('tailwindcss').Config} */
2 | module.exports = {
3 | content: [
4 | "./src/*/*.{js,jsx,ts,tsx}",
5 | ],
6 | theme: {
7 | extend: {},
8 | },
9 | plugins: [],
10 | }
--------------------------------------------------------------------------------