xonecas.io

sesame-labs-coding-assignment

Project was built using the Node stable release at the moment (v19.4.0), please make sure you have a compatible node version. If you use nvm then you can use the command: `nvm use` and it should pick up the `.nvmrc` file included in this repo.

36 commits of 42 · 2023-01-13 to 2023-01-25 · 47 files

xonecasMerge branch 'assignment-self-code-review' into 'main'b9004362023-01-25
▸ api/ 2023-01-17
▸ ui/ 2023-01-17
· .gitignore 2023-01-17
· .nvmrc 2023-01-17
· README.md 2023-01-17

README.md

Sesame Coding Assignment

Setting up this project:

Project was built using the Node stable release at the moment (v19.4.0), please make sure you have a compatible node version. If you use nvm then you can use the command: nvm use and it should pick up the .nvmrc file included in this repo.

Installing

  1. Copy the file ./api/.env.sample to a new file called .env in the same location. Then edit the file to include the required credentials and IDs. Note: To get the IDs you will need to have your discord client in developer mode to access the data.

  2. Rename the file ./ui/.env.sample to .env

  3. At the api folder:

    npm i && npx prisma migrate dev
    
  4. At the UI folder:

    npm i
    

Running

  1. To start the api server, type this command in the api folder: npx ts-node ./src

  2. To start the ui server, type this command in the ui folder: npm start

    Note: Using the create react app dev server for convenience, in a production environment i'd use nginx or similar to serve the build folder.

  3. You should have a new browser tab pointing to http://localhost:3000/, if not please open this URL with your browser.

Note: If you'd like to wipe the db and redo the product flow, please use this command in the api folder: npx prisma migrate reset


Build a Discord Questing Platform

Welcome to Sesame’s coding challenge, in which you will build a Questing Platform (https://bit.ly/sesame-coding) that rewards people with coupon codes for joining a Discord server.

Product Requirements

  • The user should be able to sign in on the webpage with their MetaMask wallet
  • Once they have connected their wallet, they will see a Quest which asks them to join a certain Discord server to win a coupon code. There will be a Join Discord button (that triggers the Discord joining flow) and a Verify button (that verifies if the user has successfully joined the specified Discord server).
  • Once the user successfully verifies that they have joined the Discord they should see a coupon code. For the purposes of this project, the coupon code can be a random 10 digit alphanumeric string.
  • The user’s state (whether they have verified, which coupon code they have received, etc) should be stored in a DB so that it persists if the user signs in with their wallet again or even on server restart. Multiple different users should be able to use this product at the same time.
  • The Quest details (title, description, cover image uri, discord server name, etc) and any API keys (discord, etc) should be easily settable in a .config OR .env file
  • The UI is not the primary focus of this assignment however it needs to be good enough and fully functional. Here is roughly how it should look like: https://bit.ly/sesame-coding

References

Directions

  • Take about 8 hours to work on this assignment. Please complete this exercise yourself, however feel free to Google and use other references.
  • Please fork this repository to start working on this project. Add a detailed README that provides easily understandable instructions on how to run your code on local machine.
  • This will be followed by a 45 min interview where you will be asked to explain your decisions and asked to describe about challenges and opportunities with your solution
  • In addition to correctness, we will be evaluating based on code structure, readability, and extensibility. It does not need to be over-engineered, however should be solid production level code.
  • Please reach out if you have any questions.