Gamify LeetCode
- A comprehensive dashboard showing the list of all the solved problems, your score, rank, and the current streak.
- A favorites tab listing all the problems favorited by the users.
- Analytics of how the scores progressed over time.
- Light and dark themes.
- The project is deployed on Render's Hobby plan (free) with the Supabase free plan. It can be deployed on any platform of your choice.
- Please follow the following steps if you need to deploy the project on your
own:
- Fork the repository. This step is optional. Fork the repository if you would like to have the automatic sync with Leetcode (every hour) and an automatic backup of your DB (every midnight).
- Deploy the Next.js project on a platform of your choice. I have found no issues with deploying the project on Vercel and Render.
- Create a new Supabase project.
- Set the environment variables
DATABASE_URLandDIRECT_URL. Have a look at Prisma's Supabase documentation to understand what these environment variables are. - Execute the command
bun db:deployto run all the migrations.
- There is no API to add a new user. It needs to be added manually. Insert
the new user using raw SQL commands, or directly edit the
userstable onSupabase.
- The
Sync with Leetcodebutton fetches the latest 20 AC submissions of the user and populates the database. The start date for sync is set to Feb 1, 2025. You can change it by updating the SYNC_START_DATE variable. Any problem solved beforeSYNC_START_DATEwill not be synced with your DB.
- The Sync problems
GitHub workflow is executed every hour between 8:30AM and 1:30AM IST. This
makes sure that your database is in sync with Leetcode submissions even
you don't press the
Sync with Leetcodebutton all the time. - To get it working, please set the
BASE_URLenvironment variable in your GitHub actions. It should be set to the URL at which your project is deployed. For example, theBASE_URLfor this project is set tohttps://leetify.onrender.com.
- The Backup DB GitHub workflow runs every midnight to back up your database as a Gzip.
- Set the
BASE_URLenvironment variable in the environment variables of your GitHub actions to enable this feature.
- Set the
DATABASE_URLandDIRECT_URLenvironment variables in the environment variables of GitHub actions to make your CI is green. Have a look at Prisma's Supabase documentation to understand what these environment variables are.
- Next.js
- Prisma
- Supabase
- Run the
bun installcommand to install all the dependencies. - Add an
.env.developmentfile with the environment variablesDATABASE_URLandDIRECT_URL. Have a look at Prisma's Supabase documentation to understand what these environment variables are. - Run
bun db:deployto run all the migrations. - Run
bun run startto start the development server at port3000.
This project comes with an MIT license, which means you can pretend that you wrote it. Just don't blame it on my when you face any existential crisis while solving hard Leetcode problems.