MailBox is an email client web application built using JavaScript, Django, HTML, CSS, and Bootstrap. Users can send, receive, reply to, and archive emails. The app interacts with a Django back-end to perform API calls, allowing users to manage their emails. Emails are stored in a PostgreSQL database.
The goal of this project is to create a user-friendly email client interface that interacts with a Django back-end. This interface enables users to send and receive emails, which are stored in a database on the server. Users can also archive and mark emails as read or unread.
To learn more about the project, refer to the assignment description on CS50's OpenCourseWare.
- Python
- Django
- HTML
- JavaScript
- CSS
- Bootstrap
- PostgreSQL
- GET
/emails/<mailbox>
- Retrieves a list of emails from the specified mailbox.
- Available mailboxes:
inbox
,sent
, andarchive
. - Response: JSON list of email objects.
- GET
/emails/<email_id>
- Retrieves a single email by its unique ID.
- Response: JSON representation of the email object.
- POST
/emails
- Sends an email to the server.
- Request body: JSON object containing recipients, subject, and body.
- Response: JSON message indicating success or error.
- PUT
/emails/<email_id>
- Modifies an email's archived or read status.
- Request body: JSON object with
archived
orread
keys. - Values:
true
for archive/read,false
for unarchive/unread.
To run the application locally:
- Install requirements (Django):
pip install -r requirements.txt
- Apply migrations:
python manage.py makemigrations mail
andpython manage.py migrate
- Run the app:
python manage.py runserver
- Create separate accounts/logins to send emails between them.