DoctorDerek / phonebook-app

πŸƒ Phonebook App - Next.js 13 + React 18 + Tailwind CSS + XState + CRUD Operations πŸ‘€ View Production Build at https://phonebook-doctorderek.vercel.app/ This is a simple phonebook app that supports CRUD operations (create, read, update, delete). The app provides a form where you can enter in first name, last name, and phone number for each contact

Home Page:https://phonebook-doctorderek.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vercel Build Status

☎️ Phonebook App - Next.js 13 + React 18 + Tailwind CSS + XState + CRUD Operations

πŸ‘€ View Production Build at https://phonebook-doctorderek.vercel.app/

This is a simple phonebook app that supports CRUD operations (create, read, update, delete).

The app provides a form where you can enter a name and phone number for each phonebook entry.

Below you will find the complete feature set, a discussion section, and my technical journal.

Required Technologies

  1. βœ… TypeScript
  2. βœ… React
  3. βœ… React Context
  4. ❌ React Query
    • βœ… XState state machines used instead
  5. ❌ Material UI
    • βœ… Tailwind CSS used instead
  6. ❌ Apollo GraphQL
    • βœ… XState with TypeScript used instead
  7. ❌ Database of your choice
    • βœ… localStorage used instead
  8. ❌ Docker Compose
    • βœ… Next.js + Vercel used instead

Feature List

βœ… === DONE

🌠 === TODO

  1. βœ… Used Next.js version 13.0.0 with React 18.2.0 and Tailwind CSS 3.2.1.
  2. βœ… Deployed production build of Next.js to Vercel with CI/CD.
  3. βœ… Established engineering best practices:
    • Prettier, ESLint, Husky (Git Hooks), tsconfig.json, TypeScript Import Sorter, XState
  4. βœ… Implemented XState finite state machine to handle application state.
  5. βœ… Matched design document with READ and search by last name functionality.
  6. βœ… Built accessible dialog (modal) using Headless UI and Tailwind CSS.
  7. βœ… Added various tooltips that appear on hover to improve user experience.
  8. βœ… Enabled CREATE, UPDATE, DELETE, and RESET actions using React Hook Form.
  9. βœ… Sorted data by last name for a consistent user experience in the app.
  10. 🌠 Add unit test coverage for entire app with Jest & React Testing Library.

Discussion Section

  1. XState takes the place of React Query in the app. The benefit of XState is the finite set of states, without additional testing.
  2. It would be easy to connect any database without affecting the frontend by simplying replacing the localStorage calls in XState.
  3. The app isn't particularly well-suited to GraphQL given the CRUD model, simplistic data objects, and extremely small data size.
  4. We don't handle phone validation at all, but we would probably want some type of validation in production, as long as it's reliable.
  5. The entire codebase could use extensive refactoring, since everything is simply built in the homepage (@/pages/index.tsx).
  6. The app is difficult to test with React Testing Library without refactoring, because everything is closely coupled with XState.
  7. Docker is unnecessary for this project, and I find it almost always reduces the performance of Next.js vs. deploying at Vercel.
  8. Material UI has some benefits, but it can be hard to customize unless the designer uses it, while Tailwind is very easy to use.
  9. Like with many projects, the design document left out certain features: RESET, dialogs (modals), hover styles, and animations.
  10. Because of the combination of localStorage with XState, we have auto-save functionality that supports refreshing the page.

Technical Journal

  • 0.1.1 New app: create next-app w/TypeScript + Yarn 3
  • 0.2.0 Added all best practices & basic dependencies
  • 0.3.0 Create XState finite state machine for app
  • 0.4.0 Add initial (default) values and RESET action
  • 0.5.0 Implement design of app from design document
  • 0.6.0 Build out the search filter and DELETE action
  • 0.7.0 Make the dialog (modal) to handle CRUD actions
  • 0.8.0 Use React Hook Form to handle dialog actions
  • 0.9.0 Enable CREATE, UPDATE, DELETE, RESET actions
  • 0.9.1 Finish the discussion section in the README.md
  • 1.0.0 Upload photos and migrate to Next 13's @/app

About

πŸƒ Phonebook App - Next.js 13 + React 18 + Tailwind CSS + XState + CRUD Operations πŸ‘€ View Production Build at https://phonebook-doctorderek.vercel.app/ This is a simple phonebook app that supports CRUD operations (create, read, update, delete). The app provides a form where you can enter in first name, last name, and phone number for each contact

https://phonebook-doctorderek.vercel.app


Languages

Language:TypeScript 88.6%Language:JavaScript 9.6%Language:CSS 1.6%Language:Shell 0.2%