freeCodeCamp icon indicating copy to clipboard operation
freeCodeCamp copied to clipboard

Improve solution download format to ZIP project structure

Open Jeevankumar-s opened this issue 9 months ago • 16 comments

Currently, solutions download as a single .txt file containing HTML, CSS, and JS together. It would improve developer experience if the solution downloaded as a ZIP file containing properly separated files like:

  • index.html
  • styles.css
  • script.js

This would make the project immediately runnable and align with real-world project structure.

Jeevankumar-s avatar Feb 14 '26 19:02 Jeevankumar-s

Hi @Jeevankumar-s and @gikf , I’d like to take this up. I’m planning to update the download logic in CompletionModal.tsx to generate a ZIP file with separate project files instead of a single .txt.

kopalg20 avatar Feb 15 '26 11:02 kopalg20

Hi @Jeevankumar-s I’d like to work on this issue if it’s available. It seems like a great improvement for developer experience. Please let me know if I can take it up

maryamfatimaJ avatar Feb 15 '26 20:02 maryamfatimaJ

Hi @kopalg20 , @maryamfatimaJ

This issue is still under status: waiting triage.
Once it’s updated (e.g., to help wanted), you can go ahead and open a PR.

Jeevankumar-s avatar Feb 16 '26 14:02 Jeevankumar-s

For Project Euler, Rosetta Code or daily coding challenges the txt file is fine.

angelcrsq avatar Mar 10 '26 14:03 angelcrsq

Hey @Jeevankumar-s, I totally understood the issue and would love to work on it, Can you please assign it to me?

RiddhiPachehara avatar Mar 27 '26 13:03 RiddhiPachehara

Hi @Riddhi8077,

We typically do not assign issues. Instead, we accept the first pull request that comprehensively solves the issue.

Issues labeled with help wanted or first timers only are open for contributions.

Please make sure you read our guidelines for contributing. We prioritize contributors following the instructions in our guide. Join us in our chat room or the forum if you need help contributing - our community will be happy to assist you.

Jeevankumar-s avatar Mar 27 '26 13:03 Jeevankumar-s

Hi @Venkat-Entropik, it's been long time you've not worked on this issue, So I thought you skipped this issue!

RiddhiPachehara avatar Mar 27 '26 15:03 RiddhiPachehara

Thanks for the work on this issue!

I explored a solution using JSZip to generate a downloadable ZIP, but since this introduces a new dependency, it requires updating the lockfile which I’m currently unable to do in my setup.

Since there is already an active PR addressing this issue, I’ll go ahead and close mine to avoid duplication.

Appreciate the effort here, looking forward to contributing to another issue

RiddhiPachehara avatar Mar 27 '26 19:03 RiddhiPachehara

Thanks for the work on this issue!

I explored a solution using JSZip to generate a downloadable ZIP, but since this introduces a new dependency, it requires updating the lockfile which I’m currently unable to do in my setup.

Since there is already an active PR addressing this issue, I’ll go ahead and close mine to avoid duplication.

Appreciate the effort here, looking forward to contributing to another issue

Thank you for your effort. Contributions are reviewed based on best fit and adherence to project guidelines, rather than on a first-come basis. We appreciate your work on this.

Jeevankumar-s avatar Mar 28 '26 03:03 Jeevankumar-s

Thank you for your effort. Contributions are reviewed based on best fit and adherence to project guidelines, rather than on a first-come basis. We appreciate your work on this.

Hey @Jeevankumar-s , Thanks for letting me know, I understood the assignment, kindly review my PR as all tests are passing now

RiddhiPachehara avatar Mar 28 '26 08:03 RiddhiPachehara

Thanks for the feature request. We've reviewed a couple of PRs for this and want to share some guidance before moving forward.

The ZIP approach is right, but hardcoding filenames like index.html, styles.css, script.js won't work. freeCodeCamp challenges aren't limited to basic HTML/CSS/JS — we have Python projects, multi-file challenges, and single-file challenges (Project Euler, Rosetta Code, etc.) where that naming makes no sense.

The good news is that each challenge file already carries the metadata you need:

interface DownloadableChallengeFile {
  name: string;  // e.g. "index", "styles", "script"
  ext: string;   // e.g. "html", "css", "js", "py"
  contents: string;
}

So the ZIP should use the original filenames from the challenge data (${file.name}.${file.ext}), not hardcoded names. This way it works across the entire curriculum without special-casing.

A few other pointers for anyone picking this up:

