-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
50 lines (37 loc) · 1.01 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Variables
PYTHON = python3
PIP = pip3
NPM = pnpm
VITE = pnpm run dev
# Backend variables
BE_DIR = ./BE
BE_MAIN = $(BE_DIR)/main.py
BE_REQUIREMENTS = $(BE_DIR)/requirements.txt
# Frontend variables
FE_DIR = ./FE
# Targets
.PHONY: all backend frontend install_be install_fe clean_be clean_fe
# Install dependencies for backend and frontend
all: install_be install_fe
# Install backend dependencies
install_be:
cd $(BE_DIR) && $(PIP) install -r requirements.txt
# Install frontend dependencies
install_fe:
cd $(FE_DIR) && $(NPM) install
# Run backend
backend:
cd $(BE_DIR) && bash -c "source venv/bin/activate && uvicorn main:app --reload --workers 10"
# Run frontend
frontend:
cd $(FE_DIR) && $(VITE)
# Clean backend (for example, remove __pycache__)
clean_be:
rm -rf $(BE_DIR)/__pycache__
# Clean frontend (for example, remove node_modules)
clean_fe:
rm -rf $(FE_DIR)/node_modules
# Clean both backend and frontend
clean: clean_be clean_fe
# Run both backend and frontend concurrently
start: backend frontend