From d556b0abaf288ee53d5494d28711952cf9def209 Mon Sep 17 00:00:00 2001 From: cyclotruc Date: Tue, 31 Dec 2024 06:30:01 +0000 Subject: [PATCH] Update README.md --- README.md | 83 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 55 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 70a2192..01ab27d 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,6 @@ [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![Discord](https://dcbadge.limes.pink/api/server/https://discord.com/invite/zerRaGK9EC)](https://discord.com/invite/zerRaGK9EC) - Turn any Git repository into a prompt-friendly text ingest for LLMs. You can also replace `hub` with `ingest` in any github url to access the coresponding digest @@ -63,13 +62,6 @@ summary, tree, content = ingest("https://github.com/cyclotruc/gitingest") By default, this won't write a file but can be enabled with the `output` argument -## 🛠️ Using - -- Tailwind CSS - Frontend -- [FastAPI](https://github.com/fastapi/fastapi) - Backend framework -- [tiktoken](https://github.com/openai/tiktoken) - Token estimation -- [apianalytics.dev](https://www.apianalytics.dev/) - Simple Analytics - ## 🌐 Self-host 1. Build the image: @@ -85,35 +77,45 @@ By default, this won't write a file but can be enabled with the `output` argumen ``` The application will be available at `http://localhost:8000` -Ensure environment variables are set before running the application or deploying it via Docker. -## ✔️ Contributing +If you are hosting it on a domain, you can specify the allowed hostnames via env variable `ALLOWED_HOSTS`. -Contributions are welcome! + ```bash + #Default: "gitingest.com,*.gitingest.com,localhost, 127.0.0.1". + ALLOWED_HOSTS="example.com, localhost, 127.0.0.1" + ``` -Gitingest aims to be friendly for first time contributors, with a simple python and html codebase. If you need any help while working with the code, reach out to us on [discord](https://discord.com/invite/zerRaGK9EC) +## 🛠️ Stack -### Ways to contribute +- [Tailwind CSS](https://tailwindcss.com/) - Frontend +- [FastAPI](https://github.com/fastapi/fastapi) - Backend framework +- [Jinja2](https://jinja.palletsprojects.com/) - HTML templating +- [tiktoken](https://github.com/openai/tiktoken) - Token estimation +- [apianalytics.dev](https://www.apianalytics.dev/) - Simple Analytics -1. Provide your feedback and ideas on discord -2. Open an Issue on github to report a bug -3. Create a Pull request - - Fork the repository - - Make your changes and test them locally - - Open a pull request for review and feedback +## ✔️ Contributing to Gitingest -### 🔧 Local dev +Gitingest aims to be friendly for first time contributors, with a simple python and html codebase. + If you need any help while working with the code, reach out to us on [discord](https://discord.com/invite/zerRaGK9EC) -#### Environment Configuration +### Ways to help (non-technical) -- **`ALLOWED_HOSTS`**: Specify allowed hostnames for the application. Default: `"gitingest.com,*.gitingest.com,gitdigest.dev,localhost"`. -You can configure the application using the following environment variables: +- Provide your feedback and ideas on discord +- Open an Issue on github to report a bug / submit an feature request +- Talk about Gitingest on social media -```bash -ALLOWED_HOSTS="gitingest.local,localhost" -``` +### How to submit a PR + +1. Fork the repository & clone it locally +2. Setup the dev environment (see Development section bellow) +3. Run unit tests with `pytest` +4. Commit your changes and run `pre-commit` +5. Open a pull request on Github for review and feedback +6. (Optionnal) Invite project maintainer to your branch for easier collaboration + +## 🔧 Development -#### Run locally +### Run web UI locally 1. Clone the repository @@ -125,7 +127,10 @@ ALLOWED_HOSTS="gitingest.local,localhost" 2. Install dependencies ```bash - pip install -r requirements.txt + pip install -r requirements-dev.txt + python -m venv .venv + source .venv/bin/activate + pre-commit install ``` 3. Run the application: @@ -134,3 +139,25 @@ ALLOWED_HOSTS="gitingest.local,localhost" cd src uvicorn main:app --reload ``` + +4. Run unit tests + + ```bash + pytest + ``` + +The application should be available at `http://localhost:8000` + +### Working on the CLI + +1. Install the package in dev mode + + ```bash + pip install -e . + ``` + +2. Run the CLI + + ```bash + gitingest --help + ```