-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (54 loc) · 2.05 KB
/
Makefile
File metadata and controls
61 lines (54 loc) · 2.05 KB
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
51
52
53
54
55
56
57
58
59
60
61
.PHONY: backend frontend dev help clean install local
# Default target
help:
@echo "Available commands:"
@echo " backend - Run backend development server"
@echo " frontend - Run frontend development server"
@echo " dev - Run both backend and frontend concurrently"
@echo " local - Set up and run complete local stack (with MongoDB)"
@echo " install - Install dependencies for both backend and frontend"
@echo " clean - Clean node_modules and build artifacts"
@echo " help - Show this help message"
# Run backend development server
backend:
@echo "Starting backend development server..."
cd backend && npm run start:dev
# Run frontend development server
frontend:
@echo "Starting frontend development server..."
cd frontend && npm run dev
# Run both backend and frontend concurrently
dev:
@echo "Starting both backend and frontend..."
@trap 'kill %1; kill %2' EXIT; \
make backend & make frontend & \
wait
# Install dependencies for both projects
install:
@echo "Installing backend dependencies..."
cd backend && npm install
@echo "Installing frontend dependencies..."
cd frontend && pnpm install
# Clean build artifacts and node_modules
clean:
@echo "Cleaning backend..."
cd backend && rm -rf node_modules dist
@echo "Cleaning frontend..."
cd frontend && rm -rf node_modules dist
# Set up and run complete local stack
local:
@echo "Setting up local development environment..."
@make install
@echo "Setting up environment files..."
@cp backend/.env.example backend/.env
@echo "Created backend/.env from backend/.env.example"
@cp frontend/.env.example frontend/.env
@echo "Created frontend/.env from frontend/.env.example"
@echo "Starting MongoDB container..."
@docker ps --filter "name=cryptly-mongo" --format '{{.Names}}' | grep -q cryptly-mongo && \
echo "MongoDB container already running" || \
(docker run -d --name cryptly-mongo -p 2137:27017 mongo:8 && echo "Started MongoDB 8 on port 2137")
@echo "Starting backend and frontend..."
@trap 'kill %1; kill %2' EXIT; \
make backend & make frontend & \
wait