Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

Commit

Permalink
init backend, fix frontend module (#307)
Browse files Browse the repository at this point in the history
  • Loading branch information
SilenNaihin authored Aug 15, 2023
1 parent c59e5fb commit 8bc3710
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,10 @@ jobs:
poetry run python send_to_googledrive.py || echo "Failed to upload to Google Drive"
echo "Adding skill_tree submodule to update website"
poetry run agbenchmark start --mock
cd agbenchmark/challenges/frontend
cd frontend
git add .
git commit -m "Update website with new skill tree"
cd ../../..
cd ..
exit 0
else
echo "Attempt $(($attempts + 1)) failed. Retrying..."
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@
[submodule "agbenchmark/challenges"]
path = agbenchmark/challenges
url = https://github.com/agbenchmark/agent-evals.git
[submodule "frontend"]
path = frontend
url = https://github.com/agbenchmark/agbenchmark-frontend.git
2 changes: 1 addition & 1 deletion agbenchmark/challenges
Submodule challenges updated 2 files
+0 −3 .gitmodules
+0 −1 frontend
4 changes: 1 addition & 3 deletions agbenchmark/utils/dependencies/graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,7 @@ def graph_interactive_network(
json_graph = json.dumps(graph_data)

# Optionally, save to a file
with open(
Path("agbenchmark/challenges/frontend/public/graph.json").resolve(), "w"
) as f:
with open(Path("frontend/public/graph.json").resolve(), "w") as f:
f.write(json_graph)

if html_graph_path:
Expand Down
17 changes: 17 additions & 0 deletions backend/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware

app = FastAPI()

app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)


@app.get("/data")
async def read_data() -> dict[str, str]:
return {"data": "Hello, World!"}
1 change: 1 addition & 0 deletions backend/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fastapi
1 change: 1 addition & 0 deletions frontend
Submodule frontend added at 7e468e
11 changes: 11 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# poetry install

# cd backend
# pip install -r requirement.txt
# uvicorn your_module:app --reload

# cd frontend
# npm install
# npm run dev

# localhost:3000

0 comments on commit 8bc3710

Please sign in to comment.