Quill-ToDo / Quill-Todo

Quill To-Do
MIT License
2 stars 0 forks source link

Make FE Calendar Component #88

Open lilyosah opened 1 year ago

lilyosah commented 1 year ago

I'm tired of Fullcalendar and think we should just make our own calendar that's easier to maintain and more flexible.

lilyosah commented 11 months ago

Designing a task app with a calendar portion involves managing time-sensitive data effectively. Here's a general guideline on how you can approach this:

Data Structure and Objects:

  1. Task Object: Create a task object that includes properties like task name, description, priority, status, start time, end time, reminders, etc.

  2. Calendar Event Object: For the calendar portion, you might want to create a separate object to represent calendar events. This object could have properties like title, start time, end time, color, recurrence rules, etc.

  3. User Object: If your app supports user accounts, you'll likely need a user object to associate tasks and events with specific users.

Timeline Management:

  1. Frontend Timeline Component: In your React app, create a timeline component that displays tasks and events chronologically. You can use libraries like react-calendar-timeline or build a custom component using CSS and JavaScript.

  2. Sorting and Grouping: Group tasks and events by day, week, or month, and sort them by start time. This makes it easier for users to view and manage their tasks in the calendar.

  3. Drag-and-Drop: Implement drag-and-drop functionality so users can move tasks or events around on the timeline to update their start and end times.

Storing Data:

  1. Client-Side Storage: For a smoother user experience, you can store task and event data locally in the client browser using technologies like localStorage or sessionStorage. This approach can reduce the need for constant server requests for data retrieval. However, keep in mind that local storage has limitations on data size (typically around 5-10MB).

  2. Server-Side Database: For more robust data management, especially if your app involves user accounts or needs to sync across devices, you should store task and event data in a server-side database. Consider using technologies like MongoDB, PostgreSQL, or Firebase Firestore. This approach allows data persistence and synchronization between different clients.

  3. Data Synchronization: If you choose to store data in a server-side database, implement data synchronization mechanisms to ensure that changes made on one client (e.g., adding or updating a task) are reflected on other clients and devices.

React App Architecture:

  1. Components: Organize your React app into reusable components. You might have components for the task list, calendar view, timeline, task creation/editing forms, and user authentication.

  2. State Management: Use a state management library like Redux or the Context API to manage the application's state, especially if you need to share data between different components.

  3. API Integration: If you're using a server-side database, integrate your app with a backend API to handle data retrieval, creation, updating, and deletion.

Remember that the decision to store data locally or on the server depends on factors like data size, user accounts, synchronization needs, and overall user experience. Combining both approaches is also possible, where you store data locally for immediate access and sync with the server periodically for backup and cross-device consistency.