- Notifications
You must be signed in to change notification settings - Fork194
The NPR visuals team's opinionated project template for client-side apps.
License
nprapps/app-template
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
- About this template
- Assumptions
- Copy the template
- Configure the project
- Bootstrap issues
- Develop with the template
This template provides a a project skeleton suitable for NPR projects that are designed to be served as flat files. Facilities are provided for rendering html from data, compiling LESS into CSS, deploying to S3, installing cron jobs on servers, copy-editing via Google Spreadsheets and a whole bunch of other stuff.
This codebase is licensed under theMIT open source license. See theLICENSE
file for the complete license.
Please note: logos, fonts and other media referenced via url from this template arenot covered by this license. Do not republish NPR media assets without written permission. Open source libraries in this repository are redistributed for convenience and are each governed by their own license.
Also note: Though open source, This project is not intended to be a generic solution. We strongly encourage those who love the app-template to use it as a basis for their own project template. We have no plans to remove NPR-specific code from this project.
If you want to setup a version of the app template for yourself, readthis blog post about how to do so.
The following things are assumed to be true in this documentation.
- You are running OSX.
- You are using Python 2.7. (Probably the version that came with OSX.)
- You havevirtualenv andvirtualenvwrapper installed and working.
- You have NPR's AWS credentials stored as environment variables locally.
For more details on the technology stack used with the app-template, see ourdevelopment environment blog post.
Create a new repository on Github. Everywhere you see$NEW_PROJECT_NAME
in the following script, replace it with the name of the repository you just created.
git clone git@github.com:nprapps/app-template.git $NEW_PROJECT_NAMEcd $NEW_PROJECT_NAMEmkvirtualenv $NEW_PROJECT_NAMEpip install -r requirements.txtnpm installfab bootstrap
This will setup the new repo and will replaceREADME.md
(this file) withPROJECT_README.md
. See that file for usage documentation.
By defaultbootstrap
will usenprapps
as the Github username, and the current directory name as the repository name.This is a best practice, but you can override these defaults if you need to:
fab bootstrap:$GITHUB_USERNAME,$REPOSITORY_NAME
Problems installing requirements? You may need to run the pip command asARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install -r requirements.txt
to work around an issue with OSX.
The app-template can automatically setup your Github repo with our default labels and tickets by runningfab issues.bootstrap
. You will be prompted for your Github username and password.