Web app : Best technology to develope an interface for a database? - javascript

I am new to web development;
I am trying to develop some web application to view data and do insert and delete on a little database including two tables.
I use Node.js for my server.
Currently, the data is saved in two XML files. I do my operations(insert,delete,...) by changing the XML at clientside and sending the XML over to server to be saved.
However, I guess this is the hard and native way and there should be some library or some technology to help, because this is such a common scenario.
I also think that using some database rather than XML may help, though the database management utilities are not much needed really.
Note: I don't browse all the data directly from database. the database includes path of some images which are loaded for the user to be viewed.
Any idea is appreciated. Thanks.

I would suggest sqlite as the way to go! U will find an abundance of information on how to use it if U google it.
Have a look at this : https://codeforgeek.com/2014/07/node-sqlite-tutorial/ it may be the answer to the question U are asking :)

Related

How do I save data, that would normally be in a database, to a SharePoint folder or the site's root folder

I'm working on a project for my employer that is off-job-description for me. I am not in my department's IT/WebDev departments. That being said, my department is trying to streamline a process that is horribly done right now. Here's what I'm trying to do..
I want a form that can be submitted on a local computer (no PHP library at this time - ticket opened with IT for months now). It will then be used to populate a calendar (which I have no issue programming and filling automatically with PHP normally, but like I said - no library).
Basically - I need to be able to save the input data locally on a SharePoint folder and be able to "grab" that data when the site is loaded.
Again, I have no problem with the display/structure parts - I just need to know a good way to save/load the data (long term) until my IT gets its... stuff... together and get's me a php library and SQL Database.
I'm not looking for any type of script help or anything. I can learn what I need. I just need ideas of what type of function or something I can use. If you have a website with some tutorials or at least documentation for it, I'm happy to read up myself.
Browsers cannot access your local filesystem and are heavily sandboxed to protect you and your data from nefarious websites (even if you have written them).
As such, your only option of writing data to a Sharepoint folder is to leverage a server of some kind. This can be created locally on your own PC, or on a spare one for the time being.
You might to need to contact your IT admin, so that they can grant you access to your Sharepoint, so that your PHP code can read/write to your Sharepoint folder(s).
Good luck!

How do you get mysql to connect to a website (created using html and css)

I am a student who needs help with some coding. My assignment requires me to create a website that uses mysql database with xampp to store, retrieve and create reviews for games. Is there a way to connect mysql to my website WITHOUT USING PHP. Our assignment specifications dictate that we can't use php so I'm looking for alternatives. All help will be appreciated thank you.
Unless you are going to use the browsers IndexDB, you cant accomplish this. Html is a markup language and CSS are the styles rendered to HTML, they cant connect with MySQL db or any db in that regard. You need a server language to connect with the database. Other alternatives to php are Node JS, Python etc..

Generate a PDF from a site running javascript

I need a way to generate a pdf-file of a site that runs alot of javascript.. any ideas of how to do it..or is there any package that I can use or something?
Thanks in advance!
EDIT
Should add that I need to generate this server-side using asp.net.
Doing it server-side I would recommend iTextSharp or Docmosis, and the Docmosis cloud services could also let you create it by a http post from Javascript). They both allow your application to create PDF documents with a rich set of features for layout and content. If you say more about what is in the PDFs you need to create then it might be clearer which you would choose. Please note I work for the company that created Docmosis.

Create database in memory from sql/csv files in Javascript

