Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
8d05943
setup docker compose file for prod deployment
MeasureOneCodeTwice Mar 26, 2026
908dbc1
add deployment compose file for webserver + re-arranged + workflow ta…
MeasureOneCodeTwice Mar 26, 2026
aa54a2d
Make upgrade-images.sh executable
MeasureOneCodeTwice Mar 26, 2026
6ac006d
add sudo to docker commands
MeasureOneCodeTwice Mar 26, 2026
fd27673
added readme.md
MeasureOneCodeTwice Mar 26, 2026
d594494
make upgrade-images.sh executable
MeasureOneCodeTwice Mar 26, 2026
f3f8dd1
start docker daemon in start.sh
MeasureOneCodeTwice Mar 26, 2026
4475358
make everything use constants to get ready for AWS hosting
MeasureOneCodeTwice Mar 27, 2026
1a7a869
localhost -> api_gateway_url in config
MeasureOneCodeTwice Mar 27, 2026
9d3d70e
added HTTP security group for webserver
MeasureOneCodeTwice Mar 27, 2026
9992ba2
finishing touches
MeasureOneCodeTwice Mar 27, 2026
6e9d725
script to remove all workflow runs - useful to get rid of troubleshoo…
MeasureOneCodeTwice Mar 27, 2026
4095272
Merge branch 'development' into feature/content-delivery
MeasureOneCodeTwice Mar 27, 2026
6d7a8be
disabling db reliant integration tests
TebelR Mar 27, 2026
746b14c
temp
MeasureOneCodeTwice Mar 27, 2026
ac032c2
removed node modules in server directory
MeasureOneCodeTwice Mar 27, 2026
018e65e
Merge branch 'development' into feature/content-delivery
MeasureOneCodeTwice Mar 31, 2026
0f51b31
Merge branch 'development' into feature/content-delivery
MeasureOneCodeTwice Apr 1, 2026
d5f1396
Changed release version to local so ci-pipeline pulls uses newly buil…
MeasureOneCodeTwice Apr 1, 2026
cb36980
add PATH back to CORS allowed methods
MeasureOneCodeTwice Apr 2, 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
11 changes: 11 additions & 0 deletions .github/workflows/delete_all_workflow_runs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
REPO="MeasureOneCodeTwice/Finus"

# Optional: count runs first
gh api --paginate "/repos/$REPO/actions/runs?per_page=100" --jq '.workflow_runs[].id' | wc -l

# Delete everything
gh api --paginate "/repos/$REPO/actions/runs?per_page=100" --jq '.workflow_runs[].id' \
| while read -r RUN_ID; do
echo "Deleting run $RUN_ID"
gh api -X DELETE "/repos/$REPO/actions/runs/$RUN_ID" >/dev/null
done
8 changes: 8 additions & 0 deletions .github/workflows/docker_compose_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ jobs:
docker compose build
echo "Pushing images..."
docker compose push

echo RELEASE_VERSION=latest > .env
echo DOCKER_HUB_USERNAME=$DOCKER_HUB_USERNAME >> .env
echo "Re-building with lastest tag..."
docker compose build
echo "Pushing images..."
docker compose push

env:
DOCKER_HUB_USERNAME: ${{ inputs.DOCKER_HUB_USERNAME }}

2 changes: 1 addition & 1 deletion app/client/.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

#docker-file
DOCKER_HUB_USERNAME=measureonecodetwice
RELEASE_VERSION=0.0.1
RELEASE_VERSION=latest
4 changes: 2 additions & 2 deletions app/client/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ services:

webserver:
image: $DOCKER_HUB_USERNAME/finus-webserver:$RELEASE_VERSION
build:
build:
dockerfile: Dockerfile
ports:
- "80:80"
depends_on:
depends_on:
- webserver-base
7 changes: 2 additions & 5 deletions app/client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ import DashboardPage from "./pages/DashboardPage.tsx";
import MarketsPage from "./pages/MarketsPage";
import AppLayout from "./components/AppLayout.tsx";
import ProjectionPage from "./pages/ProjectionPage.tsx";

const SESSION_STORAGE_KEY = "finus-session";
const API_BASE_URL =
import.meta.env.VITE_API_BASE_URL ?? "http://localhost:3000";
import { BASE_URL, SESSION_STORAGE_KEY } from "@/utils/constants";

