You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
3.1 KiB

2 years ago
  1. # Front-end election web application using NextJs
  2. [![aGPLV3](https://img.shields.io/github/license/MieuxVoter/mv-front-react)](./LICENSE.md)
  3. [![Netlify Status](https://api.netlify.com/api/v1/badges/021c39c6-1018-4e3f-98e2-f808b4ea8f6d/deploy-status)](https://app.netlify.com/sites/epic-nightingale-99f910/deploys)
  4. [![Join the Discord chat at https://discord.gg/rAAQG9S](https://img.shields.io/discord/705322981102190593.svg)](https://discord.gg/rAAQG9S)
  5. :ballot_box: This project is going to be the default front-end for our [election application](https://app.mieuxvoter.fr).
  6. :computer: It is connected to our [back-end](https://github.com/MieuxVoter/mv-api-server-apiplatform). The back-end is used for storing the votes and computing the majority judgment ranking. You can use our back-end free of charge, but you can also start your own instance of the back-end using our Dockerfiles.
  7. :incoming_envelope: The front-end is responsable for sending the invitation mails. You can find the mail templates [on the functions folder](./functions/send-invite-email).
  8. :world_map: The front-end stores its own translations. See below how you can edit them easily.
  9. ## :paintbrush: Customize your own application
  10. The separation between the front-end and the back-end makes it easy to customize your own application. Just install
  11. ## :gear: Install options
  12. **Option one:** One-click deploy
  13. [![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/MieuxVoter/mv-front-react&utm_source=github)
  14. **Option two:** Manual clone
  15. 1. Clone this repo: `git clone https://github.com/MieuxVoter/mv-front-nextjs.git`
  16. 2. Navigate to the directory and install dependencies: `npm install` or `make`
  17. 3. Start a local server: `npm run dev` and open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
  18. 4. Make your changes
  19. 5. Deploy your project.
  20. We advise for deploying the project to [Netlify](https://netlify.com), because we wrote the mail functions for the framework. Netlify parameters are written in `netlify.toml`.
  21. If you decide to deploy your project in another way, please fill a pull-request to guide futur users!
  22. ## :incoming_envelope: Support for mail
  23. To add support for mail sending, you need to connect the application with a mailing service. For now, we only support [Mailgun](mailgun.com), which offer very competitive prices. You can fill an issue if you require another mailing service.
  24. To connect your application with Mailgun, you need to add the environment variables to your project:
  25. - `MAILGUN_API_KEY`,
  26. - `MAILGUN_DOMAIN`,
  27. - `MAILGUN_URL`,
  28. - `FROM_EMAIL_ADDRESS`,
  29. - `CONTACT_TO_EMAIL_ADDRESS`.
  30. You can add the environment variables on an `.env` file or directly on [Netlify](https://docs.netlify.com/configure-builds/environment-variables/).
  31. ## :world_map: I18N at heart
  32. You can directly modified the translation files in the folder `public/locales`.
  33. In case you want to add support for another language, you need as well to add it on `net-i18next.config.js` and on the `LanguageSelector` component.