βοΈ Phonebook "Filter by Age" App - Next.js 13 + React 18 + Tailwind CSS + XState + CRUD Operations
π View Production Build at https://phonebook-filter-by-age.vercel.app/
This is a simple phonebook app that supports CRUD operations (create, read, update, delete) and "filter by age" functionality.
The app provides a form where you can enter a name, birthday, mailing address,phone number, and email for each phonebook entry.
Below you will find the complete feature set, a discussion section, and my technical journal.
- β Next.js 13
- β React 18
- β Tailwind CSS
- β TypeScript
- β XState finite state machines
- β
localStorage
used as database - β Vercel for deployment
- β TravisCI for CI/CD
- β Jest + React Testing Library
- β ESLint + Prettier + Husky Git Hooks
- β Used Next.js version 13.0.3 with React 18.2.0 and Tailwind CSS 3.2.4.
- β Deployed Next.js production build to Vercel with CI/CD at Travis CI.
- β
Established engineering best practices:
- Prettier, ESLint, Husky (Git Hooks),
tsconfig.json
, TypeScript Import Sorter, XState
- Prettier, ESLint, Husky (Git Hooks),
- β Implemented XState finite state machine to handle application state.
- β Built accessible dialog (modal) using Headless UI and Tailwind CSS.
- β Added various tooltips that appear on hover to improve user experience.
- β Enabled CREATE, UPDATE, DELETE, and RESET actions using React Hook Form.
- β Sorted data by last name for a consistent user experience in the app.
- β Matched design document with READ and filter by age range functionality.
- β Add some unit testing for the app with Jest & React Testing Library.
- β We use XState finite state machines. The benefit of XState is the finite set of states, without the need for additional testing.
- β
It would be easy to connect any database without affecting the frontend by simplying replacing the
localStorage
calls in XState. - β We don't handle phone or email validation at all, but we would probably want some type of reliable validation in production.
- β The entire codebase could use more testing, which is made easier by the large number of small, easily-testable components.
- β Like with many projects, the design document left out certain features: RESET, dialogs (modals), hover styles, and animations.
- β
Because of the combination of
localStorage
with XState, we have auto-save functionality that supports refreshing the page. - β Since the only major touch screen interaction difference is swiping, we shouldn't have much differences with desktop vs. mobile.
- β Accessibility has been baked into the app, but we might find some issues when writing tests or using the app with the keyboard.
- β I implemented 3 breakpoints: phone portrait (<640px), tablet or phone landscape (>=640px <1280px), and desktop (>1280px).
- β There are numerous improvements that could still be made to the user experience, such as a hover effect to show the contact's age.
Launches the test runner and generates code coverage report.
Launches the test runner in the interactive watch mode.
- π½ https://github.com/DoctorDerek/phonebook-app
0.1.1
New app: create next-app w/TypeScript + Yarn 30.2.0
Added all best practices & basic dependencies0.3.0
Create XState finite state machine for app0.4.0
Add initial (default) values and RESET action0.5.0
Implement design of app from design document0.6.0
Build out the search filter and DELETE action0.7.0
Make the dialog (modal) to handle CRUD actions0.8.0
Use React Hook Form to handle dialog actions0.9.0
Enable CREATE, UPDATE, DELETE, RESET actions0.9.1
Finish the discussion section in theREADME.md
1.0.0
Upload photos and migrate to Next 13's@/app
- π½ https://github.com/DoctorDerek/phonebook-filter-by-age
1.1.0
Refactor 15 components & fix photo deletion bug1.2.0
Extract<ContactCard>
components and TDD test1.3.0
Match<ContactCard>
to design & pass tests1.4.0
Implement accessible mobile navigation menu1.5.0
Align the mobile design with design document1.6.0
Enact the "filter by age" logic and dropdown1.7.0
Fix the CREATE & UPDATE actions with new fields1.8.0
Invent a 2-column design for tablet screens