-
Notifications
You must be signed in to change notification settings - Fork 341
MERN on Ubuntu
Created by Rafase282
Github | FreeCodeCamp | CodePen | LinkedIn | Website | E-Mail
Info from here.
C9:
nvm install stable
nvm alias default stable
Ubuntu 15.10, Node.js v5.x:
curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
sudo apt-get install -y nodejs
io.js v3.x:
curl -sL https://deb.nodesource.com/setup_iojs_3.x | sudo -E bash -
sudo apt-get install -y iojs
Note that MongoDB only supports LTS versions of Ubuntu officially. More detailed instructions here.
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
sudo apt-get update
sudo apt-get install -y mongodb-org
Run this command to create the package.json
$ npm init
Follow the instructions and you should have something similar to this:
{
"name": "beginner-app",
"version": "1.0.0",
"description": "",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "MIT"
}
npm install --save express mongodb mongoose passport express-session react react-dom babelify babel-preset-react
This will install:
- Express.js
- MongoDB
- Mongoose
- Passport
- Express Session
- React.js
Now we have the fullstack dependencies and even passport and session support for login in and such. For this stack the required ones are express, mongodb, react, and mostlikelly mongoose.
Now the package.json
will look like this:
{
"name": "voting-app",
"version": "0.0.1",
"description": "A voting app that lets you create your own polls.",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Rafase282/Voting-App.git"
},
"keywords": [
"MongoDB",
"Mongoose",
"full stack",
"Express",
"Node",
"React",
"javascript",
"vote"
],
"author": "Rafael (Rafase282)",
"license": "MIT",
"bugs": {
"url": "https://github.com/Rafase282/Voting-App/issues"
},
"homepage": "https://github.com/Rafase282/Voting-App#readme",
"dependencies": {
"express": "^4.13.3",
"express-session": "^1.12.1",
"mongodb": "^2.1.0",
"mongoose": "^4.3.0",
"passport": "^0.3.2",
"react": "^0.14.3"
}
}
Now let's spend a few moments to create the file structure we'll be using.
+-- Project Folder
+-- app
| \-- controllers
| \-- routes
|
+-- public
| \-- css
| \-- img
More details here.
Thanks for visiting, if you like this please feel free to star my repo, follow me or even contact me about contributing as it will be a lot of work and having help would be cool.
- HTML5 and CSS
- Responsive Design with Bootstrap
- Gear up for Success
- jQuery
- Basic JavaScript
- Object Oriented and Functional Programming
- Basic Algorithm Scripting
- Basic Front End Development Projects
- Intermediate Algorithm Scripting
- JSON APIs and Ajax
- Intermediate Front End Development Projects
- Claim Your Front End Development Certificate
- Upper Intermediate Algorithm Scripting
- Automated Testing and Debugging
- Advanced Algorithm Scripting
- AngularJS (Legacy Material)
- Git
- Node.js and Express.js
- MongoDB
- API Projects
- Dynamic Web Applications
- Claim Your Back End Development Certificate
- Greefield Nonprofit Project 1
- Greefield Nonprofit Project 2
- Legacy Nonprofit Project 1
- Legacy Nonprofit Project 2
- Claim your Full Stack Development Certification
- Whiteboard Coding Interview Training
- Critical Thinking Interview Training
- Mock Interview 1
- Mock Interview 2
- Mock Interview 3