aghilsabu commited on
Commit
67c5c39
Β·
1 Parent(s): 8942ea4

chore: add Makefile with development commands

Browse files
Files changed (1) hide show
  1. Makefile +43 -0
Makefile ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .PHONY: install run dev clean deploy help
2
+
3
+ # Python configuration
4
+ PYTHON = python3
5
+ VENV = .venv
6
+ VENV_PYTHON = $(VENV)/bin/python
7
+ VENV_PIP = $(VENV)/bin/pip
8
+ PORT = 7860
9
+
10
+ help: ## Show this help message
11
+ @echo ""
12
+ @echo " πŸ—οΈ CodeAtlas - Commands"
13
+ @echo " ========================"
14
+ @echo ""
15
+ @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-12s\033[0m %s\n", $$1, $$2}'
16
+ @echo ""
17
+
18
+ install: ## Create venv and install dependencies
19
+ @echo "πŸ“¦ Creating virtual environment..."
20
+ @$(PYTHON) -m venv $(VENV)
21
+ @$(VENV_PIP) install --upgrade pip
22
+ @$(VENV_PIP) install -r requirements.txt
23
+ @echo "βœ… Done! Run 'make run' to start"
24
+
25
+ run: ## Run the application
26
+ @lsof -ti:$(PORT) | xargs kill -9 2>/dev/null || true
27
+ @echo "πŸš€ Starting CodeAtlas on http://localhost:$(PORT)"
28
+ @$(VENV_PYTHON) app.py
29
+
30
+ dev: ## Run with auto-reload
31
+ @lsof -ti:$(PORT) | xargs kill -9 2>/dev/null || true
32
+ @echo "πŸ”§ Starting in dev mode..."
33
+ @GRADIO_WATCH_DIRS=. $(VENV_PYTHON) app.py
34
+
35
+ deploy: ## Deploy backend to Modal
36
+ @echo "☁️ Deploying to Modal..."
37
+ @modal deploy modal_backend.py
38
+ @echo "βœ… Deployed!"
39
+
40
+ clean: ## Remove venv and cache files
41
+ @rm -rf $(VENV) __pycache__ src/**/__pycache__ .session_state.json
42
+ @rm -rf data/diagrams/* data/audios/* data/logs/*
43
+ @echo "βœ… Cleaned!"