Giter Site home page Giter Site logo

opencollective / funders-dashboard Goto Github PK

View Code? Open in Web Editor NEW

This project forked from opencollective/opencollective-frontend-template

2.0 2.0 1.0 3.25 MB

Home Page: funders-dashboard.vercel.app

License: MIT License

JavaScript 0.96% TypeScript 99.04%

funders-dashboard's Introduction

Open Collective Frontend template

This project is meant to provide the base layer to kickstart a new frontend project at Open Collective. The goal is to provide a solid foundation to build upon, while making sure we can bring back the code to the main Open Collective codebase whenever we need.

Currently included

  • Next.js for server-side rendering and routing
  • Styled Components for styling, with our custom design system plugged in
  • Apollo for GraphQL queries
  • ESLint for linting, with our custom config & Prettier
  • Renovate for automated dependency updates
  • A minimal Github Actions CI config
  • A Vercel configuration for deployment and preview

To do:

  • Jest for testing
  • Depcheck
  • Import frontend's fonts
  • Husky pre-commit lint hook
  • Replace all <Link><a> with our custom link component from frontend
  • Invalidate OAuth tokens on logout

Getting Started

1. Fork the repository and install dependencies

Click on "Use this template" above (or alternatively, fork the repository) then clone it:

git clone https://github.com/opencollective/opencollective-frontend-template.git
cd opencollective-frontend-template
npm install

2. Configure your local environment

By default, the app will try to connect to the Open Collective staging API & frontend.

To run the template against your local frontend/api:

  1. Create a new OAuth app
  2. Run cp .env.local.example .env.local
  3. Edit .env.local and set OPENCOLLECTIVE_OAUTH_APP_ID and OPENCOLLECTIVE_OAUTH_APP_SECRET to your OAuth app credentials

Learn more about the environment variables in NextJS: https://nextjs.org/docs/basic-features/environment-variables.

3. Start the application

To run your site locally (default: http://localhost:3004), use:

npm run dev

To run it in production mode, use:

npm run build
npm run start

Development process

  • To update GraphQL schemas after an API change, run npm run graphql:update.

Deploy

  1. Create a new project on Vercel, pick your forked repository.
  2. On the "Configure Project" step, keep the default settings (NextJS), set the required Environment variables and click "Deploy":
    • NEXTAUTH_SECRET: a random string used to encrypt JWTs
    • OPENCOLLECTIVE_OAUTH_APP_ID: the ID of the OAuth app you created on the API
    • OPENCOLLECTIVE_OAUTH_APP_SECRET: the secret of the OAuth app you created on the API
    • NEXT_PUBLIC_OPENCOLLECTIVE_OAUTH_SCOPES: a comma separated list of OAuth scopes you want to request from the API (e.g. account,transactions)

funders-dashboard's People

Contributors

betree avatar renovate[bot] avatar znarf avatar

Stargazers

 avatar  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.