Chunhua Liao commited on
Commit
1a37db9
·
1 Parent(s): 00a3617

Add Makefile for easier execution

Browse files
Files changed (2) hide show
  1. Makefile +18 -0
  2. README.md +4 -4
Makefile ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Makefile for AI Co-Scientist Application
2
+
3
+ # Default host and port (can be overridden)
4
+ HOST ?= 0.0.0.0
5
+ PORT ?= 8000
6
+
7
+ # Default target: run the application without reload
8
+ run:
9
+ @echo "Starting AI Co-Scientist server on $(HOST):$(PORT)..."
10
+ uvicorn app.api:app --host $(HOST) --port $(PORT)
11
+
12
+ # Target to run with auto-reload for development
13
+ run-reload:
14
+ @echo "Starting AI Co-Scientist server on $(HOST):$(PORT) with reload..."
15
+ uvicorn app.api:app --host $(HOST) --port $(PORT) --reload
16
+
17
+ # Phony targets to avoid conflicts with filenames
18
+ .PHONY: run run-reload
README.md CHANGED
@@ -48,12 +48,12 @@ Original code was generated by o3-mini-high
48
  ```
49
  3. **Run the Application:**
50
  ```bash
51
- # Run using Uvicorn, specifying the app location within the package
52
- uvicorn app.api:app --host 0.0.0.0 --port 8000
53
  ```
54
- (Alternatively, if you want hot-reloading during development: `uvicorn app.api:app --host 0.0.0.0 --port 8000 --reload`)
55
 
56
- (You can also potentially run `python -m app.main` if the `app/main.py` is set up correctly for module execution, but the `uvicorn` command is more standard for FastAPI.)
57
  4. **Access the Web Interface:**
58
  Open a web browser and go to `http://localhost:8000`. (Note: The server log may show `http://0.0.0.0:8000`, which means the server is listening on all network interfaces. However, you should use `localhost` in your browser to access the server from your local machine. You cannot directly type `0.0.0.0` into your browser's address bar.)
59
  5. **Enter Research Goal:**
 
48
  ```
49
  3. **Run the Application:**
50
  ```bash
51
+ # Use the Makefile (default target runs uvicorn)
52
+ make run
53
  ```
54
+ (Alternatively, for development with auto-reload: `make run-reload`)
55
 
56
+ (This uses the command `uvicorn app.api:app --host 0.0.0.0 --port 8000` internally.)
57
  4. **Access the Web Interface:**
58
  Open a web browser and go to `http://localhost:8000`. (Note: The server log may show `http://0.0.0.0:8000`, which means the server is listening on all network interfaces. However, you should use `localhost` in your browser to access the server from your local machine. You cannot directly type `0.0.0.0` into your browser's address bar.)
59
  5. **Enter Research Goal:**