Skip to content

A Blog developed using React.js, React Hooks, Express, MongoDB, AWS EC2

Notifications You must be signed in to change notification settings

yushanwebdev/fullstack-blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fullstack Blog

Motivation

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.

Tasks

Frontend Devlopment

  • Develop necessary components UI & its functionalities.
  • Use React Router to handle routing.
  • Use React Hooks & Functional Components.

Backend Development

  • 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.

Hosting

  • 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.

Features

  • View Blog Article Details. (Title, Description, Vote Count, Comments)
  • Upvote an article
  • Comment about an article

Install Dependencies

Frontend

yarn

Backend

npm install

Running

Frontend

yarn build

Backend

npm start

SSH into EC2 instance

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

Reroute Port 80 requests to Port 8000

sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8000

Credits

About

A Blog developed using React.js, React Hooks, Express, MongoDB, AWS EC2

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published