đ Introduction
I recently built MailBox, a Gmail-like email client using React and the Gmail API.
I created this project to understand how a React application can communicate with a real Google API and authenticate users using Google OAuth.
The application is now connected to my real Gmail account, so I can send and receive actual emails.
⨠Features
The current version supports:
- đ Google OAuth authentication
- đĨ Real Gmail inbox
- đ¤ Send emails through Gmail
- đ§ Receive and read emails
- â Star / unstar emails
- â Mark emails as read
- đī¸ Move emails to Trash
- đ Gmail-style interface
- đą Responsive UI
- âī¸ Hosted using GitHub Pages
đ ī¸ Technologies Used
- React
- JavaScript
- Vite
- Gmail API
- Google OAuth
- GitHub
- GitHub Pages
đ Google OAuth Integration
The application uses Google OAuth to allow the user to connect their Gmail account.
After authentication, the application obtains an access token and uses the Gmail API to perform operations such as:
- Reading emails
- Sending emails
- Updating email status
- Starring emails
- Moving emails to Trash
The OAuth Client Secret is never included in the frontend code or GitHub repository.
đŦ Gmail API
The application communicates directly with the Gmail API.
Some of the operations implemented include:
- Fetching inbox messages
- Getting email metadata
- Opening individual messages
- Marking messages as read
- Adding/removing stars
- Sending emails
- Moving messages to Trash
This was a great learning experience because I was able to move from a simple Gmail-style UI to an application that actually communicates with Gmail.
đ¨ User Interface
I designed the interface to resemble a modern email application.
It includes:
- Sidebar navigation
- Inbox
- Starred
- Sent
- Drafts
- Trash
- Search
- Compose
- Account information
- Responsive layout
đ Live Demo
đ Try MailBox:
https://thavuth772-alt.github.io/gmail-like-react-app/
đģ Source Code
đ GitHub Repository:
https://github.com/thavuth772-alt/gmail-like-react-app
đ¸ What I Learned
Through this project, I learned how to:
- Build a React application with Vite
- Work with REST APIs
- Integrate Google OAuth
- Use the Gmail API
- Handle access tokens
- Send emails using the Gmail API
- Work with asynchronous API requests
- Deploy a React application using GitHub Pages
- Understand the difference between a frontend-only demo and a real API-integrated application
đŽ Future Improvements
I plan to add more Gmail functionality, including:
- đ Advanced Gmail search
- âŠī¸ Reply and Forward
- đ Email attachments
- đˇī¸ Gmail labels
- đ Better unread notification handling
- đ Better Sent and Trash synchronization
- đ Improved dark mode
- đą Further mobile improvements
đŦ Feedback
I'm continuing to improve this project.
I'd really appreciate feedback from other developers:
What feature would you add next?
What could I improve in the UI or functionality?
Thanks for reading! đ

Top comments (0)