Currently, both the production and preview MongoDB Atlas clusters have access whitelisted from anywhere (0.0.0.0/0) to allow connections from Vercel-hosted frontend deployments.
This is insecure and not suitable for production use.
Vercel uses dynamic IPs, which makes static IP whitelisting unreliable.
We could move away from deploying at vercel but I don't think that's worth it for now.
Proposed solution:
Implement a secure backend proxy (e.g. hosted on a platform with static outbound IPs or via serverless functions) to handle all database interactions. The MongoDB clusters will then whitelist only the proxy's IP address(es), improving security.
Relates to #22
Currently, both the production and preview MongoDB Atlas clusters have access whitelisted from anywhere (0.0.0.0/0) to allow connections from Vercel-hosted frontend deployments.
This is insecure and not suitable for production use.
Vercel uses dynamic IPs, which makes static IP whitelisting unreliable.
We could move away from deploying at vercel but I don't think that's worth it for now.
Proposed solution:
Implement a secure backend proxy (e.g. hosted on a platform with static outbound IPs or via serverless functions) to handle all database interactions. The MongoDB clusters will then whitelist only the proxy's IP address(es), improving security.
Relates to #22