Momentum Core Save

open-source code auditor for backend

Project README

pypi package Apache 2.0

The open-source behavioural auditor for backend code

From git push to production-ready: See the unseen, test the untested


Explore the docs »

Report Bug · Request Feature · Join Our Discord · Roadmap · X

Momentum is an open-source tool designed to generate and understand powerful insights into your codebase. It helps you understand changes and impacts, generate test behaviours and test code and much more.

Table of Contents

Introduction

momentum is a code auditor that analyses the necessary code behavior and tests it at every git push to ensure the code is ready for production. It understands your backend codebase and generates visualisation and precise context for test plans and test cases for all entry points detected in the system.

Features

features
  • Blast Radius: This will be a list of endpoints that could potentially be affected by the changes you made in your code. This will also be a starting point to decide what parts of your code need to be tested before shipping to production..
  • Dependency Visualization: Visualize code dependencies and relationships.
  • Behaviour identification: Automatically identify behaviors written in your code and generate a plan to test their functionality
  • Code generation to test functionality: Generate code to test all behaviors identified and run it in your local environment through momentum

Installation

To get started with Momentum, follow these steps:

Steps

  1. Clone the repository:

    git clone https://github.com/getmomentum/momentum-core.git
    cd momentum-core
    
  2. Set up the database via Docker:

    docker-compose up
    
  3. Set up environment:

    python -m venv .venv
    source .venv/bin/activate
    pip install -r requirements.txt
    
  4. Run migrations: Create a .env inside /server based on .env.template

    alembic upgrade head
    
  5. Setup keys: You will have to setup keys for services like firebase auth, github app, Open AI, portkey among others. Follow the detailed instructions here

  6. Start the application:

    uvicorn server.main:app --host 0.0.0.0 --port 8001
    

Build Instructions with docker

  1. Set Up the Environment: Configure your environment variables by creating a .env file based on the .env.template provided in the repository. This file should include all necessary configuration settings for the application.

  2. Google Cloud Authentication: Log in to your Google Cloud account and set up Application Default Credentials (ADC). You can find detailed instructions here.

  3. Build Docker Image: Build the Docker image using the following command:

    docker build -t momentum .
    
  4. Bring the required infrastructure up:

    docker-compose up
    
  5. Run migrations: Ensure .env is correctly setup

    alembic upgrade head
    
  6. Run Momentum

    ./run-momentum.sh
    

    Note: (a) Read the shell script to modify google cloud credentials if needed (b) You might need to make it an executable, do it by running chmod +x run-momentum.sh

Usage

After installation, you can access Momentum at http://localhost:8001. Key functionalities include:

  • User Authentication
  • Parsing Codebase
  • Listing Parsed Projects and Branches
  • Generating Blast Radius
  • Visualizing Dependencies and Flow Graphs
  • Setting Preferences for Endpoints
  • Generating and Setting Up Test Plans

For detailed usage instructions, visit the Momentum Documentation.

Contributing

We welcome contributions from the community. To contribute:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Commit your changes (git commit -am 'Add new feature').
  4. Push to the branch (git push origin feature-branch).
  5. Open a Pull Request.

Refer to the Contributing Guide for more details.

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

💪 Thanks To All Contributors

Thanks a lot for spending your time helping build momentum. Keep rocking 🥂

Contributors
Open Source Agenda is not affiliated with "Momentum Core" Project. README Source: getmomentum/momentum-core
Stars
48
Open Issues
2
Last Commit
1 day ago
License

Open Source Agenda Badge

Open Source Agenda Rating