This repository is an ongoing training exercise used to teach full-stack web development from the ground up. The goal is to develop a robust blogging application over time and, in doing so, learn:
In addition, the developer will learn to use:
The application requires Git, Node/NPM, Bower and PostgreSQL to be installed. You should also install an integrated development environment, or IDE.
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. It is commonly used by software engineering teams in conjunction with GitHub.com for collaboration.
Node.js is a JavaScript runtime built on the Chrome web browser's V8 JavaScript engine. It is most often used for writing server-side JavaScript. Node Package Manager (NPM) is bundled with it, and is used to easily install and manage code libraries that an application requires. Bower is similar to NPM, but is used to install and manage libraries needed for client-side JavaScript.
PostgreSQL is a powerful, open source object-relational database management system (RDBMS). It has more than 15 years of active development and a proven architecture that has earned it a strong reputation for reliability, data integrity, and correctness. It runs on all major operating systems, including Linux, UNIX (AIX, BSD, HP-UX, SGI IRIX, macOS, Solaris, Tru64), and Windows.
Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs and geospatial indexes with radius queries. Other features include:
Transactions
Publish/Subscribe
Lua scripting
Keys with a limited time-to-live
LRU eviction of keys
Automatic failover
An integrated development environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of a source code editor, build automation tools and a debugger. Most modern IDEs have intelligent code completion and integration with version control tools like Git.
Choose one, or try them all:
To install the app, be sure you have installed all of the prerequisites (see above) and then follow these instructions.
Using the SSH protocol, you can connect and authenticate to remote servers and services. With SSH keys, you can connect to GitHub without supplying your username or password every time you commit and push changes to your code.
Detailed instructions on connecting to GitHub with SSH can be found here: https://help.github.com/articles/connecting-to-github-with-ssh/
A fork is a copy of a repository. Forking a repository enables you to freely experiment with changes without affecting the original project. Begin by forking this repository on GitHub.
Detailed instructions on forking can be found here: https://help.github.com/articles/fork-a-repo/
When you create a repository on GitHub, it exists as a remote repository. You can clone your repository to create a local copy on your computer and sync between the two locations. From the command line, navigate to a directory where you want to keep all of your Git repositories and use the command:
$ git clone git@github.com:YOUR_USERNAME/something-awesome.git
Be sure to replace YOUR_USERNAME
with your GitHub username!
Detailed instructions on cloning can be found here: https://help.github.com/articles/cloning-a-repository/
You must configure a remote that points to the upstream repository in Git to sync changes you make in your fork with the original repository. This also enables you to sync changes made in the original repository with your fork. From the command line, navigate to the directory of your cloned repository and use the command:
$ git remote add upstream git@github.com:sscovil/something-awesome.git
Detailed instructions on adding an upstream remote can be found here: https://help.github.com/articles/configuring-a-remote-for-a-fork/
This project uses Node Package Manager (NPM) to manage server-side application dependencies, and and Bower to manage client-side dependencies. Eventually we will eliminate the need for Bower by utilizing a build system, but for now this keeps things clean so we can avoid serving files from our node_modules
directory.
From the command line, use the command:
$ npm install && bower install
More on installing dependencies with NPM: https://docs.npmjs.com/getting-started/using-a-package.json
More on installing dependencies with Bower: https://bower.io/docs/creating-packages/#bowerjson
From the command line, navigate to the root directory of the repository and use the command:
$ node src/app.js
With the server running, open your favorite web browser and visit: http://localhost:3000
In order to prevent uploading private keys, this repository uses a .env file for storing environment variables.
We list .env as a file type in our .gitignore file in order to make sure that the .env file is never committed.
For example, if you want to specify the port number, you would set the PORT
environment variable in the .env file like so:
PORT=8080
Environment Variables Supported:
More on dotenv: https://www.npmjs.com/package/dotenv
To stop the server, use CTRL+C
.