If you're going with Ubiquiti for the access points, why don't you go with them for the gateway (router) and switch as well? That way everything is managed through one web portal. Also the access points you listed are older models that don't support the new WiFi 6 standard, I'd look at getting the AP WiFi 6 Lite or Pro depending on how many devices will be on your network
https://ca.store.ui.com/collections/...nifi-ap-6-lite
For the router, I'd also go with the Ubiquiti Dream Machine as it runs the UniFi OS without needing a separate server and it also has an access point built-in, so you can potentially cut down on 1 external AP
https://ca.store.ui.com/collections/...-dream-machine
As for how it all works, the flow would be ISP Modem > Router > Switch > Access Point. You'd have to contact your ISP to change how your modem is setup if using your own external router, and for a switch you'll definitely want one with PoE (Power over Ethernet) to power your access points