Giter VIP home page Giter VIP logo

project-m's Introduction

Project-M

Build Status

Dev setup

  1. Install vagrant

  2. Install ansible

  3. Clone the project

     git clone https://github.com/ppau/project-m.git
    
  4. Start the vagrant vm

     vagrant up && vagrant provision
    
  5. Log onto the vm

     vagrant ssh
    
  6. Find the project files

     cd /vagrant
    
  7. Install dependencies

     npm install
    
  8. Add stripe keys [Optional]

     1. First option is to add stripe config file:
             1. Make a file called stripe-config.json in /config file (see /config/strip-config.json.example for format)
             2. Visit [stripe](https://dashboard.stripe.com/test/dashboard)
             3. Click your account -> account settings
             4. Click API keys
             5. Add the ones you wish to use into /config/stripe-config.json (for test and dev)
    
     2. Second option is to declare them at run time:
             1. Add STRIPE_SECRET_KEY="somekey" to environment vars
             2. Add STRIPE_PUBLIC_KEY="anotherkey" to environment vars
             3. Alternatively, define them at runtime before npm start, see below
    
             eg: STRIPE_SECRET_KEY="sk_test_randomNumbersAndLetters" STRIPE_PUBLIC_KEY="anotherkey" npm start
    
     If you do both options, the run time declaration is used instead of the config file.
    
  9. Email configuration [Optional]

     1. Run `which sendmail` in a terminal
     2. Add EMAIL_SERVER="Path to sendmail" to environment vars
     3. Turn on the toggles for the emails that will be activated in each specific environment (config/default.json, config/staging.json, config/production.json)
         - For the verification email set "sendEmails" to true
    
  10. Run the tests

     npm test
    
  11. Run the acceptance tests

     1. First set up a admin email and admin password:
             export ACCEPTANCE_EMAIL=some email here
             export ACCEPTANCE_PASSWORD=some password here
     2. Start the server:
             npm start
     3. Then run:
             npm run acceptanceTests
    
  12. Start the server

     npm start
    

webpack

  1. npm install webpack -g

  2. webpack --progress --colors --watch

Tests

  1. Run server side tests

     npm run serverTests
    
  2. Run client side tests

     npm run componentTests
    
  3. Run a specific server side test

     NODE_ENV=test node --harmony node_modules/jasmine/bin/jasmine.js spec/integration/membersSpec.js
    
  4. Run smoke tests against an external target

     NODE_ENV=test INSTANCE_URL=http://myinstance.mydomain.com node --harmony node_modules/jasmine/bin/jasmine.js spec/integration
    

Utility scripts

  1. Migrate the database (run automatically as part and npm start or npm test)

     ./node_modules/sequelize-cli/bin/sequelize db:migrate
    
  2. Create an admin user to access the treasurer/secretary views

     npm run createAdmin
    

Pull a copy of the staging db from heroku

  1. heroku pg:backups capture --app <app_name>

  2. curl -o db/dumps/latest.dump heroku pg:backups public-url

  3. (in the vm) pg_restore --verbose --clean --no-acl --no-owner -h localhost -U project-m -d project-m db/dumps/latest.dump

Happy hacking!

Optional setup

JShint

  1. Install plugin

WebStorm

  1. Install webstorm

  2. Open preferences -> Languages and frameworks

  3. Change javascript to ECMAScript 6

  4. Setup run configuration to node and "javascript/file" to be bin/www

  5. Optionally install vagrant plugin

project-m's People

Contributors

akjones avatar bbqsrc avatar doddzz avatar fleur94 avatar natyoung avatar orangehb avatar pameck avatar rdoh avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.