A republic just means that the legitimacy of the government is devolved from the populace, rather than an aristocracy or warlords or some kind of feudal system.
A democracy means that the mechanism of government is devolved from the populace, rather than something like a council of elders or drawing lots.
These are related but not identical.
The British Commonwealth, for example, consists of a group of countries that are democratic but not republics. The head of state is the Queen of England. I can't think of any examples outside the United Kingdom itself where this has mattered more recently than Australia in the early '70s.
I can't think of examples the other way around.
I like that distinction. Just thinking, I'd say legitimacy is more important than mechanism.
There are undemocratic aspects to the US in the regulatory agencies and the courts. Lifetime appointments to courts and the difficulty of removing anyone appointed limit responsiveness to what the people want. These undemocratic aspects reflect the idea that some elite knows better in these matters than the general population which almost certainly is true. Under normal (hopefully) functioning, in these aspects legitimacy of the government is not in question even though the mechanism of government is distanced from the populace.
However, corruption muddies the waters. To me political loyalties are the principal form of corruption. Extreme political loyalties (e.g., "my country right or wrong") are a fount of corruption. A corrupt government is not a republic, to my naive view, and is vulnerable to fascist trends. The legitimacy of the government becomes based on people not in their right minds--which can be worse than relying on aristocracy, warlords, etc.--even though it can be democratic.
I think the most undemocratic part of the federal government is that members of the Senate represent fairly arbitrary geographical areas, not people per se. That gives McConnell (and Republicans in general) outsized control over what even gets to be heard on the Senate floor. In this respect the mechanism of the government is devolved from historical and geographical cirumcumstances not the populace. ETA: And that affects legitimacy.