Giter Site home page Giter Site logo

preetamsing / tracetrail Goto Github PK

View Code? Open in Web Editor NEW

This project forked from okayshankha/tracetrail

0.0 0.0 0.0 7.98 MB

Simple payload Recorder like ngrok, ideal for a large-scale application or a basic project. It makes debugging easier, allowing you to rapidly detect and handle any problems that may develop.

License: GNU Affero General Public License v3.0

Shell 0.01% TypeScript 5.36% CSS 94.54% HTML 0.09%

tracetrail's Introduction

Tracetrail

Introducing "Tracetrail" - the npm package that streamlines the API debugging process. This package enables you to record the input and output payloads transferred to and from your client or server with ease.

Tracetrail makes it simple to find out what payload was transmitted by the client or received as a response from the server. This package is particularly created to assist you in more effectively debugging your APIs, making it a crucial tool for developers.

Payload Recorder is ideal for anybody working on a large-scale application or a basic project. It makes debugging easier, allowing you to rapidly detect and handle any problems that may develop. You can quickly navigate through the recorded payloads and receive insights into the performance of your API thanks to its user-friendly interface.

Installation

npm install tracetrail

Usage

import { TraceTrail } from 'tracetrail'
import express from 'express'

const port = 4444
const app = express()

// You can use a separate database to keep things neat and clean.
const traceTrail = new TraceTrail('mongodb://localhost:27017/TraceTrail')

// You need to use traceTrail.MiddleWare to make this package work.
app.use(traceTrail.MiddleWare)

app.listen(port, () => {
    console.log(`App listening on port ${port}`)
})

UI

To get the inbuilt UI you can easily code it like this.

image

import { TraceTrail } from 'tracetrail'
import express from 'express'

const port = 4444
const app = express()

// You can use a separate database to keep things neat and clean.
const traceTrail = new TraceTrail('mongodb://localhost:27017/TraceTrail')

// Get the UI
app.use('/tracetrail', traceTrail.UI())

// You need to use traceTrail.MiddleWare to make this package work.
app.use(traceTrail.MiddleWare)

app.listen(port, () => {
    console.log(`App listening on port ${port}`)
})

Developers Guide

If you want to set up the project in your local follow these steps:

  • Terminal #1
    • Clone the repository
    • Run following command npm i
    • Now run npm run build
    • Go to the examples folder and pick any file of your choice JavaScript one or TypeScript one.
    • Update the MongoDB url.
    • Then open a terminal in the root directory.
    • To run the Server written in JavaScript run npm run example:js
    • Or to run the Server written in TypeScript run npm run example:ts

  • Terminal #2
    • Run cd react-ui && npm start it will start the React App in development mode.
    • Now you will find one find inside react-ui .env.development.local modify the value of REACT_APP_API_BASE_URL only if you have changed the server port in examples/javascript-example.js or examples/typescript-example.ts.
    • If you are not sure leave REACT_APP_API_BASE_URL as it is.

That's it, you are all set. Now you can open your browser and open http//:localhost:3000 it will open TraceTrail UI.

If you haven't changed any ports, then the following would be true.

  • Backend Server: http//:localhost:4444
  • React Front End: http//:localhost:3000

Future Scope

  • Login page for access authorization
  • Socket.io implementation for real-time data fetch
  • Support multiple databases
  • Write test cases

tracetrail's People

Contributors

okayshankha avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.