blaticslm / simple-tweet-project

This is the project for a simple tweeter-liked web application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple-tweet-project

  • This is the project to create a simple token-based tweeter-liked web application.
  • This project is shutdown now.

Screenshot

Feature Demo

https://www.youtube.com/watch?v=Il3r-cv5hOI

This demo shows the following accomplishments :

  • Successfully registered by the new user
  • Upload two types of post
  • Users can only delete the post they created
  • Search by keywords and user names
  • No need to refresh the web page to see the latest content update

Improvement:

https://youtu.be/mP0AG2MES6w

  • Now users can delete images continually without leaving the viewing mode (lightbox enable).
  • There will be Delete Fail when the delete button is not disabled on others' post.
  • There is no image to delete in the gallery! pop-up window when users delete the empty picture.

Backend and Frontend structure

Program tools and environment

Front end:

  • Intellij
  • Node.js
  • React

Back end:

  • Vscode
  • Golang
  • ElasticSearch database
  • Google Compute Engine and Cloud Storage

Frontend Setup

npx create-react-app {PROJECT_NAME_FOLDER}
cd {PROJECT_NAME_FOLDER}
npm start

Backend Setup

Golang:

Google Cloud platform setup:

sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt-get update
sudo apt-get install golang-go

go version

SSH key to connect to VM instance using Vscode

  • Using git bash (windows) to create ssh key
ssh-keygen -t rsa -f ~/.ssh/gcekey -C GMAIL_ACCOUNT
  • Obtain the ssh key pair
cat ~/.ssh/gcekey.pub
ssh -i ~/.ssh/gcekey GMAIL_ACOUNT@GCE_EXTERNAL_IP
  • Connect to VM now

ElasticSearch installation

  • In vscode remote terminal,run those lines:
sudo apt install default-jre

java -version

sudo apt install apt-transport-https
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -

sudo sh -c 'echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" > /etc/apt/sources.list.d/elastic-7.x.list'
sudo apt update
sudo apt install elasticsearch
  • After installation, edit the configuration file
sudo vim /etc/elasticsearch/elasticsearch.yml
  • Find those place to uncomment or add
network.host: 0.0.0.0
http.port: {designated port of VM}
discovery.type: single-node
xpack.security.enabled: true

and verify

sudo cat /etc/elasticsearch/elasticsearch.yml|grep "^[^#;]"
  • Start Elasticsearch and check status
sudo systemctl enable elasticsearch
sudo systemctl status elasticsearch
  • Enable the password and code for the elasticsearch
sudo /usr/share/elasticsearch/bin/elasticsearch-users useradd NEW_USER_NAME -p NEW_PASSWORD -r superuser

About

This is the project for a simple tweeter-liked web application


Languages

Language:JavaScript 56.8%Language:Go 37.1%Language:HTML 3.1%Language:CSS 3.0%