GithubHelp home page GithubHelp logo

spaceface16518 / converse Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 8.68 MB

A web based chat website using socketIO and express

Home Page: https://converse2.herokuapp.com/

JavaScript 14.27% HTML 85.73%

converse's People

Contributors

spaceface16518 avatar

Watchers

 avatar  avatar

converse's Issues

Mobile display is bad

Borders cause a lot of issues in readability for mobile. Reduce side borders to a ratio would fix unequal display.

Chat ids need to be shorter

The chat ids are current;y an arbitrary length (usually 10 to 11) and need to be standardized.

For this example, I'm turning it into a 6 digit code.

Math.random().toString(36).slice(2).substring(0, 6)

Everything up to the substring method is already there, but here are the elements explained one by one:


Math.random()

This gets a random number between 0 and 1
ex: 0.435234525624562466362564356345634645634563456345634563456215251362738869824630985698698958257856856789856378563987569856782867287598257828567867398212931472831435911847159876534507240357263487568674685648567857598788752757856856785467246725756367676754671436547547566767143671436767567856786579879865432323456786666857843278462356928735645675678567745676864324524513412341345234245656858909676251231523625266736773673... :)


toString(36)

This method turns the number into a string, but not before using radix 36 to turn it into a alphanumeric string.


slice(2)

This takes the 0 and the . off of the beginning of the string.


substring(0, 6)

This method cuts the string from index 0 with a length of 6, essentially making it from a long string into 6 digits.

SPAM

There is too much spamming!

This is not technically a problem right now, but it could become one when mongoDB is integrated.

Users can submit blank lines

This is a major problem because they can then simply hold down enter to spam.

Disable pasting

This might help the anti-spam initiative :)

Add admin disconnect option

Add an event emitter and listener to make all clients disconnect. This could be useful, but would not be very effective in anything permanent. Perhaps add a username based option, make it like kicking the user. This would obvious require a lot of authentication and stuff.

Possible other solutions

  • Timeout on message send
  • Fake timeout on message send
  • more in comments

StitchError: document cannot be written to

(node:7013) UnhandledPromiseRejectionWarning: StitchError: document cannot be written to
    at /Users/AMRIT/GitHub/Converse2/node_modules/mongodb-stitch/dist/node/client.js:557:25
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:160:7)
(node:7013) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:7013) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Socket.io debug integration

Socket.io, though defaulting to silence, has a debug property. Here is a link to a socket.io page explaining it.

Code

<script>
    localStorage.debug = '*';
</script>

StitchError: authentication via 'anon-user' is unsupported

Cannot authenticate through anonymous auth like normal. I haven't changed anything since I last tested this, and anon-auth is turned on in the Stitch Admin Console.

clientPromise.then(client => {
  db = client.service("mongodb", "mongodb-atlas").db("Chats");
  client
    .login()
    .then(() => ...

.login()

This is the line that seems to be tripping up. This is the default function for anonymous authentication, and it was working until now.

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.