Devlog - 8
Big devlog, here we go again.
Lets talk about nextjs first.
So I added magic link to the app as the feedback I received was I don’t wanna use my google account as I don’t the trust the website enough to use it and I also want to use all the features so guest won’t work. This pushed me to add somewhat of a email login. I dont like password login so I wanted to add passwordless login and it wasn’t a debate I just picked one which is magic link.
- I am using resend for sending emails and i already have a domain for the app so using that for send email with auth@mydomain
- I created a template in resend dashboard itself so i can direclty use it in my nextjs app.
Now lets talk about the big thing which made this a long devlog !!! Drum Roll please 🥁🥁🥁 I decided to restructure many parts of my socket server because of scalability as my previous architecture wouldn’t have survived If i added more gamemodes and all.
What were the flaws
- Room was acting like if it was the party and the game
- Current gamemode is available is guess the agent so all the connecting modules were designed based on that which would have made adding other gamemodes impossible.
- There was no generic game module it was just Guess the Agent
What I did
- Changed room to game and separated game ( previously room ) from party and added a separate events and module for party and party gets stored in redis as well.
- Inside the game module added a core folder where core mechanics (listener, types, service) of each game regardless of gamemode lives.
- Each gamemode has its own folder inside game containing the logic specific to that game.
- Redis player now has a partyId element too.
- Improved player presence (connection and disconnect) and using switch statements in places where if the mode is different some logic might be different.
Why did it took so much time and What I learnt.
Because when I started the restructure I didn’t know how my architecture would look like or what would work ( still haven’t tested anything ). So I researched some stuff but some stuff you decide along the way.
I learnt that no matter what the project is and what you decide at the start that you are gonna build there will always be a time where the plans fail and we have to decide should we go through with it or suffer in the future or should we just focus right now and work hard so that in the future it all comes back to us with a lots of happiness!!!
Cheers,
Neerav
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.