Stuff for HR Presentation
- Install Python & pip & other deps
$ brew update
$ brew install python
$ pip install --upgrade distribute
$ pip install --upgrade pip
$ brew install ssh-keygen
$ brew install awscli
- Download EB CLI:
$ pip install --upgrade --user awsebcli
- Add Python to path:
$ python --version
- Then add the following to your
.bash_profile
or.path
:PATH=~/Library/Python/2.7/bin:$PATH
- Create IAM user and group
- Configure your AWS profile on the CLI
$ aws configure --profile [yourprofile]
- Use
us-west-2
for region name andjson
for format - Check out
~/.aws
to see the setup
- Initialize your EB configuration on the project
$ eb init --profile [yourprofile]
- Create RDS instance
- Configure the EBS environment
- Static files: Virtual Path:
/static/
, Directory: `/public/ - Environment properties:
NODE_ENV=production
NPM_CONFIG_PRODUCTION=true
RDS_CONNECTION_URL=postgres://[db_user]:[db_password]@[connection_url]/[db_name]
- Static files: Virtual Path:
- Add PostgreSQL connection to inbound rules of security group
TodoMVC++ : Taking TodoMVC To Production
TodoMVC++ is the companion application for Zero to Production with Node.js. To learn more about how this application works, check out the video course on Frontend Masters.
This application is based on TodoMVC, and specifically on a Vue.js implementation by Evan You.
Running Locally
Installing Node.js and npm
This application has been tested on Node.js 6 and npm 3 - these packages should be available for download here - choose the "Current" version for download.
Installing Node.js modules
Once you have Node and npm installed and this repository downloaded, you'll need to install the application's dependencies. Do this with:
npm install
For development you'll probably want to install the following modules globally:
npm install -g grunt-cli sequelize-cli
Setting up the database
To run this application locally, you'll require a Postgres database. On a Mac, the easiest path to installing Postgres is Homebrew. Once installed, grab Postgres with:
brew update
brew install postgres
If Postgres is installed using the method above, you should now have a few Postgres administrative commands on your system path. Begin by firing up another Terminal tab and starting the database:
postgres -D /usr/local/var/postgres
Next, create the development and test databases:
createdb todos
createdb todos-test
If Postgres is not installed locally, you can setup a free instance as follows:
- visit https://elephantsql.com
- login and setup a free tiny turtle instance
- goto "Details" and copy the url. It should look something like this postgres://abcdefg:icRAC...
- in the project, copy
config/test.js
toconfig/user.js
- set
config.databaseUrl
to your copied postgres url - don't forget to run
sequelize db:migrate
Apply the database migrations:
sequelize db:migrate
Copy over static assets:
grunt collect_static
Running the application
To run the application in development mode:
grunt
To run the application simulating production settings:
NODE_ENV=production
grunt collect_static
npm start
License
MIT