I am creating a product that as end result will/can create e.g. 10 .sql files, each being a table. The tables will contain various pre-calculated data related to each other.
My users will need to upload these to their website (php, asp, whatever) and will need to make something useful. Only problem, the users may have next to zero understanding of databases, server-side code etc. This means it must be very easy to configure.
So I think thinking upload these .sql (or CSV files, whatever) tables to server, so they are publicly available (i.e. can be retrieved like any other public URL). And then find a Javascript in-memory database engine that can load .sql database files. Does this exist?
I imagine a Javascript solution could work well if amount of data could be kept somewhat down... Otherwise I may need to look for a PHP/ASP solution as well. (Any ideas for libraries that can init in-memory databases from .sql or similar files?)
Preferably I should be able to re-distribute this Javascript library. (So users can get a complete "directory" of .sql files + example page + Javascript database engine to upload)
So to make the question clear: Anyone knows a Javascript-based in-memory database engine that can run inside browser?
If you wish to use javascript and need some 'userfriendly' bridge database, you could use json or xml, because the format are simple text files (like csv as well) for wich you can find smart small editors for your users.
More json is made for javascript parsing and has an understanding tree format, but you should load only some part of sql datas in memory, saying data buffers in xml or json, with php requested with some javascript ajax call. Php do the sql database access work and then you can output json, and with javascript, it is for user's interface, you'll be able to display them.
You can use mysql to store a database in memory:
http://dev.mysql.com/doc/refman/5.0/en/memory-storage-engine.html
Here's a pure JS SQL engine that stores everything in memory, https://github.com/moxley/sqittle
It flatly denies being useful for anything though, and has a limited set of supported commands (see readme on above link.
http://diveintohtml5.ep.io/storage.html might be what you are looking for.
That question seems very old. You might want to look at LokiJS now.

blogengine without php or asp.net etc

Is there a way to have a blog directly integrated into my HTML/javascript-only website, without having to have something like a SQL-database and a dynamic engine like PHP or MySQL?
Maybe there is some service in the web that offers this (hopefully without ads :) ). Or maybe I can have a blog engine entirely written in javasript?
Entirely written in JavaScript? Surely that defeats the entire point of having a "blog-engine" in the first place? The point being that the data is stored somewhere and dynamically retrieved. To avoid using anything server-side (which seems to be your intent), and only use HTML/JavaScript, you'd have to store all the data for the blog in files that are served up to each visitor, and then retrieve the data from the particular, local, locations using JavaScript.
Sorry if I'm misunderstanding the point here... but this seems to be an utterly useless way of trying to go about things. Blogs are, in general, either written statically (in HTML [even though this is rare]), or are dynamically generated from a database by a server-side scripting language (most common).
Edit: As an additional point, I suppose you could include some third-party blog feed, or service, in your page, via use of JavaScript... but I'm unsure as to which (if any) blogging services would directly support this method of working. Additionally, this is quite an unreliable way of including third-party data in a page...
Here's a thought. It's not really a blog engine - but a wiki.
Entirely javascript/html/css. All lives in a single html file:
http://www.tiddlywiki.com/
not sure how it would work on a real live site, but their site is using it:
* A personal notebook
* A GTD ("Getting Things Done") productivity tool
* A collaboration tool
* For building websites (this site is a TiddlyWiki file!)
* For rapid prototyping
* ...and much more!
You could use github pages. You will get a generated blog with version control.
Other option is to use a Desktop blog tool and then update your site.
You can user iWeb if you have a Mac or CityDesk on Windows or you may try this open source tool
Edit Today I came across this tool: Zeta producer that may help.
http://code.google.com/p/showdown-blog/
Blog engine written in just JS and XML [v0.6] {JavaScript, XML}
So, what you want is to have a blog where you're website provider doesn't provide a way to serve dynamic content?
The only way I see that you can do it in that case is writing html-files (or text-files if you prefer) and adding them to the site. After that you can have some JavaScript to add them to your "blog-page".
You of course need to upload them to the website in the same way as you do for the other files, and then have a way for the JavaScript to know which pages it should fetch.
I am not aware of any JavaScript blog-engines, but you can have a look at the templating functions in for instance Prototype
Of course, that means that you will have to fetch both the template and the content through Ajax and let the client do all the processing (could be slow and possibly insecure), and you still need to have a place to upload the content and update it.
Your best bet is going to be using a generator to create the HTML/CSS/JS to upload to your server, take a look at Webby: http://webby.rubyforge.org/
IF you really need to you can use a public api for a service that lets you post small bits of info and retrieve it using javascript.
for example if you only need small posts you can make a blog in html.javascript that utilizes twitter as the engine. of course you will be limited to 140 chars. I am sure there are other services that will allow a similar idea but with less restrictions.
And of course the best option - Get a blog software or host your blog with a service provider and link to it from you site.
Good luck
One solution would be to use some application that generates the static web pages of your blog, and uploads them to your web server. This way you'd have a blog with static content that could all be managed in javascript alongside your existing site, without needing to install database, daemon software, or additional dynamic web programming languages on your server. The static content generation could happen directly on your server if possible, or you could run the html generation tool locally and upload the output.
MoveableType has a tool like this. You still need somewhere to store the content of your blog, and for this MoveableType uses MySQL by default, so you'd still need to install a database somewhere, but the database could simply be one your local desktop.
MoveableType also has support via plugins or older versions that can retrieve data from a sqlite or other database. The advantage of sqlite is that it doesn't require installing daemons like MySQL does, you can just put a sqlite file on disk somewhere, give MoveableType the path to the file, and run the script to generate your static content.
There are likely other tools like MoveableType, and I have in the past generated blog-like web pages simply by writing small scripts to generate HTML. The main issue is just that you need somewhere for these scripts to fetch data from.
Another option might be to develop your blog using XSLT, ... with XSLT, you'd put the content of your pages in XML files, and then write a template in XSL that converts your XML to HTML.
If you google for 'static blog site generation' you might find other ideas/options, including Jekyll/github mentioned in one of the other responses.

Categories