But, jszip seems to be bloated. Consider other packages. I am closing linked PRs.

Thanks for the update and for taking the time to explore a solution. Totally makes sense to avoid duplicating effort. Looking forward to your future contributions!

On Fri, Mar 27, 2026, 2:26 PM Riddhi Pachehara @.***> wrote:

Riddhi8077 left a comment (freeCodeCamp/freeCodeCamp#65887) https://github.com/freeCodeCamp/freeCodeCamp/issues/65887#issuecomment-4144762710

Thanks for the work on this issue!

I explored a solution using JSZip to generate a downloadable ZIP, but since this introduces a new dependency, it requires updating the lockfile which I’m currently unable to do in my setup.

Since there is already an active PR addressing this issue, I’ll go ahead and close mine to avoid duplication.

Appreciate the effort here, looking forward to contributing to another issue

— Reply to this email directly, view it on GitHub https://github.com/freeCodeCamp/freeCodeCamp/issues/65887?email_source=notifications&email_token=CAYEKV3Y662ROPG2QGDEPC34S3IWRA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMJUGQ3TMMRXGEYKM4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#issuecomment-4144762710, or unsubscribe https://github.com/notifications/unsubscribe-auth/CAYEKVY7LA7EY24WHFZUPQT4S3IWRAVCNFSM6AAAAACVEVPBFWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DCNBUG43DENZRGA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

mokilnizar-max avatar Apr 08 '26 10:04 mokilnizar-max

Hi, I would like to work on this issue. Is it still available?

spark850 avatar Apr 13 '26 17:04 spark850

Thanks for the feature request. We've reviewed a couple of PRs for this and want to share some guidance before moving forward.

The ZIP approach is right, but hardcoding filenames like index.html, styles.css, script.js won't work. freeCodeCamp challenges aren't limited to basic HTML/CSS/JS — we have Python projects, multi-file challenges, and single-file challenges (Project Euler, Rosetta Code, etc.) where that naming makes no sense.

The good news is that each challenge file already carries the metadata you need:

interface DownloadableChallengeFile {
  name: string;  // e.g. "index", "styles", "script"
  ext: string;   // e.g. "html", "css", "js", "py"
  contents: string;
}

So the ZIP should use the original filenames from the challenge data (${file.name}.${file.ext}), not hardcoded names. This way it works across the entire curriculum without special-casing.

A few other pointers for anyone picking this up:

* Keep the existing useEffect + downloadURL state pattern — it handles URL object lifecycle   (creation/revocation) correctly

* Use the native  attribute rather than programmatic click hacks

* The E2E test should verify an actual download happens and check the filename, not just assert   button visibility

* jszip ships its own types — no need for @types/jszip

But, jszip seems to be bloated. Consider other packages. I am closing linked PRs.

Hi, thanks for the detailed guidance — it really helped clarify the expectations.

I went through multiple previous PRs and now understand why they were closed, especially around hardcoded filenames, handling metadata correctly, and keeping the implementation generic across different challenge types.

I’d like to take a shot at this and work within the constraints you mentioned (using metadata-based filenames, keeping the existing download flow, avoiding unnecessary dependencies, and adding proper E2E coverage).

I’ll make sure to follow the guidelines closely. Thanks again for the direction!

Akashgite1 avatar Apr 14 '26 21:04 Akashgite1

What will happen to this feature if this fix https://github.com/freeCodeCamp/freeCodeCamp/pull/66552 has already been deployed?

angelcrsq avatar May 25 '26 07:05 angelcrsq

I caused a discrepancy between issues which could have been prevented. I am planning on handling the issue.

Sembauke avatar May 25 '26 07:05 Sembauke

Hi! I would love to work on this issue if it's still available.

Deepanshu4m avatar Aug 31 '26 08:08 Deepanshu4m

I'd like to take this one (Improve solution download format to ZIP project structure). I'll look into the root cause and follow up with a PR. (claiming via @LeonxLJX)

LeonxLJX avatar Sep 01 '26 10:09 LeonxLJX

I'd like to take this one (Improve solution download format to ZIP project structure). I'll look into the root cause and follow up with a PR. (claiming via @LeonxLJX)

LeonxLJX avatar Sep 01 '26 11:09 LeonxLJX

I'd like to take this one (Improve solution download format to ZIP project structure). I'll dig into the root cause and follow up with a PR shortly. (claiming via @LeonxLJX)

LeonxLJX avatar Sep 01 '26 11:09 LeonxLJX