A good API workspace is boring on purpose. You want one folder where a project starts, one command that runs it, and a quick way to see exactly what your server sent back. Setting that up takes an afternoon and saves you from a year of vague debugging. Here is a setup that works and does not need replacing later.
Pick the smallest stack that does the job
Choose one language you can read and one framework that handles routing and JSON for you. Node with Express or Fastify, Python with FastAPI or Flask, and Go with its standard library are all reasonable starting points. The mistake is collecting frameworks. You want enough structure to build an endpoint today, and nothing you cannot explain line by line. Write the choice down in the project README, along with the language version, so future-you knows what the code expects.
Install the tools you will use every day
- Runtime and package manager, installed from the official source, with the version pinned in a file.
- An editor with a terminal, so you are not switching windows to run a command.
- A request client: curl at minimum, plus a GUI tool if you prefer saved requests.
- Git, with a small .gitignore before the first commit.
- A browser, because you will read other people’s API docs constantly.
Check each install with a version command, and fix it now if it is not on your PATH.
Lay out the folder so it can grow
Keep the entry point at the top level and put routes, handlers, data access and configuration in separate folders. Even a five-file project benefits, because you will know where a change belongs. Create a .env file for local settings, a .env.example with the same keys and dummy values for other people, and make sure the real one is ignored by git. Add a short README with install, run and test commands. If a new contributor cannot start the project from the README alone, the layout is not finished.
Run it, then talk to it
Start the server and confirm it prints the address and port it is listening on. Then make a request without any extra tooling: open a terminal, call the endpoint with curl, and read the status line, the headers and the body. This is the habit that separates people who understand APIs from people who only write them. Save those curl commands in a file, or save equivalent requests in your GUI client, so you can repeat them after every change.
Add the safety rails early
Turn on a formatter and a linter now, while there is nothing to fix. Write one test that calls an endpoint and checks the status and a field in the response, and run it from a single command. Use a dev server that restarts when a file changes, so you are not relaunching by hand. When you need a database, run it in a container with a compose file rather than installing it globally, so the project carries its own environment. These choices cost a few minutes each and quietly prevent the two classic disasters: secrets committed to git, and a project nobody else can run.
Do I need Docker from day one?
No. Add it when you add a database or a second service. Before that, a local runtime and a package manager are enough.
Should I use a framework at all?
For learning, a small one helps: it gives you routing and JSON handling and lets you focus on request and response design. The standard library is fine too, as long as you are not rewriting a router badly.
Set the workspace up once, keep it small, and treat the README as part of the code. The point is not an impressive toolchain. It is being able to start, change and inspect an endpoint in under a minute, every time.