The external architectural diagram shows how the Token metadata API is connected to three systems: a Stacks node, a Stacks Blockchain API database, and a Postgres database.
The Token Metadata API interacts with the Stacks Blockchain API database (referred to as a "Local Metadata DB" in the diagram above) to import all historical smart contracts when booting up and to listen for new contracts that may be deployed afterwards. Read-only access is recommended as this service will never need to write anything to this database.
A Stacks node responds to all read-only contract calls required when fetching token metadata (calls to get token count, token metadata URIs, etc.).
A local Postgres DB stores all processed metadata info.
The service needs to fetch external metadata files (JSONs, images) from the internet, so it must have access to external networks.