Key Concepts:
- Jira Clone: A project to replicate the functionality of Jira, a popular project management tool.
- Workspaces: Top-level containers for projects.
- Projects: Containers for tasks, associated with a specific workspace.
- Tasks: Individual units of work, assigned to members, with due dates, statuses, and positions.
- Hono: A lightweight web framework used for creating API endpoints.
- Appwrite: A backend-as-a-service platform used for database, storage, and authentication.
- Zod: A TypeScript-first schema declaration and validation library.
- React Big Calendar: A component for displaying events in a calendar format.
- Hello-Pangia DND: A drag-and-drop library (fork of react-beautiful-dnd).
- TanStack React Table: A headless UI for building powerful tables.
- Lucid React: A library of icons.
- Shadcn UI: A collection of accessible and reusable components.
- Vercel: A platform for deploying web applications.
- Oauth: An open standard for access delegation, commonly used for third-party authentication.
1. Implementing the Projects Entity:
- Database Setup:
- A new collection named "projects" is created in Appwrite.
- Attributes are defined:
workspaceID(string, required, size 50),imageURL(string, size 1,400,000, not required), andname(string, required, size 256). - Permissions are set to allow all users to create, read, update, and delete projects.
- Environment Variables:
- The project collection ID is added to
environment.local.
- The project collection ID is added to
- Configuration:
- A shorthand for the project ID is added to the
configfile.
- A shorthand for the project ID is added to the
- API Endpoint:
- A new feature folder "projects" is created with a server route (
route.ts). - A Hono app instance is created and exported.
- The project route is chained to the main API route (
/api/projects).
- A new feature folder "projects" is created with a server route (
- Get Projects Route:
- A
GETroute is created to retrieve all projects associated with a workspace. - It uses session middleware and Zod validation to ensure a valid
workspaceIDis provided as a query parameter. - The route checks if the user is a member of the workspace using
getMemberutility. - If the user is authorized, it retrieves projects from the database using
databases.listDocuments, filtering byworkspaceIDand ordering by creation date. - The retrieved projects are returned as a JSON response.
- A
- UI Integration:
- A
Projectscomponent is created to display the projects in the sidebar. - The component uses the
useGetProjectshook to fetch the projects. - The component iterates over the projects and renders them as links.
- The component uses
usePathnamefromnext/navigationto determine the active project.
- A
2. Creating Projects:
- Schema Definition:
- A Zod schema (
createProjectSchema) is created to validate the project creation form data. - The schema includes
name(string, required),image(file, optional), andworkspaceID(string, required).
- A Zod schema (
- Post Route:
- A
POSTroute is created to handle project creation. - It uses session middleware and Zod validation to validate the form data.
- The route checks if the user is a member of the workspace.
- It uploads the image to the Appwrite storage bucket.
- It creates a new project in the database using
databases.createDocument. - The newly created project is returned as a JSON response.
- A
- Use Create Project Hook:
- A
useCreateProjecthook is created to handle the API call for project creation. - The hook uses
client.api.projects.postto send the form data to the API endpoint. - The hook invalidates the
projectsquery to refresh the project list after successful creation.
- A
- Model and Form:
- A
useCreateProjectModelhook is created to manage the state of the project creation modal. - A
CreateProjectFormcomponent is created to render the project creation form. - A
CreateProjectModelcomponent is created to render the project creation modal. - The
CreateProjectModelis added to theDashboardLayout. - The
Projectscomponent in the sidebar is updated to open theCreateProjectModelwhen the "+" icon is clicked.
- A
3. Building the Individual Project ID Page:
- Page Creation:
- A new page is created at
app/dashboard/[workspaceID]/projects/[projectID]/page.tsx. - The page uses
getCurrentto authenticate the user and redirects to/signinif not authenticated. - The page extracts the
projectIDfrom the route parameters.
- A new page is created at
- Data Fetching:
- A
getProjectquery is created to fetch the project data from the database. - The query checks if the user is a member of the workspace associated with the project.
- The query returns the project data if the user is authorized.
- A
- UI Implementation:
- The page uses
getProjectto fetch the project data and displays it in a UI. - The UI includes the project name, image, and an "Edit Project" button.
- The page uses
- Error Handling:
- A global error handler is implemented to catch errors and display an error page.
- A global loading indicator is implemented to display a loading animation while data is being fetched.
4. Implementing the Edit Project Functionality:
- Schema Definition:
- An
updateProjectSchemais created to validate the project update form data. - The schema is similar to
createProjectSchemabut with optional fields.
- An
- Patch Route:
- A
PATCHroute is created to handle project updates. - The route uses session middleware and Zod validation to validate the form data.
- The route checks if the user is a member of the workspace associated with the project.
- It updates the project in the database using
databases.updateDocument. - The updated project is returned as a JSON response.
- A
- Use Update Project Hook:
- A
useUpdateProjecthook is created to handle the API call for project updates. - The hook uses
client.api.projects.patchto send the form data to the API endpoint. - The hook invalidates the
projectsquery and the individual project query to refresh the UI after successful update.
- A
- Edit Project Form:
- An
EditProjectFormcomponent is created to render the project update form. - The component uses the
useUpdateProjecthook to handle the API call. - The component includes fields for the project name and image.
- An
- Settings Page:
- A new page is created at
app/standalone/[workspaceID]/projects/[projectID]/settings/page.tsx. - The page uses
getCurrentto authenticate the user and redirects to/signinif not authenticated. - The page uses
getProjectto fetch the project data and displays theEditProjectForm.
- A new page is created at
5. Implementing the Delete Project Functionality:
- Delete Route:
- A
DELETEroute is created to handle project deletion. - The route uses session middleware and extracts the
projectIDfrom the route parameters. - The route checks if the user is a member of the workspace associated with the project.
- It deletes the project from the database using
databases.deleteDocument. - The ID of the deleted project is returned as a JSON response.
- A
- Use Delete Project Hook:
- A
useDeleteProjecthook is created to handle the API call for project deletion. - The hook uses
client.api.projects.deleteto send the request to the API endpoint. - The hook invalidates the
projectsquery to refresh the project list after successful deletion.
- A
- Confirmation Model:
- A confirmation model is added to the
EditProjectFormto confirm the project deletion. - The
useConfirmhook is used to manage the state of the confirmation model.
- A confirmation model is added to the
6. Building the Task View Switcher Component:
- Component Creation:
- A
TaskViewSwitchercomponent is created to switch between different views of tasks (table, Kanban, calendar). - The component uses tabs from Shadcn UI to switch between the views.
- The component includes a "New Task" button to open the task creation modal.
- A
- Data Fetching:
- The component uses the
useGetTaskshook to fetch the tasks.
- The component uses the
- UI Implementation:
- The component renders the tabs for table, Kanban, and calendar views.
- The component renders the "New Task" button.
- The component renders dotted separators and placeholders for data filters.
- Database Setup:
- A new collection named "tasks" is created in Appwrite.
- Attributes are defined:
workspaceID(string, required, size 50),name(string, required, size 256),projectID(string, required, size 50),assignID(string, required, size 50),description(string, not required, size 248),dueDate(datetime, required),status(enum, required), andposition(integer, required).
- Task Status Enum:
- A
TaskStatusenum is created to define the possible statuses of a task (backlog, to-do, in progress, in review, done).
- A
7. Implementing the Task Creation Functionality:
- Schema Definition:
- A
createTaskSchemais created to validate the task creation form data. - The schema includes
name(string, required),status(enum, required),workspaceID(string, required),projectID(string, required),dueDate(datetime, required),assignID(string, required), anddescription(string, optional).
- A
- Post Route:
- A
POSTroute is created to handle task creation. - The route uses session middleware and Zod validation to validate the form data.
- The route checks if the user is a member of the workspace.
- The route calculates the new position for the task based on the highest position task in the same status.
- It creates a new task in the database using
databases.createDocument. - The newly created task is returned as a JSON response.
- A
- Get Route:
- A
GETroute is created to retrieve tasks based on various filters (workspaceID, projectID, status, search, assignID, dueDate). - The route uses session middleware and Zod validation to validate the query parameters.
- The route checks if the user is a member of the workspace.
- The route constructs a query based on the provided filters.
- The route retrieves tasks from the database using
databases.listDocuments. - The route populates the project and assign information for each task.
- The retrieved tasks are returned as a JSON response.
- A
- Use Create Task Hook:
- A
useCreateTaskhook is created to handle the API call for task creation. - The hook uses
client.api.tasks.postto send the form data to the API endpoint. - The hook invalidates the
tasksquery to refresh the task list after successful creation.
- A
- Model and Form:
- A
useCreateTaskModelhook is created to manage the state of the task creation modal. - A
CreateTaskFormcomponent is created to render the task creation form. - A
CreateTaskModelcomponent is created to render the task creation modal. - The
CreateTaskModelis added to theDashboardLayout. - The
TaskViewSwitchercomponent is updated to open theCreateTaskModelwhen the "New Task" button is clicked.
- A
8. Implementing Task Filters:
- Use Task Filters Hook:
- A
useTaskFiltershook is created to manage the state of the task filters. - The hook uses
useQueryStatesfromknto persist the filter values in the URL.
- A
- Data Filters Component:
- A
DataFilterscomponent is created to render the task filters. - The component includes select components for status, assignID, and projectID.
- The component includes a date picker for dueDate.
- The component uses the
useTaskFiltershook to manage the filter values. - The component passes the filter values to the
useGetTaskshook.
- A
9. Implementing the Data Table Component:
- Installation:
- The
10stack/react-tablepackage is installed.
- The
- Columns Definition:
- A
columns.tsxfile is created to define the columns for the data table. - The columns include name, project, assign, dueDate, and status.
- A
- Data Table Component:
- A
DataTablecomponent is created to render the data table. - The component uses the
useReactTablehook from10stack/react-tableto manage the table state. - The component includes pagination, sorting, and filtering.
- A
- UI Enhancements:
- The column headers are made sortable.
- The dueDate column is formatted using the
TaskDatecomponent. - The status column is displayed using the
Badgecomponent. - An actions column is added to allow deleting tasks.
10. Implementing the Kanban View:
- Installation:
- The
hello-pangea/dndpackage is installed.
- The
- Data Kanban Component:
- A
DataKanbancomponent is created to render the Kanban board. - The component uses the
DragDropContext,Droppable, andDraggablecomponents fromhello-pangea/dndto implement the drag-and-drop functionality. - The component uses the
useCallbackanduseStatehooks to manage the state of the tasks.
- A
- Kanban Column Header Component:
- A
KanbanColumnHeadercomponent is created to render the header for each Kanban column. - The component displays the status and the number of tasks in the column.
- A
- Kanban Card Component:
- A
KanbanCardcomponent is created to render each task card in the Kanban board. - The component displays the task name, project, assign, and due date.
- A
- Drag and Drop Logic:
- The
onDragEndmethod is implemented to handle the drag-and-drop events. - The method updates the task status and position in the database.
- The
11. Implementing the Calendar View:
- Installation:
- The
react-big-calendarpackage is installed.
- The
- Data Calendar Component:
- A
DataCalendarcomponent is created to render the calendar view. - The component uses the
Calendarcomponent fromreact-big-calendarto display the calendar. - The component uses the
dateFnsLocalizerto format the dates.
- A
- Custom Styling:
- Custom CSS styles are added to the
data-calendar.cssfile to style the calendar.
- Custom CSS styles are added to the
- Event Card Component:
- An
EventCardcomponent is created to render the events in the calendar. - The component displays the task title, assign, and project.
- An
- Toolbar Component:
- A custom toolbar component is created to navigate between months.
12. Implementing the My Tasks Page:
- Page Creation:
- A new page is created at
app/dashboard/[workspaceID]/tasks/page.tsx. - The page uses
getCurrentto authenticate the user and redirects to/signinif not authenticated. - The page renders the
TaskViewSwitchercomponent.
- A new page is created at
13. Implementing the Task Details Page:
- Page Creation:
- A new page is created at
app/dashboard/[workspaceID]/tasks/[taskID]/page.tsx. - The page uses
getCurrentto authenticate the user and redirects to/signinif not authenticated.
- A new page is created at
- Client Component:
- A
client.tsxfile is created to render the client-side components. - The client component uses the
useGetTaskhook to fetch the task data. - The client component renders the task breadcrumbs, overview, and description.
- A
- Task Breadcrumbs Component:
- A
TaskBreadcrumbscomponent is created to display the breadcrumbs for the task.
- A
- Task Overview Component:
- A
TaskOverviewcomponent is created to display the overview of the task.
- A
- Task Description Component:
- A
TaskDescriptioncomponent is created to display and edit the task description.
- A
14. Implementing Analytics:
- API Endpoint:
- A new API endpoint is created to fetch analytics data for a project.
- The endpoint calculates the total tasks, assigned tasks, completed tasks, incomplete tasks, and overdue tasks for the current month and the previous month.
- Use Get Project Analytics Hook:
- A
useGetProjectAnalyticshook is created to handle the API call for fetching analytics data.
- A
- Analytics Component:
- An
Analyticscomponent is created to display the analytics data. - The component uses the
AnalyticsCardcomponent to display each metric.
- An
15. Implementing Oauth Logins:
- GitHub Oauth:
- A GitHub Oauth app is created.
- The client ID and secret are added to the Appwrite console.
- The
oou.tsfile is created to handle the Oauth logic. - The
oou/route.tsfile is created to handle the Oauth callback. - The "Login with GitHub" button is added to the sign-in card.
- Google Oauth:
- A Google Cloud project is created.
- Oauth credentials are created in the Google Cloud console.
- The client ID and secret are added to the Appwrite console.
- The "Login with Google" button is added to the sign-in card.
16. Deployment:
- The project is pushed to GitHub.
- A new project is created in Vercel.
- The environment variables are added to Vercel.
- The project is deployed to Vercel.
17. Bug Fixes and Refactoring:
- The task view switcher is updated to filter tasks by project ID.
- The navigation bar is updated to display the correct title and description.
- The server components are refactored to use client-side data fetching with React Query.
- The router refresh calls are removed from the update and delete hooks.
- The analytics invalidation is improved to ensure that the analytics data is always up-to-date.
Synthesis/Conclusion:
The YouTube video transcript details the comprehensive development of a Jira clone application using modern web technologies. It covers everything from database setup and API endpoint creation to UI implementation, drag-and-drop functionality, and deployment. The transcript emphasizes best practices, such as using Zod for validation, React Query for data fetching, and Shadcn UI for accessible components. It also provides detailed instructions for implementing Oauth logins and deploying the application to Vercel. The final steps involve refactoring the code to improve performance and maintainability. The project serves as a valuable learning resource for developers interested in building full-stack web applications with a focus on project management.
AI summaries can miss context or contain errors. Check important details against the original video.





