This web project is designed using Bootstrap for a responsive and user-friendly layout. It comprises three main sections: the "Home" page providing an overview of the project, the "Quotes" page featuring two APIs for generating random quotes and cat facts, and the "Weather" page where users can retrieve weather information for any city using the OpenWeatherAPI.
The application utilizes three APIs: OpenWeatherMap for weather data, QuotesOnDesignAPI for random quotes from design, and CatFactNinjaAPI for interesting cat facts. These APIs are integrated to enhance the user experience by providing dynamic content.
The backend is built with Express, and EJS is used for templating, ensuring efficient server-side rendering and a seamless interaction for users.
- Express (https://www.npmjs.com/package/express);
- Axios (https://www.npmjs.com/package/axios)
- dotenv (https://www.npmjs.com/package/dotenv)
- Embedded JavaScript templates(EJS) (https://www.npmjs.com/package/ejs);
- OpenWeatherMap API (https://openweathermap.org/api);
- QuotesOnDesign API (https://quotesondesign.com/wp-json/wp/v2/posts/);
- CatFact Ninja API (https://catfact.ninja/fact);
Before installing this application, ensure that you have GitBash, Node.js, and Node Package Manager(npm) installed on your machine.
- Create a folder where you want to install this project.
- Open the created folder with GitBash.
- Use the following commands in GitBash to download the project:
https://github.com/s3r1msultan/openweatherapi.git
cd openweatherapi
- Install all dependencies:
npm install
- Create .env file with API keys and URLs
- Start the server with:
npm start
- The server runs on port 3000. Open the project in your browser by navigating to localhost:3000.
After completing these steps, you will land on the Home Page.
To view the project, navigate to the "Weather" "Quotes" tabs, or visit localhost:3000/weather / localhost:3000/quotes.