/Instant-Share

An extensible, highly modularized and structured backend framework demo for constructing twitter-like website using nodejs + koa2 + mysql + redis. Include complete and compact unit testing for maintainence and extension. demo: http://shareins.xyz

Primary LanguageJavaScriptMIT LicenseMIT

Instant Share

Instant Share is an extensible, highly modularized and structured backend framework demo for constructing twitter-like website. After register and login, people can share instant posts, add images, and @others during posting. They can freely change personal info and reponse to the others. Using Sequelize ORM, the database system is easy to maintain or update. The website also uses Redis to save public pages as cache to enhance efficiency.It is embedded with intact unit testing for maintainence and extension.


  • Keywords: JavaScript, Node.js, Koa2, Redis, MySQL, Sequelize ORM, application architecture, unit testing
  • Demo: http://shareins.xyz
  • Demo Account: {userName: ciri, passWord: ciri}

0.Overview

The focus of this project is to practice backend development ability to an enterprise-level, which needs high-concurrency, highly ordered architecture, and intact unit testing mechanisms. Spring, Node.js, Go, are nowadays popular tools and languages applied for backend development. Thus this project is my second step in my backend-practice triology. Compared with previous CoderUCI Forum, this project:

  • Focus less on front-end, just ensure the essential components are working
  • Redis: used for 'Sqaure Discovery Page', cahce the entries for fast access
  • Sequelize ORM: Another way to manipulate database. Increases code unity, avoid SQL sentences, and convert everything to object manipulations
  • Session: complete intact register & login & session transfer, applied encryption method to protect database leakage.
  • Architecture: This project strictly follows the MVCS (model, view, controller, service) framework, convenient and easy to maintain and debug.
  • code standards:Embedded with eslint, jsdoc comment semantics, and complete unit testing. Modeling the development process in an enterprise.

Framework

Testing

By testing, it's easier for us to check the compatibility of new features and original functions.

1.Pages and Functions Introduction

Home Page

At home page, you can view the activities of people you are following. The Load More function here is to enhance website readability.

Share moments

By simply typing your thoughts or upload an image, you can share your splendid moments.

Follow/Unfollow

You can follow/unfollow a person in his profile page.

Check posts that mentioned Me

Clicking "@ Me", you can find posts mentioned you

Reply posts / at others

If you want to @others, simply type "@" in the text area. To reply to a message, press "Reply"

Change personal info

Go to "Settings" page, you can change your personal info. Remember to save before your leave.

2. Deployment

2-1. Install nodejs & npm

Please visit Node.js to install these two essentials.

2-2. Install npm packages

cd Instant-Share/
npm install

2-3. Install & Setup MySQL & Redis

You can find the keys at src/conf folder

2-4. Start / Test

npm run dev #(development)
npm run prd #(production)
npm run test #(test)

3. Acknowledgement

This project takes Shuangyue's instructions as references. I am very grateful for the teacher's help during the process of development. Finishing this project greatly enhanced my understanding of backend development and enterprise development workflow.

4. License

MIT License © Zhenhan Li. University of California, Irvine.