Edit your app's code by hand in the Codebase tab

The Code Editor lets you or a developer open your Hercules app's code in the Codebase tab, change a file by hand and save it. The Code Editor needs a paid plan.

For most changes, ask Hercules or use Visual Edit, because Hercules understands how the app fits together and makes coordinated changes across multiple files. The Code Editor is for the exact change a developer wants to make themselves, such as one formatting function.

What can you do with the Code Editor?

Open the code in the Codebase tab

The Codebase tab in your app's sidebar lists the app's source files and opens one for editing. Every saved edit becomes a new version.

Code Editor
Codebase tab with the app's route files in the explorer and a page file open in the editor
Codebase editor with an unsaved change and the Save changes bar

Save when you're ready

The Code Editor doesn't save on its own. Click Save before you leave the tab, or you'll lose your edits.

Code Editor
Versions tab listing the app's numbered versions, with an earlier version selected

Undo an edit that breaks the app

Restore an earlier version from the Versions tab or the switcher next to Publish. Reverting restores code and database structure, and your database records stay as they are.

Version Control
Export settings with Download code, Download files and Export database

Download the code for a developer

More, then Export downloads the codebase as a .tar.gz archive, from main or any open branch. The archive holds the React frontend, the backend code and the configuration files.

Export data
Secrets page with key, value and environment fields

Keep keys out of the code

Store API keys in Secrets, and the code reads them as process.env values. Hercules sees only each secret's name, which is enough to write the code that reads it.

Secrets

How do you hand a change to a developer?

  1. 1. Ask Hercules first

    Change the quote PDF so each line item shows the part number before the description.

    Hercules edits the files involved and saves a new version. Bring in a developer only for a detail that still needs an exact hand edit.

  2. 2. Invite the developer to make the hand edit

    Invite the developer as a teammate with the Member role, which can edit apps, and they make the change in the Codebase tab. When they click Save, Hercules records the edit as a new version.

    Teammates
  3. 3. Check it, or roll it back

    Check the change in the preview. If something broke, restore the previous version, then ask Hercules to fix the issue.

What could this look like for a business?

In this hypothetical example, an outside developer fixes the column order of a fencing manufacturer's weekly order file by hand in the Codebase tab. The manufacturer runs quoting and production scheduling on an app their operations manager built on Hercules. A large customer's purchasing system needs that file in an exact column order.

Hercules builds the export, and the developer adjusts the formatting, saves and checks the file in the preview. The order file then loads into the customer's system without anyone reformatting it each week.

Related features

Frequently asked questions

What should you know before you edit code?
  • Downloading the code needs a paid plan. Export data
  • Hercules support can't help with problems caused by manual edits.
  • A developer can't connect their own coding software, so edits happen in the Codebase tab.
  • A teammate's role applies to every app in your organization, so a developer invited as a Member can edit all of them.
  • Hercules support doesn't cover running the app on an outside host.
  • See what each plan includes on the pricing page.
Can a developer look at the code before I invite them?

A developer can review your app's code before joining your team. Download the archive from More, then Export, and send it to them.

Can I download a branch's code without merging it?

Hercules lets you download an open branch's code without merging it. Pick the branch in the selector next to Download code to get its latest version. Downloading doesn't change your app, and merged or closed branches can't be downloaded. Export data

Can I export the database too?

Yes. On a paid plan, Export database downloads a ZIP snapshot of your app's tables, and it includes files your users uploaded unless you clear that option. Export data

Who owns the code?

You own what you build on Hercules.

How do you get started?

Open your app and click Codebase in the sidebar. Start building.