I've built an RSVP web application with a React front end, Node.js backend, NGINX webserver, SQL database and hosted on a DigitalOcean Droplet with Ubuntu. The issue is, every time I want to launch the application with different content (i.e. different events, locations, dates, etc.), I need to manually duplicate the code, update the content, create new A names on DigitalOcean, and change the Database name. I currently have the information stored in a separate JSON file that is being read by the application, which reduces the overhead when creating a new instance of the application, but I would like to automate as much of it as possible, and even create an admin page so that others can launch a new instance, and the process isn't entirely reliant on me (and make my life easier haha). Each instance will be accessed through a subdomain for a domain I already own (i.e. instance1.example.com, instance2.example.com, etc.). I was considering modifying the application as such:
- Dockerize the front end
- Docker configuration will receive a path to that specific instance's source of truth
- All other requirements, packages, dependencies will be identical as application itself is never changing, just the content being displayed (only text, no images/media, or functionality will be modified)
- Expose an API on my server that will do the following:
- Duplicate existing NGINX templates under
sites-available
and soft link it tosites-enabled
- Run
Certbot
to acquire SSL certificate for new subdomain (given as part of request body) - Restart NGINX
- If possible (still need to do more research), add additional DNS records to DigitalOcean domain
- Run SQL scripts to generate new DB tables based on request body values
- Duplicate existing NGINX templates under
- Reconfigure existing APIs to take in DB name so that multiple instances can leverage existing API
- Build an admin page
- Define website content and subdomain name
- Once information is verified and submitted, new API on server will be called to trigger the creation and deployment of the new instance
- The database server itself will be a single, non-dockerized service, with new databases (and within, tables) being instantiated dynamically
- The Node.js server will be a single, non-dockerized service, only modified slightly to handle and reroute traffic to multiple DBs as needed
I also am not expecting any crazy amount of traffic at any given moment, realistically I am probably looking at a couple of dozen or so requests to the server every day, and that would be a very busy day.
I understand this is probably a very basic design/architecture problem, but please note that I am relatively new to software design as a whole and in the very early stages of my software development career. I understand there may be a lot of problems/inefficiencies with my approach. Please provide any feedback and detailed explanations as possible, and feel free to suggest any alternative solutions or concepts I may be missing - I'm not just looking to get this over with but build an understanding of quality software design principles that will carry me through my career.