Federalists and Democratic-Republicans differed on many things. This included their views on foreign policy. However, there also were some foreign policy ideas on which they agreed.
One area of difference in foreign policy was in regarding to the country each side supported. The Federalists were friendlier with Great Britain and wanted us to side with the British. The Democratic-Republicans were friendlier with France and wanted us to work more closely with France. For example, in the war of 1812, the Federalists were against the war, which was fought against the British. They referred to the war as "Mr. Madison’s War." The Democratic-Republicans supported the war.
There were a few situations where both parties agreed on foreign policy. In the XYZ Affair with France, both sides were outraged that the French demanded a bribe from us in order to meet with them to discuss to the issues we had with France. Americans were willing to spend millions to defend ourselves, but not willing to spend a penny paying a bribe.
When the countries on the North African coast were supportive of the actions of pirates in demanding that we pay a bribe so they wouldn’t attack our ships, Americans were very supportive of our government when we went to war to fight against these pirates. Americans felt we shouldn’t have to pay a bribe to any country in order for us to trade.
While Federalists and Democratic-Republicans disagreed on many things, including foreign policy issues, there were some foreign policy ideas on which they agreed.