Skip to content

Commit e83d039

Browse files
committed
update snapshot_event_handler readme
1 parent fc97492 commit e83d039

File tree

1 file changed

+54
-0
lines changed
  • codegen-examples/examples/snapshot_event_handler

1 file changed

+54
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Event Handler with codebase snapshotting
2+
3+
This project is designed to using Modal snapshotting to provide parsed codebase instances with minimal latency, make it more manageable to write event based handlers.
4+
5+
Follow the instructions below to set up and deploy the application.
6+
7+
## Prerequisites
8+
9+
Before you begin, ensure you have the following installed and configured:
10+
11+
1. **uv**: A tool for managing virtual environments and syncing dependencies.
12+
2. **Modal**: Ensure you have Modal configured on your system.
13+
14+
## Setup Instructions
15+
16+
1. **Create a Virtual Environment**
17+
18+
Use `uv` to create a virtual environment with Python 3.13:
19+
20+
```bash
21+
uv venv --python 3.13
22+
23+
source ./venv/bin/activate
24+
```
25+
26+
2. **Sync Dependencies**
27+
28+
Sync the project dependencies using `uv`:
29+
30+
```bash
31+
uv sync
32+
```
33+
34+
3. **Deploy to Modal**
35+
36+
Deploy the application to Modal by running:
37+
38+
```bash
39+
uv run modal deploy event_handlers.py
40+
```
41+
42+
This command will deploy the Modal app and provide a web URL for your webhook sync.
43+
44+
## Project Structure
45+
46+
- `event_handlers.py`: Contains the main logic for handling events.
47+
- `pr_tasks.py`: Additional tasks related to pull requests.
48+
- `.env.template` and `.env`: Environment variable templates and configurations.
49+
- `pyproject.toml`: Project configuration and dependencies.
50+
51+
52+
## Integration
53+
54+
Once deployed, you can use the deployed web_url as the webhook endpoint for your slack, linear, or github webhooks.

0 commit comments

Comments
 (0)