/phoenix-next

🔥 The new DoSomething.org campaign template.

Primary LanguageJavaScript

Phoenix Next

This is Phoenix Next, the new campaign experience for DoSomething.org! It's built using Laravel 5.3, Contentful, React, and Redux and plays nicely with the rest of our team (Northstar, Rogue, and co.)

Installation

Fork and clone this repository to your computer, and then add to your local Homestead installation. Homestead provides a pre-packaged development environment to help get you up and running quickly!

For help on getting Homestead setup on your computer, refer to the following instructions.

Step 1: Dependencies & Environment

# Install dependencies:
$ composer install && npm install
    
# Copy the default environment variables:
$ cp .env.example .env

Step 2: Migrate Data

# Run database migrations:
$ php artisan migrate

Step 3: Build Assets

# And finally, build the frontend assets:
$ npm start

Step 4: Content Access

We use Contentful as our content management platform. Please setup an account and request access to the space used for this project. Once you have access, head to the APIs section for the space and then you can update your .env file with the correct API keys and Space ID for the project, allowing you to make requests to access the data from your local environment.

Testing

PHP

You may run PHP tests locally using PHPUnit, by running:

$ vendor/bin/phpunit

It would be easier to run the PHPUnit tests from within the Homestead Vagrant box.

JavaScript

You may run JavaScript tests locally using Jest, by running:

$ npm test

Linting

We use ESLint to lint our front-end JavaScript code. It runs in the following scenarios:

  • When using the npm start command, your files will be "watched" for changes, and when a change is detected, the JS code will be linted and only compiled if it passes.
  • You can manually execute linting the code by running npm run lint -s. The -s option lets you suppress the verbose NPM warnings that follows when there are linting errors.
  • Code linting also runs via Wercker our continuous integration service when a new pull request is made for the repository.

We use StyleCI service to lint our PHP code when a new pull request is made for the respository.

License

©2017 DoSomething.org. Phoenix is free software, and may be redistributed under the terms specified in the LICENSE file. The name and logo for DoSomething.org are trademarks of Do Something, Inc and may not be used without permission.