Web app - How do I connect two different pages with firebase? - html

I am in the process of creating a quiz web app for university. I've decided to use firebase as I've heard good things about it. I've managed to get hosting working, however I'm having trouble with a few other things.
First of all, I'm using HTML, CSS, JS and a little bit of JQUERY.
The idea of the quiz is to have a host view, which would be a teacher putting it on a projector and to then have student views which would be the student connecting on their phones.
The host view allows for the teacher to select the question on their computer, and then that question gets pushed towards the students phones. Once the student answers the question a boolean gets pushed back to the host view to tell them if they got it right or wrong.
At the moment I've only got the student view being hosted and I can't figure out the best way of doing this through firebase. My inital thought was to get a database set up between them both. However, I'm unsure on how to go about that. Would it be better if they were both hosted under one domain and once on that domain the user gets the option of selecting HOST/VIEW?
I'd appreciate any help given web development isn't my strong suit.
Thanks.

Related

Questions about Firebase and MySQL in a mobile app

I'm fairly new to programming and I'm studying App development with Ionic and using Laravel as a backend. So far I have created a simple system with sign up and login of users and creation of "events" by the users. I have made the relation between the users and events as the app will need to know which user created an event, and the participants of such event.
Now, I was wondering about adding a messaging system between users and obviously push notifications and stuff and came across Firebase. I've read about it before, but haven't really used it so I'm not quite familiar with it.
My question is, is it possible or even recommended that I use both MySQL and Firebase in my app or should I just stick to one? I've read about Websockets if I stick with Laravel, but on the other hand, Firebase also handles user login and registration in case I want to move to Firebase completely. I'm having some technical questions, such as:
if I'm using both MySQL and Firebase in my app, how would I connect the user that was registered with an ID and a username stored in my MySQL to Firebase, which will need to know which user has sent a message to another one? Can that be done, or recommended?
Should I just stick with just one for my use case (MySQL or Firebase, instead of both)?
I have researched about use cases similar to mine and couldn't find anything, if you guys have come across such situation, could you recommend any materials? It would be much appreciated!
Thanks a lot everyone! I hope my questions were clear, if you need more details, please let me know!
If you decide to use Firebase, it comes with a built-in authentication system so you wouldn't need a MySQL database or your own server.
If you decide to use both anyways (if you have a good reason to do so), you would have to handle all the logic for copying the authenticated user id over to firebase (and validating access) on your own server. If you don't need to do that just keep it simple: Firebase or your own server + MySQL.

Storing Images in Database (Address vs. Blob)

I am planning on working on a personal project over the summer that I feel I might be able to complete now that I have the understanding of databases. I want to have a database that is able to be filtered down on say attributes an image has.
For example, we have a database of images of cars. I want to see only images for Chevy. So I click on the "Chevy" tab. I want to be able to query data for Chevy and show images for only chevy cars.
I can structure my database that if I'm on "Chevy" it goes to "chevy" table correct?
I am yet to work on a real world model, so completely new to me.
From what I have understood you can store images in database as "Blob", but it sounds like it might be more preferable to store these images in a host directory on my website server, and store the path to them instead.
I want to ultimately expand this out to an mobile app for Android and IoS, I dont imagine that would affect the decision to much. But is a plan I would like to try and incorporate also later down the road.
Currently I am going to try and do a website application, then I'll work on a mobile app afterwords.
Popular database's seem to be Mongo, any other recommended for a beginner programmer?

HTML: How to design profile page that is used for different users

I want to make a website for my Android social networking app and need some assistance with a basic concept regarding user profile pages. So right now I have a native Android app where users have their own profile page displaying their profile stats, e.g. followers etc. and I would like to do something similar in HTML. My question is how can I design a generic profile.html page that displays the current user's username/stats and that can be used for different users? For example, see how Facebook are using the same profile page for each user but they replace the name/bio/stats fields with the data for the current user, how is that done - at the server side (by replacing the appropriate fields with the data for the current user), or at the client side (by loading them with a separate script after the page has loaded)?
Also, I am using a Tomcat servlet to deal with the requests if anyone is interested.
Thanks for any assistance and sorry if the question is silly :)
You would have to use PHP. Think of webpages as a mathmatical equation where HTML is 3+4=12 but PHP is 3+X=12. HTML is already defined, you can't change it. Where PHP you can code the entire page but get the bio or username from a database.
But you should be warned that this is no simple task, you would have to create a large mySQL database, possibly more to handle logging in and out and use the PHP to define what you are calling for form the mySQL database.
It is possible, but not in a day.

Unifying K2 component's data-source for multiple Joomla! websites hosted in the same server

I am responsible for a few web sites of my organization.
I use Joomla! 2.5.9 for those web sites. They all are running at the same server.
I use K2 component for content managing.
I have a general website in which shows all the staff information at the 'Staff' page. Also some of those people and their contents are shown in another department's website. So, there are databases for each web site.
For example:
In the general website (let's say general.org), when I click on the 'Staff' menu item, page shows all of the people work at my organization. Also they work at different departments.
In another web site (eg: education.general.org) when I click on the 'Staff' menu item, It shows the people work at education department.
But for each web site, I have different user accounts which means a modification in one of them does not affect the other one. If the one of the education staff tries to change his profile picture on the education web site, he also has to do it on the general web site.
And sometimes one person might be working at two departments. Thus he has to edit three times of his data.
Is it possible to merge the records for all websites? In other words, I want everyone to insert/update their data on the general web site, and the other web sites will be updated automatically.
You would have to have one Joomla site to do this. The subdomains would have its own template/style or whatever, but would run on the same Joomla installation. The subdomains then just map to a specific menu item on the general page. That would be one way to do it.
Another way would involve coding a custom user plugin which updates the tables from the other Joomla installations after a profile was edited. If you're familiar with PHP you could probably do this yourself, otherwise you need someone with coding knowledge to do it for you.
Or you could set up Joomla to use authentification based on a LDAP database (http://docs.joomla.org/LDAP). However I'm not sure how well it works with password and profile changes.
That's about the solutions I would see.

Django - looks like the wrong pages/html being displayed inside a firewall, but ok outside

We have just started to deploy our app over four schools with the server located in one school. The Three schools accessing from outside the system are working fine, but when you access from the school hosting the server, its like the wrong HTML is being returned. In one case, a user had a page returned to her with a different users userid displayed on the page. It also keeps going back to the login page even though your still logged in. Outside of the school all's fine.
Any ideas ?
This is one of those problems where it's difficult to pinpoint the cause without actually being there, or having lots more information. My first thought is that maybe you're using ip based virtual hosts and the NAT (Network Address Translation) is interfering with it.
Edit: could you tell us what sort of caching you have in place? Users seeing each others “logged in” pages without even logging in themselves is a sign that you're caching things that only authenticated users should see.