Git Product home page Git Product logo

sentencecraft's People

Contributors

chetan7623k avatar copperwater avatar tassiahmed avatar zqiu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

tassiahmed

sentencecraft's Issues

All API return statements should have HTTP response codes

When returning from any @app function, you can provide a second parameter to the return statement that represents the error code, as in return "Success", 200. I have done this for a couple success messages, but every such return statement should have an appropriate HTTP code, including all the errors.

More sensible way of making recent completions appear first

Currently to mitigate the problem of complete lexeme collections being sorted by object ID (and thus sorting them in order of creation), we delete and re-insert them upon completion. This is terrible design and it should be an update. Thus, we should add a timestamp to track the last change made to a sentence, to be set when it is created and changed when it is appended to. Then we can just add that as the default sort for view.

Add support for Sentence lexeme in the backend

Add Sentence.py and SentenceCollection.py with the appropriate modules, expand the database to include a new "paragraphs" collection, and modify app.py so that it can handle requests for both types of lexemes.

Make sure to use correct Angular escapes to prevent XSS attacks

Just like the backend can't assume that the frontend clients will give it proper and valid requests, the frontends can't assume that the backend isn't compromised. The Web frontend in particular needs to make sure that tags, especially <script> tags, that come through the API can't be parsed as part of the DOM. This can be done by ensuring that all data from the server that will be displayed to the user is correctly escaped.
The mobile apps don't really need to worry about this.

Parse JSON requests

The iOS app needs to be able to parse user input into JSON format and be able to parse JSON input into something users are able to understand.

Communicate with backend

The iOS app needs to be able to communicate with the backend: meaning sending and receiving requests from the backend.

Add Javascript to make API calls

After #5 is done, add behavior to make an AJAX request that will make the correct API call and create and populate the (possibly different) page structure as a callback.

Detect type parameter by key for append behavior

Since the append behavior requires a key anyway, and that key is uniquely associated with a certain lexeme collection with a certain type. If we stored the type along with the key, we could remove the type parameter from this API behavior.

Clarify all try except blocks in the backend

There are several try...except statements in the backend code that do not specify the type of error that should be caught by the except statement. This is a bad practice in Python. We need to figure out which exception type is intended to be caught by the block (probably ValueError for all of them but I can't be sure) and narrow the except statement to catch only that type.

Potential Security Issue

Generating keys immediately created on start on sentence. Should be generated per add request. Ideally keys should expire after a timeout.

Unit Tests for iOS

There is currently an empty Unit Tests folder in the iOS project; that needs to be populated with some unit tests.

API behavior to release a key

Currently once a lexeme collection is checked out there is no way to intentionally drop it and tell the server that there will be no continuation coming from the client. A fifth API behavior should be added that will do the functions (same as those used in the continue behavior) of releasing the key from a lexeme collection. This would be used when someone gets an incomplete sentence and then decides to switch modes or lexemes.

Once the API supports it, new issues can be created for the various frontends.

Add 4th API behavior (start new sentence)

Make the API behavior to start sentences (with either one or several words, we can decide), validate the words, and insert the resulting incomplete sentence into the database.

Handle LexemeCollection lifetimes on the backend

I think that the backend should maintain a map (dictionary) of LexemeCollection keys to LexemeCollections, signifying all the current "active" LexemeCollections that have been requested and are waiting on contimuation/completion. When someone makes an /incomplete-sentence request, it will get pulled out, the class will be created, and it will be inserted into the map. When someone makes a submission request, it will take the key and use it to look up that LexemeCollection, and store it back in the database. The backend will periodically poll this list and remove collections that have been there for a certain amount of time (the timeout).
This might actually remove the need for keys to be a part of the class.

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.