Code Monkey home page Code Monkey logo

epic_mail's Introduction

EPIC MAIL

Epic Mail is a web app that lets people exchange messages/information

Table of Contents

  1. About the Project

  2. Project Status

  3. Getting Started

    1. Installation
    2. Testing
  4. Project Links

  5. REST API

    1. Overview
    2. Sign up
    3. Sign in
    4. Create Email
    5. Get received Email
    6. Get sent Email
    7. Get specific Email
  6. Acknowledgment

About the project

Epic mail will aid communication between individuals or groups of people

Project Status

Build Status Coverage Status Maintainability Test Coverage

Back to top

Getting started

Installation

# Get the latest snapshot
git clone https://github.com/Tyak99/Epic_Mail myproject

# Change directory
cd myproject

# Install NPM dependencies
npm install

# Create a .env file to root folder
touch .env

# Add postgres database information
DATABASE_URL=your_database_url

# Then simply start your app
npm run dev

Running Test

# Enter project directory
cd myproject

# Add test postgres database information
TEST_DATABASE_URL=your_database_url

# Start test
npm test

Running Build

# Enter project directory
cd myproject

# Start test
npm run build

Project Links

  • Gh-Pages Url https://tyak99.github.io/Epic_Mail/Ui/Index.html
  • Api documentation https://intense-thicket-60071.herokuapp.com/docs Back to top

REST API

Api Overview

The API is generally RESTFUL and returns results in JSON.

Sign up

  • URL

    api/v1/auth/signup

  • Method:

    POST

  • Data Params
    {
        email,
        password,
        firstName,
        lastName
    }
    
  • Success Response
    • Status: 200
    • data:
    {
        token: " "
    }
    
  • Error Response
    • Status: 400
    • error: "Email already in use"
    • error: "All fields must be present"

Sign In

  • URL

    api/v1/auth/login

  • Method:

    POST

  • Data Params
    {
        email: string
        password: string
    }
    
  • Success Response
    • Status: 200
    • data:
    {
        token: " "
    }
    
  • Error Response
    • Status: 400
    • error: "Invalid email or password"

Create Email

  • URL

    api/v1/messages

  • Method:

    POST

  • Data Params
    {
        subject: required
        message: required
        emailTo: nullable
        senderId: nullable
        parentMessageId: nullable
    }
    
  • Success Response
    • Status: 201
    • data:
    {
        id,
        subject,
        message,
        status,
        createdOn,
        receiverId,
        senderId,
        parentMessageId
    }
    
  • Error Response
    • Status: 400
    • error: "Please input all required fields"
    • Status: 404
    • error: "Email not found"

Back to top

Get received emails

  • URL

    api/v1/messages

  • Method:

    GET

  • Body Params
    receiverId: required
    
  • Success Response
    • Status: 200
    • data:
    [
        {
            id,
            subject,
            message,
            createdOn,
            status,
            receiverId,
            senderId,
            parentMessageId
        },
    ]
    

Get sent emails

  • URL

    api/v1/messages/sent

  • Method:

    GET

  • Data Params
    senderId: required
    
  • Success Response
    • Status: 200
    • data:
    [
        {
            id,
            subject,
            message,
            createdOn,
            status,
            receiverId,
            senderId,
            parentMessageId
        },
    ]
    

Back to top

Get specific email

  • URL

    api/v1/messages/:id

  • Method:

    GET

  • Data Params
    messageId: required
    
  • Success Response
    • Status: 200
    • data:
    {
            id,
            subject,
            message,
            createdOn,
            status,
            receiverId,
            senderId,
            parentMessageId
      },
    
  • Error Response
    • Status: 400
    • error: "Email with id not found"

Author

Babatunde Yakub

Acknowledgement

Back to top

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.