Giter VIP home page Giter VIP logo

jollyhelper's Introduction

JollyHelper

Build Status

Master

Build Status

Develop

Build Status

Overview

JollyHelper is a Christmas exchange application that takes in dictionary in the format:

Name : [email protected]

Then it will randomly assign each email address a name (that does not belong to the original email address)

Setup

  • Copy and remane the sample environment file
» cp env.example .env

Run

You can run the application with:

» foreman start -e .env

Available Endpoints:

  ,--.       ,--.,--.         ,--.  ,--.       ,--.
  `--' ,---. |  ||  |,--. ,--.|  '--'  | ,---. |  | ,---.  ,---. ,--.--.
  ,--.| .-. ||  ||  | \  '  / |  .--.  || .-. :|  || .-. || .-. :|  .--'
  |  |' '-' '|  ||  |  \   '  |  |  |  |\   --.|  || '-' '\   --.|  |
.-'  / `---' `--'`--'.-'  /   `--'  `--' `----'`--'|  |-'  `----'`--'
'---'                `---'                         `--'

POST  /persons                  --> PersonResource.Create
GET   /persons/:id              --> PersonResource.Get
GET   /persons                  --> PersonResource.List
POST  /persons/:id/list         --> PersonResource.AddListItem
GET   /persons/:id/list         --> PersonResource.GetUserList
POST  /secretsanta              --> SecretSantaResource.AssignNames
GET   /secretsanta              --> SecretSantaResource.List
GET   /notification/:id         --> NotificationResource.Send
GET   /                         --> Hello World
GET   /ping                     --> pong

jollyhelper's People

jollyhelper's Issues

Add Authentication Middleware

Add an authentication middleware around all endpoints that require the user to be authenticated. This middleware should look for a token in the header and ensure that it is valid.

Get Person by ID

Create a function that returns a single Person by ID.

GET /persons/{id}

Add person registration method

Add an endpoint that allows to register a new person to the system.

Should not allow registration of an existing email address

Add Login Endpoint

Add a login enpoint to authenticate a user and return a valid token. This token should never expire.

The credentials required are:

  • email
  • password

Send chosen names via email

Create a function that will send the chosen names to each of the persons via email.

Email template:

Subject

{current_year} Christmas Exchange

Body

Hello {person_name}:

For this year's Christmas exchange, you have chosen:

{selected_name}

Assign Names

This process will be responsible for assigning a unique name to every person that exists on the system.

Heuristic

Start with a sorted array (Age, Decreasing). Create a second array with this structure:

{
    "name": "Jon Smith",
    "chosenBy" : "Jane Smith"
}

Looping over the sorted array, you will chose at random a name that:

  • Is not equal to the current person
  • Has not already been chosen by a previous person

Once completed, output the list of names and chosenBy to ensure that the heuristic did in-fact run as expected. Also, run it several times to ensure that the "random-ness" is acceptable.

Create Person Object

Write the create function to create a new Person object in the DB. A person consists of the following object:

name,
email,
age,

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.