Fungible Token Fullstack Assessment
Currently there is a Login (new users must be added through the DB directly). Login is handled through Supabase Auth, rather than connecting a wallet and going that route. There are RLS policies setup (authZ) so that users can only access their own data.
After login, users are presented with a screen that shows a list of the top 100 tokens (by Market Cap) from Coingecko's free API. Users are able to "favorite" any of those tokens and add them to or remove them from a watch list.
Tokens which are on the watchlist also have sparkline data from the last 7 days displayed.
After spending most of the first day digging into what was possible to pull directly from the Solana blockchain, I realized there was too much for me to learn on my own and opted for the Coingecko API. Since I have recent experience with Supabase, I chose to go down that route for the data store, which also gave me auth out of the box, rather than attempting to integrate with a wallet as an auth provider (which I don't have experience with yet).
I opted to use a hybrid approach between client side state and server side storage, mostly to demonstrated that I can use either (although I'll admit, I'm not super happy with my approach yet!).
I chose Radix as the UI library, mostly because it was part of the stack, but also because it seemed to have everything I would need. I chose zustand as the client side state manager because it's awesome.
The Token list UI isn't superb - it should have a minimum height and should always take up as much vertical space as possible. But my focus was on getting a snappy UI with as quick of response times as possible over perfecting the layout size, given the time I had.
I also chose to use the NextJS proxy for calls to coingecko to avoid any CORS errors, which intermittently showed up.
If I had a week to work on this, I would look next at:
- Logging
- Error handling
- Integration with a wallet for authN
- What other data optimizations could be made
- More real-time data
- Animations last (but not to downplay the effect of innovative UX)
To run all of this locally:
-
Checkout this repo and run
npm i. Everything should install without issue. 🙏 -
Get supabase setup and running. We're basically going to follow the instructions straight from (supabase|[https://supabase.com/docs/guides/self-hosting/docker]), but we're going to use my supabase .env file instead of the
cp .env.example .envcommand they want you to run. **You may be able to just rundocker-compose up -dfrom thesupabasedirectory in this repo (I've used docker, never set it up myself). If that works, you're golden. Otherwise you will need to move the.envfile from this repo'ssupabasedirectory into thesupabaserepo you checkout in their guide above (specifically, thesupabase/dockerdirectory) . -
After you have supabase setup, you'll want to take the
full_backup.sqlfile (in the root of this directory) and restore the postgres DB in supabase. The postgres password is in that.envfile mentioned previously. -
After running
npm run dev, you'll access the app onlocalhost:3000. Your username ishello@kinetic.xyzand your password ispassword. Feel free to visitlocalhost:8000to access supabase and add other users, you'll just need to clear your browser cookie to log out. The credentials for supabase are also in the.envfile.
Enjoy! Can't wait to talk about it.