Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app: Social Profile App #5

Closed
6 tasks
rsodre opened this issue Apr 22, 2024 · 22 comments · Fixed by #10
Closed
6 tasks

app: Social Profile App #5

rsodre opened this issue Apr 22, 2024 · 22 comments · Fixed by #10
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed ODHack

Comments

@rsodre
Copy link
Contributor

rsodre commented Apr 22, 2024

To be able to tag Discord users when their Duelist receives a notification, like new Challenges (#4), we need to link their Discord and Pistols profiles.

This app is supposed to bare minimum, including a Discord login and a Pistols/Dojo wallet login.

For the sake of simplicity (and because the supported wallets for Pistols are TBD), instead of connecting a wallet, players can simply paste their duelist account address.

Tasks

  • Copy the underware.gg contents to /social-app as a starting point. It is a simple next.js app, with a single page already in Pistols styling.
  • Use the Discord SDK for login and anything else we require that it provides. SDK Docs are here.
  • Create a Login with Discord button, using the Discord OAuth2 API
  • When logged in, display a simple Dashboard with the Discord Id and profile picture
  • The dashboard contains a simple form to edit the player's duelist address
  • Store the duelist address at Supabase, using Discord User Id as key. We will provide the API keys and database schema.

Notes

There are a few missing pieces here to make it work...

  • Does the Discord API allow us to store custom information linked to our app?
  • If not, is there any extension to do that?
  • If not, is there a secure way to store make this Discord-Address link on-chain, on the Pistols Dojo world?
  • The user address must be accessible from the bot!

If you have knowledge of the Discord API and/or have a solution for this, please reply explaining how would you do it.

@rsodre rsodre added good first issue Good for newcomers help wanted Extra attention is needed ODHack labels Apr 22, 2024
@rsodre rsodre changed the title Social Profile App app: Social Profile App Apr 22, 2024
@Dprof-in-tech
Copy link
Contributor

hi @rsodre

The discord api does not expressly allow us to store information but we can utilize a database system linked to our app to store the users pistols/Dojo wallet addresses and only authenticate them using the discord login id.

Then we can create a backend endpoint to retrieve this user address based on the discord login before making it available to the discord bot.

I think I can work on this.

@rsodre
Copy link
Contributor Author

rsodre commented Apr 22, 2024

The discord api does not expressly allow us to store information but we can utilize a database system linked to our app to store the users pistols/Dojo wallet addresses and only authenticate them using the discord login id.

you mean something like supabase?

@Dprof-in-tech
Copy link
Contributor

The discord api does not expressly allow us to store information but we can utilize a database system linked to our app to store the users pistols/Dojo wallet addresses and only authenticate them using the discord login id.

you mean something like supabase?

yeah
supabase
firebase
mysql
postgresql

anyone works

@rsodre
Copy link
Contributor Author

rsodre commented Apr 22, 2024

ok, will be assigning this to you.
I was going to use our website as a template since it is just a simple next.js app with some basic styling taken from pistols.

But I don't want to make you way wait, could you do that?
Copy it to /social-app

@rsodre
Copy link
Contributor Author

rsodre commented Apr 22, 2024

About the database, if we can't store in on Discord, the best approach would be to store on-chain.
Will be reviewing it in a few hours

@Dprof-in-tech
Copy link
Contributor

About the database, if we can't store in on Discord, the best approach would be to store on-chain. Will be reviewing it in a few hours

ok then.
let's see how easy it is to store the data on chain and then retrieve it so the bot can access it

@Dprof-in-tech
Copy link
Contributor

ok, will be assigning this to you. I was going to use our website as a template since it is just a simple next.js app with some basic styling taken from pistols.

But I don't want to make you way wait, could you do that? Copy it to /social-app

I sure can do this.

@Dprof-in-tech
Copy link
Contributor

Dprof-in-tech commented Apr 22, 2024 via email

@rsodre
Copy link
Contributor Author

rsodre commented Apr 22, 2024

The README here explains the setup process
https://github.com/underware-gg/pistols-discord-bot/tree/main/discord-bot

Let's use this server to configure and test it:
https://discord.gg/YVDqKCgU

@Dprof-in-tech
Copy link
Contributor

Dprof-in-tech commented Apr 22, 2024 via email

@rsodre
Copy link
Contributor Author

rsodre commented Apr 22, 2024

The main issue here is to link a Discord user with their duelist address.
A running bot is not required, it just needs to be configured.
You can create a Discord app on your Discord account to test it out. Once it is working and ready, we create our Discord app, with the same configurations and change the codes.

For user authentication:
https://discord.com/developers/docs/topics/oauth2

For storing the address, I was thinking we could use this, but it's not clear to me if that's what we need. I think not...
https://discord.com/developers/docs/resources/application-role-connection-metadata

Googling it everyone says the same as you said, we need a database.
If that's the case... I need to extract some Dojo components from Pistols to use on this app and store it all on-chain, we'll setup a supabase database for it...

@Dprof-in-tech
Copy link
Contributor

ok then , supabase it is

@rsodre
Copy link
Contributor Author

rsodre commented Apr 22, 2024

I updated the issue description according to what we've been discussing

@Dprof-in-tech
Copy link
Contributor

i've seen it and i'm moving on with the new description

@Dprof-in-tech
Copy link
Contributor

i've been working on the login process but nextauth keeps returning an error. I'm trying to find an alternative to using nextauth

@Dprof-in-tech
Copy link
Contributor

i've been working on the login process but nextauth keeps returning an error. I'm trying to find an alternative to using nextauth

I've solved that and I've been able to retrieve the user details after they login. now to create the form for the duel wallet address

@Dprof-in-tech
Copy link
Contributor

@rsodre i just pushed the majority of the tasks, its remaining the database which is to be discussed.
Also created a discord bot for testing purposes and the details are in the .env.example file so to test run for yourself, just copy it to .env.local file

@rsodre
Copy link
Contributor Author

rsodre commented Apr 23, 2024

Looking good, thank you!

Our Supabase account has reached a limit, we'll decide tomorrow how to proceed

@Dprof-in-tech
Copy link
Contributor

ok then.
could you assign me to another issue so I can continue building?

@Dprof-in-tech
Copy link
Contributor

Dprof-in-tech commented Apr 23, 2024 via email

@rsodre
Copy link
Contributor Author

rsodre commented Apr 23, 2024

Ok, you would be good for #6, #7, #8, but now they all depend on #1 being ready
Looking at it right now

@Dprof-in-tech
Copy link
Contributor

Dprof-in-tech commented Apr 23, 2024 via email

@Dprof-in-tech Dprof-in-tech mentioned this issue May 1, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed ODHack
Projects
None yet
2 participants