Guide to run the project locally

<%= @topic_view.topic.title %>
<%= @topic_view.topic.average_rating %> <%= @topic_view.topic.posts.count { |p| !!p.custom_fields['rating'] } %>

Hi guys! I’ve been trying to find documentation on how to run the project locally. But I couldn’t find it. I’m sorry if I missed it somewhere :S

I’d like to fix a few things I’ve seen, but I would feel a lot better if I could test them locally before making a PR. I cloned the project and tried to run it without success. So any help will be appreciated and hopefully, turned into a few PRs :slight_smile:

The contributors guide links to another guide for Setting up freeCodeCamp locally

1 Like

Great! Thanks a lot!!

I’m already running the site locally :partying_face:
But I can’t get to the guides pages.

I want to edit this page:
https://guide.freecodecamp.org/certifications/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/convert-html-entities/

But it doesn’t even seem like Gatsby generated it.

How do you get to the challenge solution guides when you run the site locally?

Thanks a lot for your help!

When developing locally (running npm run develop), the build only uses the mock-guide folder to actually build the guide. It does this to reduce the overall build time and reduce the size need for the build of the repo locally. It would take about 5-10 minutes longer otherwise. There is a work-around. You can simply copy the guide/english/certifications folder to mock-guide/english folder so that you end up with mock-guide/english/certifications. Then you can run npm run develop and see all the guide articles. Keep in mind if you will have to update the mock-guide version to see any changes if you make them. Also, make sure not to commit the certifications folder accidentally in the mock-guide. This would result in your PR being rejected.

Cool, thanks! Makes total sense. I’ll try it out and come back if I run into trouble. Thanks for your help!

BTW, did I miss the docs for this? If all of this is not documented, I’d be happy to also help with that.

Not that I am aware of. It is kind of an edge case that does not come up too often. That being said, I suggest creating an issue first around the subject, so others can discuss where best to put this information. Once we can reach a consensus, then you or someone else can create the actual PR.

1 Like

Sounds to me like a good place to put this information would be … a guide article, no? :wink:

Yes, of course, but which one will have to be decided.

A “Contributing to FreeCodeCamp” category perhaps? Then again, I suppose most docs in that vein should perhaps just go in the docs/ directory of the repo. ¯\(ツ)

It would probably go somewhere in the in the How to Setup Free Code Locally as a note.