Mobile app on phonegap and node.js - javascript

I wanna build an app something like mobile messanger. But i'm not quite a programmer. I mean, i know js in the middle level but i have not used it for something serius.
Anyway, the basic idea that i need to be done in the app is push massages or something like that. Let's imagine that one app's user turn on flashlight on mobile phone of other user. And othe user can do the same thing in other direction or with any contact's nubers who have this app. In other words i need to seending some code from one client to another.
I do not want to grow a beard while learning Cbjective C or Java. I just want my app. And obviously it will be on phonegap with node js.
My question is not like that "please write the code for me". But if someone can tell something about it or give some links or keywords for googling then i will be very happy.
At the now momment i have smooth imagination about the indentification of user, then sending the massage, then server searching othe user, then sending them the message... and in the other direction.
There may be some standard technique for such things?
PS: Sorry for my eanglish.

This question may be to broad and open for interpretation. The answers you get may be based on opinionated, rather then helpful solutions based on a specific technical problem. It's probably best to recreate your question with more specific information. Try something specific, document what you did, then post specific technical questions here.
Generally speaking, I'd create some back-end service that saves and serves up messages between each chatter/participant, and call that service with javascript utilizing JSON as the data to pass back and forth. That's just one way. There's too many different ways to describe here. My answer is just me simply trying to be helpful. However, this question might get closed for being to opinion based. But that's my 2 cents.

Related

Is it possible to edit and save website content to server, making the change viewable by everyone?

I have created a website for a third party, who have no experience in editing HTML. However, the third party wishes to be able to edit the content on the website without having to open the files and edit it this way, they wish to do it somewhat WYSIWYG (For example, hit an "edit" button for the content they wish to edit). Is this possible to achieve? It is not an internal website, it has user tracking (this should obviously only be available to admin users).
Is there a way of making contents of a div editable, then saving the change directly to the server, so the content gets updated publicly?
I am currently researching the topic, and although I have found some indications that the solution may be a PHP script, I have yet to find any definitive solutions or examples of similar functionality.
Yes you will need a backend language or framework to archive this. Where Javascript is used to interact with the page, the actual storage of information requires a database or similar technology.
Unfortunately which backend language or framework to choose really is the million dollar question. It largely depends on exactly what you are trying to accomplish, what your client or user is comfortable with, and how much experience you have programming.
PHP is fast and time tested backend language. Node is the new kid on the block, and it very popular also. Java and dotNet are on the way out. You can dig up a bunch more including Go, Python, Haskel, Etc.
You can use a languge listed above and start scripting away, but this can be time consuming and error prone. Most people use a framework to get started, and program using that framework's tools. The most popular PHP framework is WordPress, but it is designed for blogs and might not fit your use case. I use the framework Craft CMS which is very customizable. But the way you are phrasing the question a framework might be overkill. This is really up to you to decide after doing research into the available options and comparing them to what you wish to accomplish.
For the WYSIWYG, you might want to look into the following tools for the client to edit content:
https://imperavi.com/redactor/
https://ckeditor.com/
Hopefully this provides some direction, happy coding!

How to change html content with URL?

I'm a beginner at coding, I know javascript but not super advanced objectd,
I'd like to know how to change html content with its URL. For example,I am on a website like GMAIL, it has different page of registring and logging in. These two pages have different URLs.
What I'd like to know is how do they change the URL along with HTML when I click on the button "Log in". Is this possible through server-side like node.js and express, or just with front-end javascript?
One last thing, do websites have multiple web pages or it's just in one single HTML file?
Well, I have set up a practice project, but I don't know what I am doing.
I changed HTML content with jQuery library but I don't know how to change URL.
First I made a homepage with some text and two links to two forms.
I showed registration form when click on "Sign in", and log in form on "Log in", and hid the homepage with the show() and hide(). The URL doesn't change in order to work with it with express. I tried it with history.pushState() but it messed up things: I can't return to homepage, and it didn't change the URL i wanted based on the form. So i deleted it, and I am stuck and don't know I could find some tutorials online.
My code doesn't contain anything other than what I described.
So, please can you explain to me how websites do that.
And one other thing, my express server now is very slow, it takes nearly 5min to start. I don't know if it's because my pc which is old and not super good unfortunately.
Can you please advice me with some tutorials and tips?
I agree that your question is too broad. Even there is many years invested in unversity to know these stuff well, I believe in self learning, so I will give you some light for your next steps in this world.
Here are some questions you may ask Google or research where ever you want:
There's both applications that hosts entire html documents in a server and reacts to http requirements responding with different ones. These are the first ones in existence.
Today the trend is to host information on distributed servers (Even cloud) as services to interact with just as information repositories, and entire client side applications that handles that information to show to the user in a more interaction friendly way.
So here are 4 first questions you can ask:
How does HTTP protocol works (with html documents e.g.)?
What's the difference between thin client and fat client applications?
What are web services?
How can I do a simple client side application with different routes using a public web service?
There is a lot of information to read about, and that's not the way I learned in university, so I can not tell you that's the right way or even a good one. Anyway, you should consider taking a web programmer beginner course, if you already know about basic algorithmic composition.
Wish you the best in this extensive path...

