ReactJS with Elasticsearch app architecture

I want some advice regarding my architecture and hosting options. I'm attempting to build an e-commerce site for e-books. It will use NestJS for the backend and ReactJS+Typescript for the frontend. PostgreSQL will be the database. I want to use Elasticsearch to provide search capabilities. Initially, I thought to host each of these projects in their own server. But since I'll be using Elasticsearch for the portion most in need of scalability; I can put the front and back ends on the same server. Something akin to this: I would still need the backend as a separate project to perform user authentication and other utilities. Does this make sense? Would a monolithic architecture work better in this case? I'm not serving multiple frontends, nor would backend API be public. Maybe it will present an issue if I succeed with this and think of making a mobile app. I was thinking of starting with the digital ocean as my hosting platform; I'd need three servers at minimum (DB, es, and front+back-ends).

Apr 14, 2025 - 19:25
 0
ReactJS with Elasticsearch app architecture

I want some advice regarding my architecture and hosting options. I'm attempting to build an e-commerce site for e-books. It will use NestJS for the backend and ReactJS+Typescript for the frontend. PostgreSQL will be the database. I want to use Elasticsearch to provide search capabilities.

Initially, I thought to host each of these projects in their own server. But since I'll be using Elasticsearch for the portion most in need of scalability; I can put the front and back ends on the same server. Something akin to this: enter image description here

I would still need the backend as a separate project to perform user authentication and other utilities.

Does this make sense? Would a monolithic architecture work better in this case? I'm not serving multiple frontends, nor would backend API be public. Maybe it will present an issue if I succeed with this and think of making a mobile app.

I was thinking of starting with the digital ocean as my hosting platform; I'd need three servers at minimum (DB, es, and front+back-ends).