Skip to content

Le0C/repo-viewer-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Repo Viewer (backend)

This is the backend service for the repo-viewer application. It is built with Node.js and TypeScript, providing API endpoints and data processing for the frontend viewer.

Features

  • RESTful API server
  • SQLite database integration
  • Modular processing pipeline
  • TypeScript for type safety
  • Easily extensible architecture

Prerequisites

  • Node.js (v16 or later recommended)
  • npm (comes with Node.js)

Installation

  1. Clone the repository:
    git clone <repo-url>
    cd backend
  2. Install dependencies:
    npm install

Development

  • Source code is in the src/ directory.
  • To build the project:
    npm run build
  • To start the server (after building):
    npm start
  • For development with auto-reload:
    npm run dev

Usage

Once the backend is up and running, you can send the filepath of the repository on your machine that you want to analyse via the viewer-frontend app.

The filepath of the project to analyse should be given relative to the location of this repo.

Project Structure

backend/
├── build/              # Compiled JavaScript output
│   ├── app.js
│   ├── db.js
│   ├── server.js
│   ├── types.js
│   └── process/
│       ├── file.js
│       ├── filter.js
│       ├── index.js
│       └── morph.js
├── data/               # Application data (ignored by git)
│   ├── app.db
│   └── tree.json
├── src/                # TypeScript source code
│   ├── app.ts
│   ├── db.ts
│   ├── server.ts
│   ├── types.ts
│   └── process/
│       ├── file.ts
│       ├── filter.ts
│       ├── index.ts
│       └── morph.ts
│   └── schema/
│       └── schema.sql
├── package.json        # Project metadata and dependencies
├── tsconfig.json       # TypeScript configuration
└── .gitignore          # Git ignore rules

Database

  • The backend uses SQLite for data storage.
  • The database file is located at data/app.db.
  • The schema is defined in src/schema/schema.sql.

Scripts

  • npm run build — Compile TypeScript to JavaScript
  • npm start — Start the compiled server
  • npm run dev — Start the server with auto-reload (requires nodemon)

About

When up and running, this app exposes a single endpoint which runs the application logic. This endpoint receives the filepath of a repository relative to the root of this directory, and uses the tsconfig of that repository as the entry point for analysis.

The graph of the project is stored in app.db, and a JSON file representing the project is stored in tree.json

The return type of the endpoint is a D3ForceTree.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published