Skip to content
README.md 2.61 KiB
Newer Older
Fabrice Salvaire's avatar
Fabrice Salvaire committed
# Donation Checkout Frontend
Fabrice Salvaire's avatar
Fabrice Salvaire committed

Fabrice Salvaire's avatar
Fabrice Salvaire committed
This application implements a donation checkout frontend using the [React](https://reactjs.org)
framework (16.8 hooks) and [Material-UI](https://material-ui.com) React components for [Material
Design](https://material.io/design).
Fabrice Salvaire's avatar
Fabrice Salvaire committed

Fabrice Salvaire's avatar
Fabrice Salvaire committed
## Features

* implement [WAI-ARIA](https://www.w3.org/TR/wai-aria) for accessibility

Fabrice Salvaire's avatar
Fabrice Salvaire committed
### reCAPTCHA Protection

* [Google reCAPTCHA](https://www.google.com/recaptcha)
* https://en.wikipedia.org/wiki/ReCAPTCHA
* https://developers.google.com/recaptcha/docs/v3
* https://github.com/t49tran/react-google-recaptcha-v3

* [hCaptcha](https://www.hcaptcha.com)
  hCaptcha is free to use for publishers of any size.
* https://github.com/hCaptcha/react-hcaptcha
* https://blog.cloudflare.com/moving-from-recaptcha-to-hcaptcha

Fabrice Salvaire's avatar
Fabrice Salvaire committed
# Alternative Implementations

Fabrice Salvaire's avatar
Fabrice Salvaire committed
* [Framasoft](https://framasoft.org/fr/#soutenir) which uses [Vue.js](https://vuejs.org) and
[BootstrapVue](https://bootstrap-vue.org).

# Discussion on the implementation

Actually popular frameworks are, sorted by trends:

1. [React](https://reactjs.org) backed by Facebook and the framework used by Wordpress
1. [Angular](https://angular.io) backed by Google and the successor of AngularJS
1. [Vue.js](https://vuejs.org) a popular framework created by Evan You, used by Alibaba

* [PReact](https://preactjs.com) a lightweight counterpart nearly compatible with the React API (4kB)
* [Riot](https://riot.js.org) a 7kB framework
* [Polymer](https://www.polymer-project.org)
Fabrice Salvaire's avatar
Fabrice Salvaire committed

Fabrice Salvaire's avatar
Fabrice Salvaire committed
## Issues
Fabrice Salvaire's avatar
Fabrice Salvaire committed

Fabrice Salvaire's avatar
Fabrice Salvaire committed
* duplicated code to to enforce that at least one toggle button must be active
Fabrice Salvaire's avatar
Fabrice Salvaire committed

# Running and Building the Application

Fabrice Salvaire's avatar
Fabrice Salvaire committed
Application is generated by the tool [Create React App](https://create-react-app.dev) that uses
Webpack internally.  See `package.json` for settings and
`node_modules/react-scripts/config/webpack.config.js`.
Fabrice Salvaire's avatar
Fabrice Salvaire committed

Note: **eslint-plugin-react-hooks** is included by default in Create React App.
Fabrice Salvaire's avatar
Fabrice Salvaire committed
1. Install [Node.js](https://nodejs.org/en) and [Yarn](https://yarnpkg.com) package manager
1. Install required packages in *node_modules* (it requires 425 MB of free space disk)
Fabrice Salvaire's avatar
Fabrice Salvaire committed
   yarn install

   or

Fabrice Salvaire's avatar
Fabrice Salvaire committed
1. Build and serve the application for development
Fabrice Salvaire's avatar
Fabrice Salvaire committed
   yarn start

   or

Fabrice Salvaire's avatar
Fabrice Salvaire committed
  **Note:** to customise the browser, uses e.g. `BROWSER="google-chrome" yarn start`
1. Go to http://localtest.me:3000/checkout
Fabrice Salvaire's avatar
Fabrice Salvaire committed
1. Build the application for production
Fabrice Salvaire's avatar
Fabrice Salvaire committed
   ```
   yarn build

   or

Fabrice Salvaire's avatar
Fabrice Salvaire committed
   npm run build
Fabrice Salvaire's avatar
Fabrice Salvaire committed
   ```
Fabrice Salvaire's avatar
Fabrice Salvaire committed

# Storybook

Start Storybook using `yarn storybook`

# Documentation using React Styleguidist

[React Styleguidist](https://react-styleguidist.js.org)

Start a style guide dev server using `npx styleguidist server`