Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3ba0b31
karni- changed path of sheets-key.json for render
karnishein Nov 30, 2026
9eb1aee
karni- added script for deploying git pages
karnishein Nov 30, 2026
4391fa8
karni- testing deployment
karnishein Nov 30, 2026
ffe544a
karni- removes package-lock.json from .gitignore
karnishein Nov 30, 2026
991cdab
karni- removes package-lock.json from .gitignore, but now fr
karnishein Nov 30, 2026
bdea949
karni- new package-lock
karnishein Nov 30, 2026
879258b
karni- updated deployment script
karnishein Nov 30, 2026
4674d1b
karni- added ${BACKEND_URL} to every api request from the frontend.
karnishein Nov 30, 2026
b567e77
karni- continued doing that\
karnishein Nov 30, 2026
ab91286
karni- testing
karnishein Nov 30, 2026
a327d00
karni- nevermind
karnishein Nov 30, 2026
26123be
karni- changed script
karnishein Nov 30, 2026
9108830
karni- tryinf
karnishein Nov 30, 2026
8e3c5c5
karni- maybe good?
karnishein Nov 30, 2026
8600e23
karni- maybe now good 2?
karnishein Nov 30, 2026
5b73589
karni- added import
karnishein Nov 30, 2026
5b90594
karni- added basename
karnishein Nov 30, 2026
1d6ef8b
karni- added cors
karnishein Nov 30, 2026
0b611a5
karni- added a solution for the 404 issue in the workflow
karnishein Dec 2, 2026
f680a64
karni- made the base url in vite env var
karnishein Dec 2, 2026
450c1c1
karni- merged with configure-git-pages
karnishein Dec 3, 2026
d329673
karni- testing
karnishein Dec 3, 2026
6a38afc
karni- capital
karnishein Dec 3, 2026
5f9056f
karni- testing x2
karnishein Dec 3, 2026
e9f8fb9
karni- testing x3
karnishein Dec 3, 2026
f284415
karni- fixed leaderboard urk
karnishein Dec 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/scouting/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
"author": "",
"license": "ISC",
"dependencies": {
"cors": "^2.8.6",
"process": "^0.11.10"
},
"devDependencies": {
"@types/cors": "^2.8.19",
"@types/node": "^24.8.1"
}
}
2 changes: 1 addition & 1 deletion apps/scouting/backend/src/googleSheets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const getBeeScouterCollection = flow(
);

const googleAuthentication = new google.auth.GoogleAuth({
keyFile: process.env.SHEETS_KEY_PATH ?? KEY_FILE_PATH,
keyFile: RENDER_KEY_FILE_PATH,
scopes: SCOPES,
});

Expand Down
7 changes: 7 additions & 0 deletions apps/scouting/backend/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import express from "express";
import { apiRouter } from "./routes";
import { startGoogleSheetsSync } from "./googleSheets";
import cors from "cors";

const app = express();

Expand All @@ -10,6 +11,12 @@ const port = process.env.BACKEND_PORT ?? defaultPort;

console.log(process.env.MONGO_URI);

app.use(
cors({
origin: "https://greenblitz.github.io",
}),
);

app.set("query parser", "extended");
app.use(express.json());
app.use("/api/v1", apiRouter);
Expand Down
1 change: 1 addition & 0 deletions apps/scouting/frontend/.env.development

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure you want to use env variables like this and not just put them in the .dev.env at the root project?

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_API_URL=http://localhost:4590
1 change: 1 addition & 0 deletions apps/scouting/frontend/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_API_URL=https://fullstack-projects-wn6p.onrender.com
2 changes: 2 additions & 0 deletions apps/scouting/frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import { Picklist } from "./strategy/tabs/picklist/Picklist";
import { PitManageTab } from "./strategy/tabs/pit-scout/PitManageTab";
import { ScoutingPass } from "./scouter/pages/ScoutingPass";

export const API_URL = import.meta.env.VITE_API_URL;

