Your personalized online notebook for everything Leetcode.
This is the codebase, it's all hosted online for free though so if you just want to use it then visit repcode.io. If you would like to contribute, then continue reading.
❤️❤️ SPECIAL THANKS TO ALL OUR CONTRIBUTORS: ❤️❤️
- OmkarSathish
- knownotunknown
- Pragyan14
- ajinkya801
- (add a PR to see your name here!)
This project is an open-source platform designed to streamline your Leetcode practice. It includes features such as problem organization, AI-powered feedback, and spatial repetition for efficient learning.
- Organize problems & add your own notes, solutions, etc.
- Review problems with a SuperMemo-based spatial repetition algorithm (same as Anki)
- Get AI-powered feedback on your solutions
- View detailed stats about your problems/DS and Algos, to target your weaknesses
- Frontend: React, Next.js, TailwindCSS
- Backend: Prisma, MySQL (production), SQLite (development), Firebase (for auth)
- Hosting: Vercel
Below are detailed instructions for how to set up your local development environment and make and submit changes/PRs. If you run into any issues, please email repcode.io@gmail.com.
Ensure you have the following installed:
- Node.js (v20 or higher REQUIRED)
- npm or yarn
- SQLite (for local development)
-
Fork the repo, then clone your fork to some folder on your desktop
-
Install dependencies:
npm install
- Create a
.env
file in the root directory with the following variables:
DATABASE_URL="file:./dev.db"
-
Update
schema.prisma
:- Replace the contents of
schema.prisma
with the contents ofdevTemplates/devprisma.txt
- Replace the contents of
-
Delete the folder
prisma/migrations
entirely -
Update
firebaseAdmin.js
- Replace the contents of
firebaseAdmin.js
with the contents ofdevTemplates/firebaseAdmin.txt
- Update
src/firebaseConfig.js
- Replace the contents of
src/firebaseConfig.js
with the contents ofdevTemplates/firebaseConfig.txt
- Initialize the SQLite database by running the following commands in the terminal of your code editor:
npx prisma migrate dev --name init
npx prisma generate
- Comment out the following line in
ProblemsQueue.tsx
, on line 412:
// Comment out the below line to avoid runtime errors in development
// await updateContribution(user?.email || '');
- Start the development server and navigate to the localhost on your browser:
npm run dev
Congratulations! You've now successfully set up the development environment! Feel free to explore and make some test changes to stuff to see how everything works.
To view the database structure:
- Use any online SQLite database viewer and drag-and-drop the
prisma/dev.db
file.
Remember that you're using a local dev.db that emulates the structure of the production database, but not the content: it'll start off as empty. And changes you make to this DB won't affect the production DB (and vice versa). But any changes with data fetching/pushing that work on this dev db will work on the production db as well.
Important note: do NOT use built-in Tailwind utility classes (like blue-500, grey-200, etc.) when using colors for styling, as they will not work. Either use the custom ones in @tailwind.config.ts, or hardcode the hex of the color (like this: bg-[#FFFFFF])
We welcome contributions! Check out the Issues tab and comment on any issues you want to work on! Follow these steps to contribute:
-
Follow the 'Getting Started' instructions above
-
Create a new branch for your changes:
git checkout -b feature/your-feature-name
-
Make your changes locally:
- Follow the setup instructions under Getting Started to set up the dev environment
-
IMPORTANT: check to see if your changes actually build:
npm run build
- if there are any build errors, they'll be listed in the terminal, please fix them. If everything builds fine, you're good to go (warnings are fine, but errors must be addressed)
- Commit your changes:
- Make sure to add/commit ONLY the files that actually relate to the PR: do NOT do
git add .
, as there are several files that are different from prod so that localhost works properly (like firebaseAdmin, firebaseConfig, everything in the Prisma folder, etc.) so you don't want to commit these to prod
git add [files_you_modified]
git commit -m "Description of your changes"
- Push your branch to your fork:
git push origin feature/your-feature-name
-
Create a Pull Request (PR):
- Go to the original repository's GitHub page.
- Click the "Pull Request" tab.
- Select your branch and submit the PR.
- PLEASE include a screenshot if your change was styling-related!
- PLEASE include any relevent comments on your PR!
-
Wait for Review:
- A maintainer will review your PR (almost always within 24hrs)
- Make any requested changes and update the PR, and include comments please!
- Feel free to check out the Issues tab and comment on issues you want to work on (or add you own!)
- Follow the existing code style.
- Test your changes thoroughly.
- Write descriptive commit messages.
This project is open-source under the MIT License.
You must provide credit if you use or distribute this code.
See the LICENSE file for more details.