A full-stack address book application built with React, Apollo Client, GraphQL, and MongoDB.
- Complete contact management system
- Search contacts by name or phone number
- Mark contacts as favorites and filter by favorites
- User authentication and personalized contacts list
- Edit contact information with in-place editing
- GraphQL API with efficient data fetching
- React (Vite)
- Apollo Client for GraphQL queries
- Zustand for state management
- React Router for navigation
- Custom CSS with animations and responsive design
- Node.js
- Apollo Server
- GraphQL
- MongoDB with Mongoose
- JWT Authentication
- Node.js (v14+)
- MongoDB installation or MongoDB Atlas account
- Clone the repository
git clone https://github.com/Yann-GitHub/graphql-phonebook.git
cd graphql-phonebook
- Install backend dependencies
cd back
npm install
- Install frontend dependencies
cd ../front
npm install
- Configure environment variables
- Create a
.env
file in theback
directory with:
- Create a
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
PORT=4000
- Start the backend server
cd back
npm start
- Start the frontend development server
cd front
npm run dev
- Open your browser and navigate to
http://localhost:5173
- Register a new account
- Log in with your credentials
- Logged-in users can add contacts to their favorites list
- View all contacts in the phonebook
- Search for contacts by name or phone number
- Filter to show only favorite contacts
- Click on a contact card to view detailed information
- Add contacts to your favorites with the toggle switch
- Edit phone numbers directly in the contact details view
graphql-phonebook/
├── back/ # Backend code
│ ├── models/ # Mongoose data models
│ ├── resolvers/ # GraphQL resolvers
│ ├── plugins/ # Apollo server plugins
│ ├── utils/ # Utility functions
│ └── server.js # Server entry point
│
└── front/ # Frontend code
├── src/
│ ├── components/ # React components
│ ├── pages/ # Page components
│ ├── queries.js # GraphQL queries
│ ├── store/ # Zustand state stores
│ ├── utils/ # Utility functions
│ ├── App.jsx # Main App component
│ └── main.jsx # Entry point
└── index.html # HTML template
- Add profile picture upload functionality
- Implement contact grouping and tagging
- Add dark mode theme
- Enable import/export of contacts
- Implement real-time updates with GraphQL subscriptions
- Implement dataloader for optimized data fetching
- Redis caching for improved performance