const App: FC = () => {
return (
<Routes>
Expand Down
2 changes: 1 addition & 1 deletion apps/scouting/frontend/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ registerSW({ immediate: true });

createRoot(document.getElementById("root")!).render(
<StrictMode>
<BrowserRouter>
<BrowserRouter basename={import.meta.env.BASE_URL}>
<div className="bg-[#242424]">
<App></App>
</div>
Expand Down
16 changes: 10 additions & 6 deletions apps/scouting/frontend/src/scouter/pages/Leaderboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import {
} from "@repo/scouting_types";
import { isEmpty } from "@repo/array-functions";
import { TierCosmeticBadge } from "../components/TierCosmeticBadge";
import { Link } from "react-router-dom";
import { API_URL } from "../../App";

const leaderboardUrl = "/api/v1/leaderboard/";

Expand All @@ -17,9 +19,11 @@ export const scouterColor: Record<string, string> = {
};

export const fetchCompetitionData = async () => {
const response = await axios.get(leaderboardUrl).catch((errorText) => {
throw new Error(`Server Error: ${errorText}`);
});
const response = await axios
.get(`${API_URL}${leaderboardUrl}`)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just do string1+string2 at this point

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or concat or smthing

.catch((errorText) => {
throw new Error(`Server Error: ${errorText}`);
});
const data = response.data;
return data.competitionScouters as CompetitionLeaderboard;
};
Expand Down Expand Up @@ -77,12 +81,12 @@ export const Leaderboard: React.FC = () => {
<h2 className="text-emerald-400 font-black tracking-tighter text-xl uppercase">
scouter Leaderboard
</h2>
<a
href="/scouting-pass"
<Link
to="/scouting-pass"
className="px-4 py-2 bg-white font-bold tracking-widest rounded-md hover:bg-gray-300 text-md"
>
View Scouting Pass
</a>
</Link>
</div>

<div className="p-2">
Expand Down
4 changes: 3 additions & 1 deletion apps/scouting/frontend/src/strategy/api/fetches.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { API_URL } from "../../App";

//בס"ד
const teamPageUrl = "/api/v1/teamPage/";

export const fetchTeamNumbers = async () => {
const url = `${teamPageUrl}teamNumbers`;
const url = `${API_URL}${teamPageUrl}teamNumbers`;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of concatinating every url with this, cant you use the vite config to make every fetch have this prefixed? Thats how it was when i did it


const response = await fetch(url, {
method: "GET",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { mapObject } from "@repo/array-functions";
import { useLocalStorage } from "@repo/local_storage_hook";
import { RecencyInput } from "./team/TeamSelect";
import { allGamesRecency } from "./team/TeamTab";
import { API_URL } from "../../App";

export type Column =
| "Score Tele"
Expand Down Expand Up @@ -61,7 +62,7 @@ const columnToKey: Record<Column, DataAccessor> = {

const fetchGeneralData = async (recency: number, filters = {}) => {
const params = new URLSearchParams(filters);
const url = `/api/v1/general/${recency}`;
const url = `${API_URL}/api/v1/general/${recency}`;

try {
const response = await fetch(url, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { useLocalStorage } from "@repo/local_storage_hook";
import { isEmpty } from "@repo/array-functions";
import { RecencyInput } from "../team/TeamSelect";
import { allGamesRecency } from "../team/TeamTab";
import { API_URL } from "../../../App";

export interface TeamListData {
teamNumber: number;
Expand All @@ -26,7 +27,7 @@ const fetchPicklist = async (
recency: number = allGamesRecency,
withAlerts?: boolean,
): Promise<TeamListData[] | undefined> => {
const response = await fetch(`${PICKLIST_URL}/${name}/${recency}`);
const response = await fetch(`${API_URL}${PICKLIST_URL}/${name}/${recency}`);

if (!response.ok) {
withAlerts && alert(`Could not load branch ${name}`);
Expand All @@ -48,7 +49,7 @@ const fetchPicklist = async (
const PICKLISTS_URL = "/api/v1/picklist/lists";

const fetchBranches = async () => {
const response = await fetch(PICKLISTS_URL);
const response = await fetch(`${API_URL}${PICKLISTS_URL}`);

if (!response.ok) {
return [];
Expand All @@ -60,7 +61,7 @@ const fetchBranches = async () => {

const savePicklist = async (name: string, list: string[]) => {
const picklist: PicklistBee = { name, list };
const response = await fetch(PICKLIST_URL, {
const response = await fetch(`${API_URL}${PICKLIST_URL}`, {
method: "POST",
headers: {
"Content-Type": "application/json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { BooleanStats } from "./BooleanStats";
import { PIT_SCOUT_URL } from "./PitScoutTab";
import { useEscapeKey } from "../../hooks/useEscapeKey";
import { getErrorMessage } from "@repo/axios";
import { API_URL } from "../../../App";

interface PitEditModalProps {
isOpen: boolean;
Expand Down Expand Up @@ -50,7 +51,7 @@ export const PitEditModal: React.FC<PitEditModalProps> = ({
setLoading(true);

try {
await axios.put(PIT_SCOUT_URL, formData);
await axios.put(`${API_URL}${PIT_SCOUT_URL}`, formData);
await onSuccess();
onClose();
} catch (error) {
Expand All @@ -64,7 +65,7 @@ export const PitEditModal: React.FC<PitEditModalProps> = ({
setLoading(true);

try {
await axios.delete(PIT_SCOUT_URL, {
await axios.delete(`${API_URL}${PIT_SCOUT_URL}`, {
data: { teamNumber: pitData.teamNumber },
});
await onSuccess();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import { LuCircleCheck, LuCircleX, LuMinus, LuPen } from "react-icons/lu";
import { PitEditModal } from "./PitEditModal";
import { PIT_SCOUT_URL } from "./PitScoutTab";
import axios from "axios";
import { API_URL } from "../../../App";

const fetchPitData = async (): Promise<PitScout[]> => {
const response = await axios.get<PitScout[]>(PIT_SCOUT_URL);
const response = await axios.get<PitScout[]>(`${API_URL}${PIT_SCOUT_URL}`);
return response.data;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import type {
import { BooleanStats } from "./BooleanStats";
import { FRC_TEAMS } from "@repo/frc";
import { StatusCodes } from "http-status-codes";
import { API_URL } from "../../../App";

export const PIT_SCOUT_URL = "/api/v1/pit/";

Expand Down Expand Up @@ -75,7 +76,7 @@ export const PitScoutTab: FC = () => {

setStatus("loading");
try {
const res = await fetch(PIT_SCOUT_URL, {
const res = await fetch(`${API_URL}${PIT_SCOUT_URL}`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(form),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type {
PitScoutBooleanMetric,
} from "@repo/scouting_types";
import { BOOLEAN_FIELDS } from "./PitScoutTab";
import { API_URL } from "../../../App";

const PIT_SCOUT_URL = "/api/v1/pit/";

Expand Down Expand Up @@ -144,7 +145,7 @@ export const PitScoutResultsTab: FC<PitScoutResultsTabProps> = ({
const [selectedTeam, setSelectedTeam] = useState<number | null>(null);

useEffect(() => {
fetch(PIT_SCOUT_URL)
fetch(`${API_URL}${PIT_SCOUT_URL}`)
.then((response) => response.json())
.then((data: PitScout[]) => {
setAllForms(data);
Expand Down
3 changes: 2 additions & 1 deletion apps/scouting/frontend/src/strategy/tabs/team/TeamTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ import { StatView } from "./StatView";
import { NotesCell, PitScoutResultsTab } from "../pit-scout/TeamPitShow";
import { SuperBarChart } from "./SuperBarChart";
import { ThrowBarChart } from "./ThrowBarChart";
import { API_URL } from "../../../App";

const TEAM_DATA_URL = "/api/v1/teamPage/matches";
const NO_DATA_ON_TEAM_STATUS = 502;

export const allGamesRecency = 100;
export async function fetchTeamData(team: number, recency: number | null) {
const response = await fetch(
`${TEAM_DATA_URL}/${recency ?? allGamesRecency}?teamNumber=${team.toString()}`,
`${API_URL}${TEAM_DATA_URL}/${recency ?? allGamesRecency}?teamNumber=${team.toString()}`,
);

if (response.status === NO_DATA_ON_TEAM_STATUS) {
Expand Down
8 changes: 8 additions & 0 deletions apps/scouting/frontend/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
// בס"ד
/// <reference types="vite/client" />
/// <reference types="vite-plugin-pwa/client" />

interface ImportMetaEnv {
readonly VITE_API_URL: string;
}

interface ImportMeta {
readonly env: ImportMetaEnv;
}
4 changes: 2 additions & 2 deletions apps/scouting/frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const DEFAULT_PORT = 80;
const port = parseInt(process.env.FRONTEND_PORT ?? DEFAULT_PORT.toString());

export default defineConfig({
base: "/Full-Stack-Projects/",
base: process.env.NODE_ENV === "production" ? "/Full-Stack-Projects/" : "/",
appType: "spa",
server: {
port: port,
Expand Down Expand Up @@ -74,4 +74,4 @@ export default defineConfig({
},
}),
],
});
});
38 changes: 38 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading