This project is a web application designed to combine daily motivational quotes with a personal to-do list. It addresses the common issue of needing a little inspiration and a tool to manage tasks throughout the day. The app fetches random pieces of advice to motivate users and provides a space for managing tasks they plan to accomplish during their time in the browser. It includes a dark mode feature for improved usability across different lighting conditions.
Many people struggle with motivation and maintaining productivity throughout the day. This application aims to address that by providing users with inspirational quotes to boost their mood, as well as a simple, efficient to-do list to help them manage their tasks. The focus is on providing a practical tool to organize tasks, combined with motivational content to keep users engaged and uplifted.
- Daily Inspiration: Displays a new piece of advice or motivational quote fetched from an external API.
- Dynamic Date & Time: Continuously shows the current date and time, keeping users aware of their schedule.
- To-Do List: Users can add, complete, and delete tasks, tracking what they need to get done.
- Task Statistics: Shows total tasks, completed tasks, and remaining tasks to provide a quick overview of progress.
- Dark Mode: Toggle between light and dark modes to accommodate different user preferences.
- Responsive Design: Ensures a smooth experience across all device sizes.
- React: JavaScript library for building user interfaces.
- CSS: Styling for the application.
- JavaScript: Logic for interactivity, fetching data, and task management.
- Advice Slip JSON API: External API used to fetch random pieces of advice.
- Lorem Picsum: Provides random photos for the visual inspiration section.
Throughout the development of this project, ChatGPT was used to assist with code generation, particularly for styling adjustments, structuring components, and implementing various UI features like animations. Proper credit has been given in the project for code contributions suggested by AI. Adjustments were made to AI-generated suggestions to fit the project’s requirements and improve functionality.
Follow the steps below to set up and run the project locally.
- Node.js (version 12 or higher) and npm installed. You can download Node.js here.
-
Clone the repository:
git clone https://github.com/ahamedfoisal/daily-advice-app.git
-
Navigate to the project directory:
cd daily-advice-app
-
Install dependencies:
npm install
-
Run the application:
npm start
-
View the app in your browser: Open http://localhost:3000 to see the application running.
- Daily Inspiration
- The app shows the current date and time, along with a piece of advice. Click “Get New Advice” to fetch another random piece of advice.
- Dark Mode
- Use the toggle switch in the top-right corner to switch between light and dark modes.
- To-Do List
- Add tasks by typing in the input field and clicking “Add Task.”
- Mark tasks as completed by clicking the checkbox next to each task.
- Delete tasks by clicking the “Delete” button.
- View task statistics (total, completed, and remaining tasks) at the bottom of the to-do list.
- Random Inspirational Photos
- The app displays a random photo below the main content area, adding a visual element to the inspiration.
/daily-advice-app
├── README.md
├── package.json
├── .gitignore
├── public
│ └── index.html
└── src
├── App.js # Main app component
├── index.js # Entry point of the app
├── index.css # Global styles
├── components
│ ├── ToDoList.js # Component managing the to-do list functionalities
│ └── DarkModeToggle.js # Component managing the dark mode toggle
└── assets
└── images # Static images, if any
- Endpoint: https://api.adviceslip.com/advice
- Integration: The app uses the
fetch
method to call this API and retrieve random pieces of advice, which are displayed to users as daily inspiration.
- A function named
fetchAdvice
is used to make a GET request to the Advice Slip JSON API. - The response is parsed, and the advice is displayed in the “Daily Inspiration” section of the app.
- Clicking the “Get New Advice” button triggers this function to fetch a new piece of advice.
The app includes error handling to manage API request failures gracefully, displaying an appropriate message to the user if the advice cannot be fetched.
- ChatGPT was extensively used to assist in coding, providing suggestions on how to implement dark mode, structuring the
App.js
component, CSS styling, animations for buttons, and creating a responsive layout. - Minor adjustments were made to AI-suggested code to ensure smooth integration with the rest of the project.
- The idea to add task tally and visual improvements for the to-do list was inspired by recommendations provided through AI assistance.
- Persistence: Save tasks to local storage or integrate with a database to maintain the to-do list across sessions.
- Notifications: Add task reminders or motivational pop-ups to encourage productivity.
- User Customization: Allow users to customize the appearance of the app with different themes or colors.
Contributions are welcome! If you’d like to suggest a feature, report a bug, or contribute code, feel free to open an issue or create a pull request.
-
Fork the repository.
-
Create a new branch:
git checkout -b feature-name
-
Make your changes and commit them.
-
Push to your branch:
git push origin feature-name
-
Submit a pull request.
This project is open-source and available under the MIT License. Feel free to use, modify, and distribute it.