This Next.js application allows you to explore your daily, weekly, monthly or more horoscope based on your chosen zodiac sign. It leverages Tailwind CSS for a clean and responsive user interface.
- Zodiac Sign Selection: Choose your zodiac sign from a dropdown menu.
- Date Selection: Select the desired date for your horoscope (today, tomorrow, yesterday, weekly, or monthly).
- Horoscope Display: View your personalized horoscope text in a dedicated section.
- Clean and Responsive UI: Tailwind CSS ensures a beautiful and responsive layout across different devices.
- Fetches(web scraping) horoscope data from API
The application utilizes an API route (/api/horoscope) to fetch horoscope data from the external website. This route accepts query parameters for zodiacSign and timeFrame.
- Method: GET
http://localhost:3000/api/horoscope?zodiacSign=Cancer&period=today
Replace
Cancer
with the desired zodiac sign andtoday
with any timeframe you like.
- Method: GET
http://localhost:3000/api/horoscope?zodiacSign=Cancer&period=weekly
Replace
Cancer
with the desired zodiac sign andweekly
with any timeframe you like.
- Method: GET
http://localhost:3000/api/horoscope?zodiacSign=Cancer&period=YYYY-MM-DD
Replace
Cancer
with the desired zodiac sign andYYYY-MM-DD
with a date within the last year.
- Method: GET
- Visit the application in your browser.
- Select your zodiac sign from the dropdown menu.
- Choose your desired horoscope timeframe:
- Today
- Tomorrow
- Yesterday
- Weekly
- Monthly
- Specific Date (enter in YYYY-MM-DD format)
- Click the "Get Horoscope" button.
- Your personalized horoscope will be displayed below.
- VS Code or any Code editor
- Node.js installed on your machine
- npm package manager
- To make API requests, you can use either the Postman or Thunder client extension in VS Code.
-
Clone the repository:
git clone https://github.com/thesushilsharma/Zodiac.git
-
Install dependencies:
- axios: Promise-based HTTP client for the browser and Node.js
- cheerio: Fast, flexible & lean implementation of core jQuery designed specifically for the server
- moment: Parse, validate, manipulate, and display dates and times in JavaScript
cd Zodiac npm i
-
Start the development server:
npm run dev
This starts the development server and opens your app in the browser, typically at http://localhost:3000
You can deploy this API to a production server using a platform like Vercel, Netlify or any of your choice.
Feel free to fork the repository and submit pull requests with your improvements or bug fixes. We welcome contributions from the community!
This project is licensed under the MIT License. See the LICENSE file for details.
- This project is for educational purposes only.