spaceface16518 / converse Goto Github PK
View Code? Open in Web Editor NEWA web based chat website using socketIO and express
Home Page: https://converse2.herokuapp.com/
A web based chat website using socketIO and express
Home Page: https://converse2.herokuapp.com/
Ignore the node modules directory so that repo size isn't too large
node_modules/*
Borders cause a lot of issues in readability for mobile. Reduce side borders to a ratio would fix unequal display.
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.
This is not technically a problem right now, but it could become one when mongoDB is integrated.
This is a major problem because they can then simply hold down enter to spam.
This might help the anti-spam initiative :)
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.
Write better auto scroll functions for both the on message and on input focus elements.
This can be done with the JQuery plugin scrollTo
here is a link to the github page of said plugin
(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, though defaulting to silence, has a debug property. Here is a link to a socket.io page explaining it.
<script>
localStorage.debug = '*';
</script>
Connecting to multiple chats causes you to send messages to all connected chats. Details to come.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.