diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000..a547bf36d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,24 @@
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+pnpm-debug.log*
+lerna-debug.log*
+
+node_modules
+dist
+dist-ssr
+*.local
+
+# Editor directories and files
+.vscode/*
+!.vscode/extensions.json
+.idea
+.DS_Store
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.sw?
diff --git a/README.md b/README.md
index 7936f58a7..405fb025a 100644
--- a/README.md
+++ b/README.md
@@ -1,70 +1,51 @@
-# React.js and Tailwind CSS Assignment
+# Task Manager Application
-This assignment focuses on building a responsive React application using JSX and Tailwind CSS, implementing component architecture, state management, hooks, and API integration.
+A modern task management application built with React, featuring dark mode, API integration, and responsive design.
-## Assignment Overview
+Access the live demo at: https://react-js-jsx-and-css-mastering-fron-one-alpha.vercel.app/
-You will:
-1. Set up a React project with Vite and Tailwind CSS
-2. Create reusable UI components
-3. Implement state management using React hooks
-4. Integrate with external APIs
-5. Style your application using Tailwind CSS
+## Setup Instructions
-## Getting Started
-
-1. Accept the GitHub Classroom assignment invitation
-2. Clone your personal repository that was created by GitHub Classroom
-3. Install dependencies:
- ```
- npm install
- ```
-4. Start the development server:
- ```
- npm run dev
- ```
+1. Install dependencies:
+```bash
+npm install
+```
-## Files Included
+2. Configure environment (create .env file):
+```bash
+VITE_API_URL=https://jsonplaceholder.typicode.com
+```
-- `Week3-Assignment.md`: Detailed assignment instructions
-- Starter files for your React application:
- - Basic project structure
- - Pre-configured Tailwind CSS
- - Sample component templates
+3. Start development server:
+```bash
+npm run dev
+```
-## Requirements
+## Features
+- Task Management with local storage
+- Dark/Light theme support
+- API integration with JSONPlaceholder
+- Responsive design
+- Time-based task scheduling
-- Node.js (v18 or higher)
-- npm or yarn
-- Modern web browser
-- Code editor (VS Code recommended)
+## Tech Stack
+- React
+- React Router
+- Tailwind CSS
+- Vite
## Project Structure
-
```
src/
-├── components/ # Reusable UI components
-├── pages/ # Page components
-├── hooks/ # Custom React hooks
-├── context/ # React context providers
-├── api/ # API integration functions
-├── utils/ # Utility functions
-└── App.jsx # Main application component
+ ├── api/ # API integration
+ ├── components/ # Reusable components
+ ├── context/ # Context providers
+ ├── pages/ # Page components
+ └── App.jsx # Main application
```
-## Submission
-
-Your work will be automatically submitted when you push to your GitHub Classroom repository. Make sure to:
-
-1. Complete all required components and features
-2. Implement proper state management with hooks
-3. Integrate with at least one external API
-4. Style your application with Tailwind CSS
-5. Deploy your application and add the URL to your README.md
-
-## Resources
-
-- [React Documentation](https://react.dev/)
-- [Tailwind CSS Documentation](https://tailwindcss.com/docs)
-- [Vite Documentation](https://vitejs.dev/guide/)
-- [React Router Documentation](https://reactrouter.com/)
\ No newline at end of file
+## Available Scripts
+- `npm run dev` - Start development server
+- `npm run build` - Build for production
+- `npm run preview` - Preview production build
+- `npm run lint` - Run ESLint
diff --git a/eslint.config.js b/eslint.config.js
new file mode 100644
index 000000000..cee1e2c78
--- /dev/null
+++ b/eslint.config.js
@@ -0,0 +1,29 @@
+import js from '@eslint/js'
+import globals from 'globals'
+import reactHooks from 'eslint-plugin-react-hooks'
+import reactRefresh from 'eslint-plugin-react-refresh'
+import { defineConfig, globalIgnores } from 'eslint/config'
+
+export default defineConfig([
+ globalIgnores(['dist']),
+ {
+ files: ['**/*.{js,jsx}'],
+ extends: [
+ js.configs.recommended,
+ reactHooks.configs['recommended-latest'],
+ reactRefresh.configs.vite,
+ ],
+ languageOptions: {
+ ecmaVersion: 2020,
+ globals: globals.browser,
+ parserOptions: {
+ ecmaVersion: 'latest',
+ ecmaFeatures: { jsx: true },
+ sourceType: 'module',
+ },
+ },
+ rules: {
+ 'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }],
+ },
+ },
+])
diff --git a/index.html b/index.html
new file mode 100644
index 000000000..9ad0db76e
--- /dev/null
+++ b/index.html
@@ -0,0 +1,13 @@
+
+
+
+
-
Task Manager
-
- {/* Task input form */}
-
-
- {/* Filter buttons */}
-
-
-
-
-
+
+
+
+
+ My Tasks
+
+
+ {/* Updated Task input form */}
+
- {/* Task list */}
-
-
-
- ))
- )}
-
-
- {/* Task stats */}
-
-
- {tasks.filter((task) => !task.completed).length} tasks remaining
-
+
+
toggleTask(task.id)}
+ className="h-5 w-5 text-blue-600 rounded focus:ring-blue-500"
+ />
+
+
+ {task.text}
+
+
+ {task.date} • {task.startTime} - {task.endTime}
+
+
+
+
+
+
+
+
+ ))
+ )}
+
+
+ {/* Task stats */}
+
+
+ {tasks.filter((task) => !task.completed).length} tasks remaining
+
+
+
);
};
-export default TaskManager;
\ No newline at end of file
+export default TaskManager;
\ No newline at end of file
diff --git a/src/context/ThemeContext.jsx b/src/context/ThemeContext.jsx
new file mode 100644
index 000000000..15ca742d3
--- /dev/null
+++ b/src/context/ThemeContext.jsx
@@ -0,0 +1,30 @@
+import React, { createContext, useContext, useState, useEffect } from 'react';
+
+const ThemeContext = createContext();
+
+export const ThemeProvider = ({ children }) => {
+ const [darkMode, setDarkMode] = useState(() => {
+ if (typeof window !== 'undefined') {
+ return localStorage.getItem('theme') === 'dark' ||
+ (!localStorage.getItem('theme') && window.matchMedia('(prefers-color-scheme: dark)').matches);
+ }
+ return false;
+ });
+
+ useEffect(() => {
+ const root = window.document.documentElement;
+ root.classList.remove(darkMode ? 'light' : 'dark');
+ root.classList.add(darkMode ? 'dark' : 'light');
+ localStorage.setItem('theme', darkMode ? 'dark' : 'light');
+ }, [darkMode]);
+
+ const toggleTheme = () => setDarkMode(!darkMode);
+
+ return (
+
+ {children}
+
+ );
+};
+
+export const useTheme = () => useContext(ThemeContext);
diff --git a/src/index.css b/src/index.css
new file mode 100644
index 000000000..3d536b7f3
--- /dev/null
+++ b/src/index.css
@@ -0,0 +1,18 @@
+/* This is the import from your Step 4 */
+@import "tailwindcss";
+
+/* This is the NEW v4 way to enable class-based dark mode.
+ It REPLACES the old "darkMode: 'class'" in your config file.
+*/
+@custom-variant dark (&:where(.dark, .dark *));
+
+
+/* OPTIONAL BUT RECOMMENDED:
+ You can add default base styles here for your app,
+ so the automatically responds to the theme.
+*/
+@layer base {
+ body {
+ @apply bg-white text-gray-900 transition-colors duration-300 ease-in-out dark:bg-gray-900 dark:text-gray-100;
+ }
+}
diff --git a/src/main.jsx b/src/main.jsx
new file mode 100644
index 000000000..b9a1a6dea
--- /dev/null
+++ b/src/main.jsx
@@ -0,0 +1,10 @@
+import { StrictMode } from 'react'
+import { createRoot } from 'react-dom/client'
+import './index.css'
+import App from './App.jsx'
+
+createRoot(document.getElementById('root')).render(
+
+
+ ,
+)
diff --git a/src/pages/Home.jsx b/src/pages/Home.jsx
new file mode 100644
index 000000000..6f7b146fc
--- /dev/null
+++ b/src/pages/Home.jsx
@@ -0,0 +1,58 @@
+// Home.jsx
+import React from 'react';
+import { Link } from 'react-router-dom';
+
+const Home = () => {
+ return (
+
+ {/* Hero Section */}
+
+
+
+ Welcome to Your Task Manager
+
+
+ Organize, track, and manage your tasks efficiently with our powerful task management system.
+
+
+ Go to Tasks
+
+
+
+
+ {/* Features Section */}
+
+
+
+
Easy Task Management
+
Create, organize, and track your tasks with our intuitive interface.
+
+
+
Time Tracking
+
Set start and end times for your tasks to manage your schedule effectively.
+
+
+
Progress Monitoring
+
Track your task completion and monitor your productivity over time.
+
+
+
+
+ {/* Call to Action */}
+
+
Ready to get started?
+
+ Start Managing Tasks
+
+
+
+ );
+};
+
+export default Home;
diff --git a/src/pages/Posts.jsx b/src/pages/Posts.jsx
new file mode 100644
index 000000000..4cb1654dc
--- /dev/null
+++ b/src/pages/Posts.jsx
@@ -0,0 +1,115 @@
+import React, { useState, useEffect } from 'react';
+import { fetchPosts, searchPosts } from '../api/fetchposts';
+
+const Posts = () => {
+ const [posts, setPosts] = useState([]);
+ const [loading, setLoading] = useState(true);
+ const [error, setError] = useState(null);
+ const [page, setPage] = useState(1);
+ const [totalPages, setTotalPages] = useState(0);
+ const [searchQuery, setSearchQuery] = useState('');
+
+ const loadPosts = async () => {
+ try {
+ setLoading(true);
+ const { data, totalCount } = await fetchPosts(page);
+ setPosts(data);
+ setTotalPages(Math.ceil(totalCount / 10));
+ setError(null);
+ } catch (err) {
+ setError(err.message);
+ } finally {
+ setLoading(false);
+ }
+ };
+
+ const handleSearch = async (e) => {
+ e.preventDefault();
+ if (!searchQuery.trim()) {
+ loadPosts();
+ return;
+ }
+ try {
+ setLoading(true);
+ const results = await searchPosts(searchQuery);
+ setPosts(results);
+ setError(null);
+ } catch (err) {
+ setError(err.message);
+ } finally {
+ setLoading(false);
+ }
+ };
+
+ useEffect(() => {
+ loadPosts();
+ }, [page]);
+
+ return (
+
+
+
+
+
+
+ {loading ? (
+
+ ) : error ? (
+
{error}
+ ) : (
+ <>
+
+ {posts.map((post) => (
+
+
{post.title}
+
{post.body}
+
+ ))}
+
+
+
+
+
+ Page {page} of {totalPages}
+
+
+
+ >
+ )}
+
+
+ );
+};
+
+export default Posts;
diff --git a/src/pages/Tasks.jsx b/src/pages/Tasks.jsx
new file mode 100644
index 000000000..000e3fc9f
--- /dev/null
+++ b/src/pages/Tasks.jsx
@@ -0,0 +1,12 @@
+import React from 'react';
+import TaskManager from '../components/TaskManager';
+
+const Tasks = () => {
+ return (
+
+
+
+ );
+};
+
+export default Tasks;
diff --git a/src/uselocalStorage.js b/src/uselocalStorage.js
new file mode 100644
index 000000000..e69de29bb
diff --git a/vite.config.js b/vite.config.js
new file mode 100644
index 000000000..5a6fd08be
--- /dev/null
+++ b/vite.config.js
@@ -0,0 +1,11 @@
+import { defineConfig } from 'vite'
+import react from '@vitejs/plugin-react'
+import tailwindcss from '@tailwindcss/vite'
+
+
+// https://vite.dev/config/
+export default defineConfig({
+ plugins: [react(),
+ tailwindcss()
+ ],
+})