Back-end solution for pure-Javascript site with link sharing

I'm developer-beginner and I would like to do simple card-sorting site.
hundreds of cards with plain text
no log-ins, it must be as simple for user as possible
few dozens users per day
final state of sorting should be saved under unique link, like site.com/q56we1cfuz4 or site.com/link.php?unique=q56we1cfuz4
User sorts cards as he/she wishes and the result is saved into browser sessions storage (few kb of data in JSON or so). So far, so good.
Question:
As I know only Javascript:
If I need to share the state of the page (data in session storage) with some unique link, is something like Firebase.com good solution for such kind of back-end? Or some simple DB with help od Node.js?
In order to "catch" the link when someone click at unique URL (site.com/link.php?unique=q56we1cfuz4), I still need some server-side script which will ask the DB, like PHP header redirect, right?
Your questions are a little fuzzy, no problem tho. You are just getting into web dev, so there's a lot to wrap your head around and all of the options can be pretty confusing. Some people will complain about opinionated answers, and I'm not going to claim to be objective here, but here are a few tips that I think will get you pointed in a better direction...
Firstly, yes - firebase is a good solution for you to try working with. Aside from the fact that it will give you the db/storage features you need, it's a realtime db, which will give you a lot more than just storage in the long run, and will better equip you for the future web development trends. The firebase API is (mostly) designed to work asynchronously, so from a javascript perspective, it falls right in line with the kind of code you'll end up learning to write.
Re: the other aspect of your question - server-side - check out nodeJS. It's basically a server-side javascript platform that will allow you to use the same skills you're learning to write client-side code for the server. Also check out expressJS, a nodeJS package that provides you the http-server, and allows you to handle dynamic urls, etc. - the bits you were thinking about when you made a reference to PHP.
Hopefully this will help you focus on a few specific tools to familiarize yourself with as you learn web development, rather than having to struggle with everything from new languages, platforms, and way too many libraries, frameworks and techniques to wrap your head around. Good luck!

AJAX-based groupchat for webpage like on FB

Got a question for you ... I'm currently working on a simple groupchat functionality for a webpage. It will only be available for groups so there's no need for the users to specify a nickname or anything like that ... the nicknames will already be known to the system since the users have to be already logged in.
Anyways it should just be a simple chat room for the whole group - no 1on1 private chats!
Question is: Would you consider it a good idea to have a look into Ajax Push (like here for example) or is this overkill for a simple group chat ... don't expect toooo many people to use it that much so maybe push is overkill and longpulling via jquery would be better (in that case - do you know of any really good tutorial for a longpulling chat-functionality?)?
Any tipps or other input is greatly appreciated! :)
best regards
P
Pull would be easier, but would be a bigger load on the server and obviously not quite as real-time. For a good chat experience, push is definitely better. You may be limited on your ability to implement it, though, depending on what technologies you have on your server and how much control you have over it. I've implemented a push (Comet) system a few times, and it's definitely doable. It's really up to you. It sounds like you've got an okay handle on the things you should be considering (number of users, difficulty in implementing, etc). The more users you have, the better it's going to be to be using push because it'll take a lot of strain off the server, and it'll improve the interaction in the room.
Another thing to consider is what browsers you want to support. Supporting IE with push can be more difficult than supporting other browsers, but it's definitely doable (I've supported as far back as IE6 before).
Finally, if you only care about supporting modern browsers, you may want to consider using web sockets instead, as that would be both easier than push and better performing.

Flooding vs Javascript

I use to make an interface to send message to my website by using only HTML (without any kind of human verification). Annoying to get every days many fake message by bots that spam or flood my website, I do this interface by using Javascript : I mean, thanks fo JS, I open a box like a popup on my website, and than the message will be send using this interface.
After done this, I never get any kind of fake message. That I'd like to know : this is a real barrier to avoid the flooding on a website, or there are some kind of bots that can also use Javascript?
You will find that typical bots will only attempt the "typical" list of weaknesses. If you have come up with some sort of system that is a little more intuitive then others and possibly unique then you should be OK with what you have.
Thats not to say that no bot is out there which might be able to break through your barrier.
A bot can be coded to parse the javascript, of course, but most bots don't do this as they go for the easy targets.
If you'd really like to be safe, you need to implement something like a CAPTCHA, which uses images that are very hard to read by machines. But OCR has taken huge leaps forward, so they may be rendered useless in a couple of years.
http://en.wikipedia.org/wiki/Captcha

Categories