introduce

BadJS is a Web front-end script error monitoring and tracking solution. This project is the open source project of imWeb (QQ group :179045421) team of Goose Factory.

Project window

  1. One-stop systematic solution: Services require simple configuration, including the introduction of the report file, to report script errors, and facilitate daily mail statistics tracing.
  2. Visual query system to quickly locate error information: The large number of scripts in Web applications makes it difficult for developers to locate a problem in so many scripts. BadJS can subtly locate bad script code and provide feedback. You can quickly find detailed error logs through various search criteria.
  3. Cross-domain, Script Error, and other thorny issues are no longer a problem: TryJS helps you find everything.
  4. Real user experience monitoring and analysis: Through real user behavior and experience data monitoring on the browser side, it provides you with JavaScript and AJAX request error diagnosis and page loading in-depth analysis to help developers locate every problem in detail. Even if no user complains, hidden bugs can still be found and user experience can be improved.
  5. User behavior analysis: Fine grained tracking of real user behavior operations and processes, front-end crashes, slow loading and error problems, can be associated to the back-end for in-depth diagnosis.
  6. Product quality assurance: Browsers blossom, user environments are complex, and the vast differences make it difficult for developers to reproduce the problems users encounter. All user operation logs cannot be reported in the background. Through BadJS, client script errors are reported to protect product quality.

System architecture

The front end

Badjs-report – Front-end error monitoring tool

The back-end

Badjs system uses a service-oriented architecture and the modules are described below

Badjs-acceptor – Access layer that uses multiple processes

Badjs-mq – Message queue center for distribution to other systems

Badjs-storage – Stores the service to mongodb and provides log query and statistics services

Mongodb is used for storage by default

Badjs – Web – management system, providing user management, log query and log statistics

Badjs-web /db/create.sql initializes the database

The class library

Badjs-openapi-client – a client library that connects to BADJs-MQ

Data is received, processed, and forwarded to a third-party system

Configuration (project.json) description

All “project.debug.json” is local debug configuration, used to distinguish “development environment” from “production environment”, run time can add parameters –debug(debug log output) –project(using test configuration)

Installation requirements

Nodejs 0.12 +

Mysql 5.0 +

Mongo 3.0 +

Git command to pull various system modules

The deployment of

Tencent Cloud Deployment

Market.cloud.tencent.com/products/33…

After the deployment is complete, the following information is displayed:

  1. Visit address:
  • Xx.xx.xx. xx:8081/ // Access address of the management end
  • Xx.xx.xx. xx/badjs // BADJS report address
  1. Mongodb and mysql have been deployed by default
  • Mongodb has no password and the default port is 27017
  • Mysql root/root, default port 3306
  1. The default deployment address is:
  • /data/badjs/badjs-installer
  1. The Tencent cloud deployment module does not have the email notification function. The complete version of the deployment needs to be enabled:
  • Github.com/BetterJS/do…

Docker deployment

badjs-docker

// Download images Docker pull caihuijigood/badjs-docker // Start docker run -i -d p 80:80 -p 8081:8081 Docker. IO/caihuijigood/badjs - docker bash badjs mysql = mysql: / / root: [email protected]:3306 / badjs Mongo = mongo: / / 192.168.1.101:27017 / badjsCopy the code

Mysql specifies your mysql database and mongodburl specifies your mongodb. Both parameters are required

Single-machine deployment

  1. Install the necessary environment mentioned earlier
  2. Git clone github.com/BetterJS/ba…
  3. Go to the badjs-installer directory and runnpm run clone, pull each module
  4. runnpm run install, install dependencies,This step can easily go wrongFor new users, it is recommended to enter each modulenpm install
  • Phantomjs was not installed successfully, please see #8
  1. Go to badjs-web/db and import create. SQL into mysql
  2. runnpm run start, start each module
  3. Visit http://127.0.0.1:8081/index.html, enter the startup success page.

Deploy in a multi-machine environment

  1. Download stable versions of each module
  • Codeload.github.com/BetterJS/ba…
  • Codeload.github.com/BetterJS/ba…
  • Codeload.github.com/BetterJS/ba…
  • Codeload.github.com/BetterJS/ba…
  1. For online environment configuration, please visit the configuration instructions of each module page:
  • Github.com/BetterJS/ba…
  • Github.com/BetterJS/ba…
  • Github.com/BetterJS/ba…
  • Github.com/BetterJS/ba…
  1. Start each module with Forever or NoHub

How to use

  1. Which is described on http://127.0.0.1:8081/index.html.
  2. After the installation is complete, use the default super account admin/admin to log in
  3. After successful login, click “My Business” in the upper right corner to enter the management interface, and click “Apply for Business”.
  4. After successful application, click “Management” -> “Application List” to review and approve your business.
  5. After the audit, the system will send the business information to BADJS-Accpeor, BADJS-MQ
  • To check whether the delivery is successful, enter badjs-acceptor to check project.db

At this point, the entire backend deployment has been successful. You can use badjs – report/example/index. The HTML validation test report.

How to report

  1. For any questions reported, please click on the links below
  • The report introduces
  • Report problem list
  • Report Return 403  

Million PV optimization

  • See # 15

Who is in use

Update log

v1.7
  • Storage Module Uses real-time statistics
  • Axon replace ZMQ
v1.6
  • Extraction of oa login module
  • The UI adjustment
  • bugfix
v1.5
  • Extraction of oa login module
  • The UI adjustment
v1.4
  • 10 million PV level optimization
  • Increase openapi
  • bugfix
v1.3
  • Mq module extraction
  • Restricted reporting rule
  • Adding Real-time Logs
  • Optimization of the report module
v1.2
  • Statistical function optimization
  • Add icon display
  • bugfix
  • Add project approval function
  • Optimization of the report module
v1.1
  • Add email function
  • Add statistics function
v1.0
  • Project online
  • Report function
  • Viewing Historical Logs