Git Product home page Git Product logo

ccm-server's People

Contributors

brentdur avatar

Watchers

 avatar  avatar

Forkers

danagilliann

ccm-server's Issues

Broadcasts

When a broadcast is created it is sent as a singleton message to all users, also pinging them

Data

  • recepients: [Groups] || null(all)
  • title: String
  • message: String
  • isNotification: Boolean
  • syncs: enum(all, events, convos, singups, messages, talks)
  • createdBy: User

Fix Event Displays

Render if loaded in browser, json if not.

Possibly render if get request but return json error message if post/put request?

Talk and Message don't fail

Fail if one field left empty of required fields
Talk:

  • topic
  • author
  • date
  • reference
  • outline

Msg:

  • subject
  • author
  • msg

Limiting Older Clients with Broadcasts

The problem here is that broadcasts will create and use a message to show user's the message text, how will this work for older clients? They just don't get to see the option?

Google Spreadsheet Creation

Will create a spreadsheet for a signup and add data to it

Makes use of google docs

Implementations

  • Add google auth code to User
  • Add refresh token to User
  • Add Worksheet id to Signup
  • Add Spreadsheet key to Signup
  • Create get auth key utility function
    • uses refresh token to get auth token

For following functions: if auth key fails then use utility to get new refresh

  • When creating a new signup - async F() below
    • create spreadsheet
    • get spreadsheet
    • get worksheets
    • add worksheet Id to Signup
    • add spreadsheet key to signup
    • add header cells
  • When member adds to signup
    • create row with worksheet id and key

Will close issue #5 when complete

figure out status 400 error

POST /api/talks 200 5183.870 ms - -
GET /api/events 304 7.581 ms - -
GET /api/locations 304 6.812 ms - -
GET /api/messages/mine 304 13.659 ms - -
GET /api/groups 304 22.041 ms - -
GET /api/talks 200 16.106 ms - -
STATUS: 400
HEADERS: {"content-type":"text/plain; charset=UTF-8","date":"Fri, 07 Aug 2015 02:49:06
 GMT","expires":"Fri, 07 Aug 2015 02:49:06 GMT","cache-control":"private, max-age=0","x-content-type-
options":"nosniff","x-frame-options":"SAMEORIGIN","x-xss-protection":"1; 
mode=block","server":"GSE","alternate-protocol":"443:quic,p=1","accept-ranges":"none","vary":"Accept-
Encoding","transfer-encoding":"chunked"}
BODY: "registration_ids" field cannot be empty

Menu for Admin

  • all of the user ones
  • add signups (if permission)
  • add events (if permission)
  • add talks (if permission)
  • inbox (if minister)
  • ios
  • android

signup data type

  • name
  • time of event
  • members
  • member count
  • location
  • related event

Conversations Support

Schema for "Conversations"

Goal

  • This data is designed to represent a series of back and forth communications between two parties.
  • The document should keep track of whether the data has been read by one party

Fields

Field Type Purpose
alive boolean a conversation should be considered alive only when both parties have not deleted it from their phones
minister object matches the "participant" object
participant object representation of a person in the conversation
user -id id of participant document
alive -boolean whether this user considers this conversation to be alive or not, whether it appears on their phone or not
readLast -boolean whether this user read the last message
isAnon -boolean whether this user is anonymous in this conversation
senderID -string the id of this person relevant to the conversation, for identifying where the messages came from
topic id the id of the relevant topic
singleton boolean whether this conversation is a one-off or is meant for two way communication,a support function for users that are still on past versions of the app, and are sending single messages
messages [id]

Opted out of participant array for using static group ministers
Ministers can see all conversations

Compatability

Messages end-points that must stay:

  • [GET] messages/mine
  • [POST] messages/
  • [DELETE] messages/

Messages fields that must stay:

  • _id
  • from
  • simpleFrom
  • simpleTo
  • subject
  • date
  • message
  • version
  • topic
    • _id

Fields to be added to Messages

  • Added
  • conversation
  • sender_id

Note: essentially conversation will 'replace' the "to" fields and sender_id will replace the "from" fields, conversation now will also hold the relevant data for subject, version(because individual messages are nonmutable), and topic.

Changes in Messages endpoints

  • Changed
  • [POST] messages/
    • will create two things:
      • message object: just like normal
      • conversation object
        • singleton: true
        • add a new message object to the conversation like a new conversation

Creates two types to fully support backwards compatability between senders and ministers

Scenarios:

  • Old Sender -> Old Receiver
    • will come as normal message
  • Old Sender -> New Receiver
    • will come as singleton conversation
  • New Sender -> Old Receiver
    • not supported, idea is that an old receiver should be upgraded before new receiver
  • New Sender -> New Receiver
    • will come as conversation
  • [DELETE] messages/
    • will only work if message does not have conversation field

Fields to be added to Users

  • Added
    • active_conversations - all conversations that the user is a participant of that are still globally alive
    • [array of objects]
    • object:
      • id of conversation
      • considered alive
      • sender_id

Fields to be added to Groups:

  • Added
  • can create conversations - users
  • can read conversations - ministers only

Paths for Conversations

Consider which ones, fields to determine which ones, authentication needed

  • Gets
    • (/) - gets all conversations(for dev reasons)
      • need to be admin
    • (/minister) gets all conversations still alive
      • need readConvo group permission
    • (/mine) gets any conversations that user has that are still alive
  • Posts
    • (/) - create new conversation, see here
      • needs "createConvo" group permission
  • Puts
    • (/send) - adds a new message to an exisiting conversation
      • authenticated()
      • will make the conversation alive again for all parties(and check that it's globally alive)
      • will set readLast to false for all parties except the sender

Create New Conversations

Follow table below

Field Type Needed in request Default Notes
alive boolean no true
minister object no {alive:true, readLast:false, isAnon:false, senderID:random}
participant object no
user -id from req.user
alive -boolean true
readLast -boolean true
isAnon -boolean from topic
senderID -string random
topic id yes taken in form of id(same as current new message endpoint)
singleton boolean no based off whether the user tried to send a message or convo
messages [id] yes first text typed will be made into a message

Add convo makes gcm line 56 fail

All of the convo functions seem to fail on the gcm send function.

Need to restest, send, respond, and kill convos on test-deploy

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.