/contrib-rewards

A tool that lets users reward contributions to learning content

Primary LanguageTypeScriptMIT LicenseMIT

Technologies

  • Next.js (React)
  • Prisma + MySQL
  • Tailwind CSS

Getting Started

First, install the dependencies:

yarn

Next, copy .env to an .env.local file and edit this local file with your environment values.

Use this command to generate the secrets and copy them along to the .env.local file:

yarn generate-secrets

Additionally, NEXT_PUBLIC_OAUTH_CLIENT_ID and OAUTH_SECRET_ID will be given by a Login Module admin, they are in the OAuth client page of the Login Module (cf below). And NEXT_PUBLIC_TEZOS_SMART_CONTRACT_ADDRESS is the address of the Tezos smart contract (cf below).

Create a MySQL database and run yarn prisma-push to seed it.

Finally, run the development server:

yarn dev

Open http://localhost:3000 with your browser to see the result.

Login Module configuration

Here are the fields to specify in the login module configuration for this client:

Redirect: http://localhost:3000/api/auth/callback/france-ioi
Required user attributes: login, first_name, last_name, primary_email
Recommended user attributes: picture
Verification: primary_email
Verification methods: Sending a code by email

Tezos smart contract deployment

The smart contract to deploy is in the file contract.py.

Don't forget to change the public key publicKey by the value generated by running yarn generate-secrets. The corresponding secret key should be added to your .env.local file.