The front-end of the Agaetis website.
Project created with:
- React: 17.0.2
- NextJS: 11.0.1
- Typescript: 4.3.5
- TailwindCSS: 2.2.4
We use the package manager yarn
git clone https://github.com/Agaetis-IT/agaetis-web-front
cd agaetis-web-front
yarn install
yarn start
Then visit http://localhost:5000
You need an accessible Wordpress for the website to work, whose url needs to be added in a .env
file (on root directory) with NEXT_PUBLIC_BASE_URL
.
You can find below an example of .env
file:
NEXT_PUBLIC_BASE_URL=<URL to Wordpress>
NEXT_PUBLIC_SITE_URL=http://127.0.0.1:5000
NEXT_MAIL_ADDRESS=<Mail address for the website>
NEXT_MAIL_DEST=<Mail to send contact mails to>
NEXT_GMAIL_CLIENT_ID=<GMail client ID>
NEXT_GMAIL_CLIENT_SECRET=<GMail client secret key>
NEXT_GMAIL_REFRESH_TOKEN=<GMail client refresh token>
NEXT_PUBLIC_GOOGLE_ANALYTICS_KEY=<Analytics key>
NEXT_PUBLIC_RECAPTCHA_KEY=<ReCaptcha key>
NEXT_RECAPTCHA_SECRET=<ReCaptcha secret key>
NEXT_PUBLIC_CONTACT_SALT=<Contact salt key>
You'll find this example in .env-sample
.
To follow the steps below, you have to create a gmail account (or have one already)
- Visit https://console.developers.google.com/
- Create a new project by clicking "Select a project" and "New Project"
- Edit Project's name and create
- Go to "Credentials" (Identifiants)
- Create Credentials by clicking the button on top and select ID Client OAuth
- Choose Web App as Application type
- Add site url and https://developers.google.com/oauthplayground as authorized redirect URI
- A Modal should appear then copy Client ID and Client Secret and paste them in the .env NEXT_GMAIL_CLIENT_ID & NEXT_GMAIL_CLIENT_SECRET
- Visit https://developers.google.com/oauthplayground
- Change the settings by clicking the setting button ont top right
- Check "use your own OAuth credentials and provide your clientID and clientSecret
- In the Step1 list find Gmail API v1 and select https://mail.google.com, gmail.insert, readonly and send
- Click 'Authorize API'
- Go to Step 2 and exchange authorization code for tokens
- Copy Refresh Token and paste it in the .env NEXT_GMAIL_REFRESH_TOKEN veriable
- Add your email address to the .env NEXT_MAIL_ADDRESS
It should be correctly working, if not clap your hands and i'll try to solve the problem and update the README.
To create reCAPTCHA keys, you need a google Account
- Visit https://www.google.com/recaptcha/admin/create
- Add a project name
- Choose the reCAPTCHA version 2
- As the domain, use your site base url (without http and /), if you are running the site in local, add 127.0.0.1
- Add the mail of the admin
- Accept the terms of use and click send
- Copy the public key in .env as NEXT_PUBLIC_RECAPTCHA_KEY
Now, you should be able to access statistics about your captcha in this same page