Is it possible top upload `react` app with `mysql` to `github`? - javascript

I've made a siple web shop using react, node and mysql. I wanted to push it to github, but I'm not sure if it's possible to do that with database that's on my localhost right now?

Git is a means to version control code.
There would be no problems storing your program's source code and your database schema (along with any migration scripts) in Git.
Storing the data from your database is another story. You would need to export it. Git isn't designed as a means of storing backups though.
Github also offers Github pages for hosting static sites. That service is not suitable for anything that involves server-side programming.

yes, check heroku.its free at some extend.
i have used it for my project, with mongodb.
heroku uses postgresql but there are ways to make your mysql working.
i think there are already questions about that.

Related

How to embed a database into my vuejs app?

I know this is a "generic" question, but please read it before judging:
I try to create a vuejs fullstack application that i can build and run with a single command. I use the vue-cli to create and build a project. Included is express and node (works fine). But I cannot figure out how to add database functionality to it. I thought mongodb and mongoose would fit, until I learned that I need a separate mongodb server running instead of getting it embedded within my build.
Is this even possible? I mean, android apps ship with SQLite that every app can use. Where do I need to research to get this job done? Google tells me to use mongoose, but it is not embedded as it seems.
As requested, as an answer:
Databases are usually part of the back-end (in this case nodejs). There's plenty of choices for embedable databases, the most popular one is SQLite.
It can be used either purely "in memory" or with persistence in the form of "database files". More information how to use it in node can be found in the node-sqlite3 documentation

How will I be able to download the entire website with its codes and database?

I am currently developing a website which it can create an examination and generate the exam result using php and html canvas. I am now puzzled on what my next step will be. I really need a sample website that can be my basis in making my own. How will I download the entire website code and the database?
to get the database out, you will need to export the content of database into a file. Look into myslqdump command, if you are using mysql.
To move whole website, you will need to ftp the root directory (probably compressing it first, maybe with tar) where all your css, javascript and HTML files are. Same applies to PHP scripts.
But to be a cool kid, you will need to store your files in some sort of Source Code Version Control system, such as GIT or SVN. Then its just a matter of checking out your branch on another machine.
You can not download server side code and database of any website until you are a genius hacker who can hack into the desired system and get access to all the things you need.
Breaking into any system is illegal and as per your country law you can be jailed or fined a huge amount.
If any can download my code then world don't need any more programmers and software developer as they could download some ones software and just modify it.
I would suggest you better start coding to complete your project or start hacking to steal it.
You can't - unless you have full access to the server.
I strongly advise to create yourself a github account and search for open source php apps, from which you can learn a lot.
As my understanding after read your question, if you meant to download some online web and its database then it is not ethical but still there are some other ways to accomplish your need.
Here in Github, there are lot of apps availble as you need
Also there are a lot of resources and frameworks available all you have to do is google your need

Is there a way to allow user accounts (sign up+register) with just javascript (angular frontend and node,express server code)?

Most of what I've found uses php, or something similar.
I have an Angular frontend, and Node/express server code. No backend yet. I'm not sure how to proceed with user sign-up.
It is very unsafe to to do sign-up and so on without a backend. A backend means a thing running on server rather than client, so what it does is invisible to the users, thus making it safe. Think about how dangerous it will be when your password-checking and so on are all on client and the user can see everything - thus change everything!
However, node.js is already a backend.
For your question, please search nodejs user system then you will find a lot of answers.
Possible answers:
User Management System in node.js
https://engineering.gosquared.com/admin-systems-in-node
...
In short, you have two main ways: The first is to use a framework or a library containing that feature, and the second is to build it yourself through a tutorial.
Hope it works!
It looks like you are one step away from a MEAN stack! And yes, as Sylwit pointed out, your node/express server code is your back-end.
I would recommend you take a look into MongoDB as a database to get you started (you will need to store user credentials/registration information somewhere).
MongoDB is a NoSQL style of a database that will allow you to do what you want, assuming you write the registration and login/logout code to link up to the DB. You don't have to use MongoDB, but since you are just getting started this might be easier because the MEAN stack (Mongo, Express, Angular, Node) is a very popular stack right now and there are plenty of resources online (and on Stack Overflow) to get you started.
Check out the following guide for example:
http://jasonwatmore.com/post/2015/12/09/mean-stack-user-registration-and-login-example-tutorial

Expressjs not sure how to handle multiple users

This is more of a conceptual question. I am trying to build an expressjs app in which when a user starts I would need to make a temp folder for each user to store some files. I am not sure how to handle this scenario.
I am not much experienced on server side development and this would be my first node/expressjs project.
I am sorry no code yet as I am still clueless how to approach the above problem. I looked into express-session and my current approach would be to create a session and use session id a the folder name.
can anybody guide me towards a more robust approach.
You would need to use Node file system:
https://nodejs.org/api/fs.html#fs_fs_mkdtemp_prefix_callback
There are also lots of npm packages for this you could use which might make it even simpler.
something like this: https://www.npmjs.com/package/tmp
Since you are using sessions, get the username out of the session and then use that to along with a timestamp to create a folder name that wouldn't run into any duplicate names.

Is Node.js suitable for my project given how I'm using it?

I'm about to start writing an application and I want to include newer technologies to improve my knowledge and gain a skill set.
I'm using mysql to store user data (no choice), Angular.js to display/template content on the dom, and I wanted to use node.js to return results from the database in json format to be used by Angular.js.
My assumption was I could use node.js (along with the node-mysql module and maybe express)to accomplish my database queries that feed into my Angular.js templates.
Additionally, the application will live on a different server than the database itself and may reside in a mobile framework.
Am I way off base when it come to how to use node.js? Am I just using the wrong tool? Am I on the right track?
Any help, explanation, and points in the right direction would be great. Most of the info I've seen are copy/paste from the node.js site/wiki and don't really answer my question.
This is largely an opinion-based question and likely to be closed, but you're not way off base. What you want to do is absolutely (and commonly) done using Node.js.
As a complete aside, you might like to check out Platform-as-a-Service providers such as Heroku.com and Nodejitsu.com; both offer great and easy Node.js hosting and addons (such as NoSQL and RDBMS data stores) which have free tiers.
For that matter, MongoLab and MongoHQ both offer free tiers independent of Heroku, which you could use from your MySQL-only hosting provider if you like.

Categories

Resources