I always had an aspiration to develop an application from UI to hosting using the latest technologies. As a big fan of JavaScript, I discover that it is possible with JavaScript.
- Develop necessary components UI & its functionalities.
- Use React Router to handle routing.
- Use React Hooks & Functional Components.
- Setup Babel to use the latest JavaScript features.
- Setup Nodemon to monitor for any changes & restart the server.
- Setup Express as the backend application framework for Node.js.
- Setup the DB in a cluster that exists in MongoDB Atlas.
- Connect the application directly to that cluster using MongoDB’s native drivers.
- Setup dotenv-flow to add DB credentials.
- Develop the Express Server to run both Frontend & Backend.
- Use Postman to test the API requests.
- Create the AWS EC2 instance.
- Use SSH protocol to connect with the EC2 instance.
- Setup Forever package to ensure server script runs forever.
- All the requests received to Port 80 reroute to Port 8000.
- View Blog Article Details. (Title, Description, Vote Count, Comments)
- Upvote an article
- Comment about an article
ssh -i ~/.ssh/fullstack-blog.pem [email protected]
# Intallation
npm i forever
# Run the script with logging
npx forever start -l ~/fullstack-blog/logs/forever.log -o ~/fullstack-blog/logs/out.log -e ~/fullstack-blog/logs/err.log -a -c "npm start" .
# View
npx forever list
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8000
- This project develops as a follow along exercise with Shaun Wassell in his React: Creating and Hosting a Full-Stack Site Course.
- The frontend of the application was bootstrapped with Create React App.
- Very simple & easy to understand documentation about MongoDB Atlas.