Deployment of a web application

I am learning MEAN Stack and planning for AWS in future.

Can someone let me know how to deploy a MEAN application (How and what all servers are required for which all softwares to run?) in as a test and prod environment? Like I want 2 environments one to check if the code is running fine by integrating GIT and if it’s ok then push it to prod. (I guess which can be done using AWS infrastructure).