Skip to content

Front-end for an email client that makes API calls to send and receive emails

Notifications You must be signed in to change notification settings

alexandrabaturina/mail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project 3: Mail

Overview

The current repo contains project called mail which is a front-end for an email client that makes API calls to send and receive emails.

This project is built as Project 3 for CS50W 2020 course provided by edX platform.

Features

The project meets the following requirements.

  • Send Mail

    • When a user submits the email composition form, the email is sent (this option is built with JavaScript).
    • A POST request is made to /emails, passing in values for recipients, subject, and body.
    • Once the email has been sent, the user’s Sent mailbox is loaded.
  • Mailbox

    • When a user visits their Inbox, Sent mailbox, or Archive, the appropriate mailbox is loaded.
    • A GET request to /emails/<mailbox> is made to request the emails for a particular mailbox.
    • When a mailbox is visited, the application first queris the API for the latest emails in that mailbox.
    • When a mailbox is visited, the name of the mailbox appears at the top of the page (this part is done in starter code).
    • Each email is rendered in its own box that displays who the email is from, what the subject line is, and the timestamp of the email.
    • If the email is unread, it appears with a white background. If the email has been read, it appears with a gray background.

image

  • View Email

    • When a user clicks on an email, they are taken to a view where they see the content of that email.
    • A GET request is made to /emails/<email_id> to request the email.
    • The application shows the email’s sender, recipients, subject, timestamp, and body.
    • Once the email has been clicked on, it is marked as read. A PUT request is made to /emails/<email_id> to update whether an email is read or not.

image

  • Archive/Unarchive

    • Users are allowed to archive and unarchive emails that they have received.
    • When viewing an Inbox email, the user is presented with a button that lets them archive the email. When viewing an Archive email, the user should is with a button that lets them unarchive the email. This requirement does not apply to emails in the Sent mailbox.
    • A PUT request is made to /emails/<email_id> to mark an email as archived or unarchived.
    • Once an email has been archived or unarchived, the user’s Inbox is loaded.

image

  • Reply

    • Users are allowed to reply to an email.
    • When viewing an email, the user are presented with a “Reply” button that lets them reply to the email.
    • When the user clicks the “Reply” button, they are taken to the email composition form.
    • The composition form is pre-filled with the recipient field set to whoever sent the original email.
    • The subject line is pre-filled. If the original email had a subject line of foo, the new subject line should be Re: foo. (If the subject line already begins with Re: , no need to add it again.)
    • The body of the email is pre-filled with a line like "On Jan 1 2020, 12:00 AM [email protected] wrote:" followed by the original text of the email.

image

Dependencies

The app is built using Django framework. To install Django via terminal, use the following command.

$ pip3 install Django

Getting Started

Running Locally

To run mail locally,

  1. Clone this repo.
  2. cd into project directory.
  3. Start the Django web server.
$ python manage.py runserver
  1. Access 127.0.0.1:8000 in your browser.

Resetting a Database

The repo contains test database. To reset database,

  1. Delete db.sqlite3 file.
  2. Run the following command.
$ python manage.py flush

Authors

Alexandra Baturina

About

Front-end for an email client that makes API calls to send and receive emails

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published