GithubHelp home page GithubHelp logo

sumonst21 / opencollective-invoices Goto Github PK

View Code? Open in Web Editor NEW

This project forked from opencollective/opencollective-pdf

0.0 2.0 0.0 4.96 MB

The Open Collective Invoices Server

License: MIT License

Dockerfile 1.18% JavaScript 91.33% Shell 7.49%

opencollective-invoices's Introduction

Open Collective Invoices

Circle CI Slack Status Dependency Status Greenkeeper badge codecov

Foreword

If you see a step below that could be improved (or is outdated), please update the instructions. We rarely go through this process ourselves, so your fresh pair of eyes and your recent experience with it, makes you the best candidate to improve them for other users. Thank you!

Development

Prerequisite

Make sure you have Node.js version >= 10. We recommend using nvm: nvm use.

Install

We recommend cloning the repository in a folder dedicated to opencollective projects.

git clone [email protected]:opencollective/opencollective-invoices.git opencollective/invoices
cd opencollective/invoices
npm install

Environment variables

This project requires an access to the Open Collective API. You have two options:

  • cp .env.staging .env to connect to the Open Collective staging API
  • cp .env.local .env to connect to the API running locally

If you decide to pick the local strategy, make sure you install and run the opencollective-api project.

Start

To start the service:

npm run dev

Usage with fixture data

This is the easy way to start developing. Just go to the root URL http://localhost:3002/ to see a list of test pages and click on any of them to load it in the right pane.

The page will auto-refresh everytime a change is made.

Usage with frontend

If you use this service through local frontend, you're ready to go - frontend will pass your authorization token directly to the app.

However this is not practical to develop, you should only use it to debug the bridge between the two services.

Calling URLs directly

This method can be usefull to debug staging or production invoices, or to work with you local development data. It is also the best way if you need to make changes to the graphql queries.

The easier to make it work is to go to /:your_profile/applications on the frontend, generate an api key, and to add ?app_key=your_key_here to all your requests.

Tips

  • Replace .html by .pdf to see the generated pdf.
  • Add ?pageFormat=A4 with A4 or Letter to change page format
  • Add ?debug=true to the URL to see verbose data on the document
  • Add ?raw=true to disabled HTML sanitazing (useful to debug missing attributes)

Contributing

Code style? Commit convention? Please check our Contributing guidelines.

TL;DR: we use Prettier and ESLint, we do like great commit messages and clean Git history.

Tests

You can run the tests using npm test.

Deployment

To deploy to staging or production, you need to be a core member of the Open Collective team.

(Optional) Configure Slack token

Setting a Slack token will post a message on #engineering with the changes you're about to deploy. It is not required, but you can activate it like this:

  1. Go to https://api.slack.com/custom-integrations/legacy-tokens
  2. Generate a token for the OpenCollective workspace
  3. Add this token to your .env file:
OC_SLACK_USER_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Staging (now)

npm run deploy:staging

Production (now)

npm run deploy:production

opencollective-invoices's People

Contributors

betree avatar greenkeeper[bot] avatar dependabot-support avatar znarf avatar dependabot-preview[bot] avatar pietgeursen avatar

Watchers

James Cloos 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.