function isValidAuthUser(value: unknown): value is AuthUser {
if (!value || typeof value !== "object") {
Expand Down Expand Up @@ -104,7 +101,7 @@ async function requestAuth(
payload: Record<string, unknown>,
): Promise<AuthApiResponse> {
try {
const response = await fetch(`${API_BASE_URL}${path}`, {
const response = await fetch(`${BASE_URL}${path}`, {
method: "POST",
headers: {
"Content-Type": "application/json",
Expand Down
3 changes: 2 additions & 1 deletion app/client/src/api/Account.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import type { updateResponse } from "../types/responseTypes";
import type { Account } from "../types/AccountType";
import type { AuthSession } from "@/types/authTypes";
import { BASE_URL } from "@/utils/constants";

const requestUrl = "http://localhost:3000/api/accounts";
const requestUrl = `${BASE_URL}/api/accounts`;

//Sends a request to get different accounts the user has
export async function getUserAccounts(
Expand Down
4 changes: 2 additions & 2 deletions app/client/src/api/AuthAPI.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { AuthApiResponse } from "@/types/authTypes";
import { API_BASE_URL } from "@/utils/constants";
import { BASE_URL } from "@/utils/constants";

export async function requestAuth(
path: string,
payload: Record<string, unknown>,
): Promise<AuthApiResponse> {
try {
const response = await fetch(`${API_BASE_URL}${path}`, {
const response = await fetch(`${BASE_URL}${path}`, {
method: "POST",
headers: {
"Content-Type": "application/json",
Expand Down
3 changes: 2 additions & 1 deletion app/client/src/api/Income.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import type { updateResponse } from "../types/responseTypes";
import { type Income } from "../types/IncomeType";
import type { AuthSession } from "@/types/authTypes";
import { BASE_URL } from "@/utils/constants";

const requestUrl = "http://localhost:3000/api/income";
const requestUrl = `${BASE_URL}/api/income`;

export async function getIncome(session: AuthSession): Promise<Income[]> {
try {
Expand Down
5 changes: 1 addition & 4 deletions app/client/src/api/Market.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ type MarketHistoryResponse = {
points: MarketHistoryPoint[];
};

function toMarketApiError(
error: unknown,
fallbackMessage: string,
): Error {
function toMarketApiError(error: unknown, fallbackMessage: string): Error {
if (axios.isAxiosError(error)) {
const detail = error.response?.data?.detail;
if (typeof detail === "string" && detail.length > 0) {
Expand Down
3 changes: 2 additions & 1 deletion app/client/src/api/Transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import type { AuthSession } from "@/types/authTypes";
import type { updateResponse } from "../types/responseTypes";
import type { Transaction } from "../types/Transaction";
import type { TransactionDraft } from "@/utils/ConvertTransaction";
import { BASE_URL } from "@/utils/constants";

const requestUrl = "http://localhost:3000/api/transactions";
const requestUrl = `${BASE_URL}/api/transactions`;

//Sends a GET request to get the list of user transactions for the account
export async function getTransactions(
Expand Down
8 changes: 2 additions & 6 deletions app/client/src/utils/constants.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
export const BASE_URL = "http://localhost:3000"; //change this to the public link once microservices are hosted on AWS

export const SIDEBAR_WIDTH = 260;

export const BASE_URL = "http://3.150.23.72:3000";
export const SESSION_STORAGE_KEY = "finus-session";
export const API_BASE_URL =
import.meta.env.VITE_API_BASE_URL ?? "http://localhost:3000";
export const SIDEBAR_WIDTH = 260;
10 changes: 9 additions & 1 deletion app/server/services/python/analytics/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@
app = FastAPI()

# CORS setup
origins = ["http://localhost:8080", "http://localhost:3000", "http://127.0.0.1:8080", "http://127.0.0.1:3000"]
origins = [
"http://localhost:8080",
"http://localhost:3000",
"http://127.0.0.1:8080",
"http://127.0.0.1:3000",
"http://18.190.215.135", #prod webserver
"http://3.142.125.202", #dev webserver
]

app.add_middleware(
CORSMiddleware,
allow_origins=origins,
Expand Down
2 changes: 1 addition & 1 deletion app/server/services/ts/auth/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { getConnectionPool, getDatabaseStatus } from "@/sqlUtil";

const pool = getConnectionPool();
const app = express();
app.use(express.json());
app.use(buildCorsConfig());
app.use(express.json());

app.post("/signup", async (req, res) => {
let body: SignupBody;
Expand Down
19 changes: 11 additions & 8 deletions app/server/services/ts/common/expressUtils.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import cors from "cors";

const defaultMethods = ["GET", "POST", "PATCH", "PUT", "DELETE", "OPTIONS"];
const defaultOrigins = ["http://localhost", "http://localhost:8080"];
export function buildCorsConfig(opts?: {
origins?: string | string[];
methods?: string[];
}) {
const defaultMethods = ["GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH"];
const origins = [
"http://localhost",
"http://localhost:8080",
"http://18.190.215.135", //prod webserver
"http://3.142.125.202", //dev webserver
];

export function buildCorsConfig(opts?: { methods?: string[] }) {
return cors({
origin: opts?.origin ?? defaultOrigins,
origin: origins,
methods: opts?.methods ?? defaultMethods,
credentials: true,
allowedHeaders: ["Content-Type", "Authorization"],
Expand All @@ -21,7 +24,7 @@ export async function handleServerError(
) {
await func().catch((e) =>
res.status(500).json({
message: message ?? e.message,
message: e.message ?? message,
}),
);
}
Loading