xonecas.io
4436
Sl

sesame-labs-coding-assignment / files

sesame-labs-coding-assignment / README.md

3.8 KB
1# Sesame Coding Assignment
2
3### Setting up this project:
4
5Project 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.
6
7**Installing**
8
91. Copy the file [./api/.env.sample](./api/.env.sample) to a new file called `.env` in the same location. Then edit the file to include the required credentials and IDs.
10   Note: To get the IDs you will need to have your discord client in developer mode to access the data.
111. Rename the file [./ui/.env.sample](./ui/.env.sample) to `.env`
12
131. At the api folder:
14   ```
15   npm i && npx prisma migrate dev
16   ```
171. At the UI folder:
18   ```
19   npm i
20   ```
21
22**Running**
23
241. To start the api server, type this command in the `api` folder: `npx ts-node ./src`
251. To start the ui server, type this command in the `ui` folder: `npm start`
26
27   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.
28
291. You should have a new browser tab pointing to `http://localhost:3000/`, if not please open this URL with your browser.
30
31Note: 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`
32
33---
34
35### Build a Discord Questing Platform
36
37Welcome to Sesame’s coding challenge, in which you will build a Questing Platform ([https://bit.ly/sesame-coding](https://bit.ly/sesame-coding)) that rewards people with coupon codes for joining a Discord server.
38
39**Product Requirements**
40
41- The user should be able to sign in on the webpage with their MetaMask wallet
42- 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).
43- 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.
44- 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.
45- 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
46- 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](https://bit.ly/sesame-coding)
47
48**References**
49
50- Quest3 ([https://app.quest3.xyz/quest/691059696896696692](https://app.quest3.xyz/quest/691059696896696692)) can be used for reference for how the Join Discord flow and the verification should work. Feel free to use that as reference when designing your solution.
51
52**Directions**
53
54- Take about 8 hours to work on this assignment. Please complete this exercise yourself, however feel free to Google and use other references.
55- 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.
56- 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
57- 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.
58- Please reach out if you have any questions.