Skip to content

Commit

Permalink
proxy remove
Browse files Browse the repository at this point in the history
  • Loading branch information
leftmove authored Dec 6, 2023
1 parent 442e43d commit fadb4db
Show file tree
Hide file tree
Showing 60 changed files with 8,484 additions and 8,322 deletions.
2 changes: 2 additions & 0 deletions backend/.env.development
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ FINN_HUB_API_KEY = "cf89282ad3i8qmbtm790cf89282ad3i8qmbtm79g"
ALPHA_VANTAGE_API_KEY = "EI94B6EQ2QPL52UZ"
OPEN_FIGI_API_KEY = "6e8d19f1-6f63-4e22-aee0-51fb3406031c"

ANALYTICS_API_KEY = "22b77895-1033-4e4a-a781-6388f77b0062"

MONGO_SERVER_URL = "mongodb://${SERVER}:27017"
MONGO_BACKUP_URL = "1LT4xiFJkh6YlAPQDcov8YIKqcvevFlEE"

Expand Down
2 changes: 2 additions & 0 deletions backend/.env.production
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ FINN_HUB_API_KEY = "cf89282ad3i8qmbtm790cf89282ad3i8qmbtm79g"
ALPHA_VANTAGE_API_KEY = "EI94B6EQ2QPL52UZ"
OPEN_FIGI_API_KEY = "6e8d19f1-6f63-4e22-aee0-51fb3406031c"

ANALYTICS_API_KEY = "22b77895-1033-4e4a-a781-6388f77b0062"

MONGO_SERVER_URL = "database"
MONGO_BACKUP_URL = "1LT4xiFJkh6YlAPQDcov8YIKqcvevFlEE"

Expand Down
11 changes: 3 additions & 8 deletions backend/main.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
from fastapi import FastAPI
from fastapi.middleware import Middleware
from fastapi.middleware.cors import CORSMiddleware

from routers import general
from routers import filer
from routers import stocks
from routers import middleware

middleware = [
Middleware(
CORSMiddleware, allow_origins=["*"], allow_methods=["*"], allow_headers=["*"]
)
]
app = FastAPI(middleware=middleware)

app = FastAPI(middleware=middleware.pipeline())
app.include_router(general.router)
app.include_router(filer.router)
app.include_router(stocks.router)
1 change: 1 addition & 0 deletions backend/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ colorama==0.4.6
Cython==3.0.4
dnspython==2.3.0
fastapi==0.95.1
fastapi-analytics==1.2.0
faust-cchardet==2.1.19
gunicorn==21.2.0
h11==0.14.0
Expand Down
22 changes: 22 additions & 0 deletions backend/routers/middleware.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import os

from fastapi.middleware import Middleware
from fastapi.middleware.cors import CORSMiddleware
from api_analytics.fastapi import Analytics


ENVIRONMENT = os.environ["ENVIRONMENT"]
ANALYTICS_API_KEY = os.environ["ANALYTICS_API_KEY"]

middleware = [
Middleware(
CORSMiddleware, allow_origins=["*"], allow_methods=["*"], allow_headers=["*"]
)
]

if ENVIRONMENT == "production":
middleware.append(Middleware(Analytics, api_key=ANALYTICS_API_KEY))


def pipeline():
return middleware
2 changes: 1 addition & 1 deletion backend/routers/utils/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def process_count_stocks(data, cik):
if directory == None:
return 0

data = analysis.sec_directory_search(directory, cik)
data = api.sec_directory_search(directory, cik)
stock_soup = BeautifulSoup(data, parser)
stock_table = stock_soup.find_all("table")[3]
stock_fields = stock_table.find_all("tr")[1:3]
Expand Down
1 change: 1 addition & 0 deletions backend/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
argument = argv[1] if argv else None
environment = "production" if argument == "production" else "development"
load_dotenv(".env." + environment)
os.environ["ENVIRONMENT"] = environment


def get_confirm_token(response):
Expand Down
28 changes: 14 additions & 14 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,20 @@ services:
networks:
- staging

proxy:
container_name: proxy
image: jc21/nginx-proxy-manager:latest
restart: unless-stopped
ports:
- 81:81
- 443:443
volumes:
- ./proxy/data:/data
- ./proxy/letsencrypt:/etc/letsencrypt
networks:
- staging
depends_on:
- backend
# proxy:
# container_name: proxy
# image: jc21/nginx-proxy-manager:latest
# restart: unless-stopped
# ports:
# - 81:81
# - 443:443
# volumes:
# - ./proxy/data:/data
# - ./proxy/letsencrypt:/etc/letsencrypt
# networks:
# - staging
# depends_on:
# - backend

networks:
staging:
Expand Down
22 changes: 10 additions & 12 deletions frontend/components/Filer/Info.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import styles from "@/styles/Filer.module.css";
import { useState, useEffect } from "react";

import Head from "next/head";
import Error from "next/error";

import { Inter } from "@next/font/google";
const inter = Inter({ subsets: ["latin"], weight: "900" });
import { font } from "@fonts";

import useSWR from "swr";
import axios from "axios";
Expand All @@ -17,6 +15,7 @@ import Expand from "@/components/Expand/Expand";
import Table from "@/components/Table/Table";
import Source from "@/components/Source/Source";
import Building from "@/components/Progress/Building/Building";
import Reccomended from "@/components/Recommended/Recommended";

const fetcher = (url, cik) =>
axios
Expand Down Expand Up @@ -45,7 +44,6 @@ const Info = (props) => {
}
);
const info = data?.filer || null;
console.log(info);

return (
<>
Expand All @@ -55,12 +53,13 @@ const Info = (props) => {
<div className={styles["header"]}>
<div className={styles["main-header"]}>
<span
className={[styles["main-header-text"], inter.className].join(" ")}
className={[styles["main-header-text"], font.className].join(" ")}
>
{info?.name}
</span>
{info?.status > 0 ? <Building cik={cik} /> : null}
</div>

<div
className={[
styles["sub-header"],
Expand All @@ -69,10 +68,9 @@ const Info = (props) => {
>
<div className={styles["secondary-header"]}>
<span
className={[
styles["secondary-header-desc"],
inter.className,
].join(" ")}
className={[styles["secondary-header-desc"], font.className].join(
" "
)}
>
{info?.cik}{" "}
{info?.tickers.length ? `(${info?.tickers.join(", ")})` : ""}
Expand All @@ -82,17 +80,17 @@ const Info = (props) => {
) : null}
<Source cik={cik} />
</div>
<span className={[styles["header-desc"], inter.className].join(" ")}>
<span className={[styles["header-desc"], font.className].join(" ")}>
{info?.data?.description}
</span>
</div>
{/* <span className={[styles["sub-desc"], inter.className].join(" ")}>
{/* <span className={[styles["sub-desc"], font.className].join(" ")}>
{info.data["Description"]}
</span> */}
</div>
<Table />
<div className={styles["header"]}>
{/* <span className={[styles["main-header"], inter.className].join(" ")}>
{/* <span className={[styles["main-header"], font.className].join(" ")}>
Info
</span> */}
</div>
Expand Down
5 changes: 2 additions & 3 deletions frontend/components/Filer/Redirect.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import styles from "@/styles/Filer.module.css";
import { useEffect } from "react";

import { useRouter } from "next/router";
import { Inter } from "@next/font/google";
const inter = Inter({ subsets: ["latin"], weight: "700" });
import { fontLight } from "@fonts";

import useEllipsis from "@/components/Hooks/useEllipsis";

Expand All @@ -21,7 +20,7 @@ const Redirect = (props) => {

return (
<div className={styles["reload"]}>
<span className={[styles["reload-text"], inter.className].join(" ")}>
<span className={[styles["reload-text"], fontLight.className].join(" ")}>
Redirecting {ellipsis}
</span>
</div>
Expand Down
7 changes: 3 additions & 4 deletions frontend/components/Footer/Footer.jsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import styles from "./Footer.module.css";

import Link from "next/link";
import { Inter } from "@next/font/google";
const inter = Inter({ subsets: ["latin"], weight: "900" });
import { font } from "@fonts";

const Footer = () => {
return (
<div className={styles["footer"]}>
<div className={styles["logo"]}>
<Link href="/">
<span
className={styles["logo-text"] + " " + inter.className}
className={styles["logo-text"] + " " + font.className}
id={styles["whale"]}
>
<i>wallstreet</i>
</span>
<span
className={styles["logo-text"] + " " + inter.className}
className={styles["logo-text"] + " " + font.className}
id={styles["market"]}
>
{" "}
Expand Down
5 changes: 2 additions & 3 deletions frontend/components/Layouts/Mobile.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import styles from "@/styles/Fill.module.css";

import { Inter } from "@next/font/google";
const inter = Inter({ subsets: ["latin"], weight: "900" });
import { font } from "@fonts";

export default function MobileLayout() {
return (
<div className={styles.fill}>
<span className={inter.className}>
<span className={font.className}>
wallstreetlocal is not available on mobile just yet.
</span>
</div>
Expand Down
17 changes: 8 additions & 9 deletions frontend/components/Navbar/Navbar.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import styles from "./Navbar.module.css";

import Link from "next/link";
import { Inter } from "@next/font/google";
const inter = Inter({ subsets: ["latin"], weight: "900" });
import { font } from "@fonts";

import Search from "@/components/Search/Button/Search";

Expand All @@ -14,13 +13,13 @@ const Navbar = (props) => {
<div className={styles["logo-title"]}>
<Link href="/">
<span
className={styles["logo-text"] + " " + inter.className}
className={styles["logo-text"] + " " + font.className}
id={styles["whale"]}
>
<i>wallstreet</i>
</span>
<span
className={styles["logo-text"] + " " + inter.className}
className={styles["logo-text"] + " " + font.className}
id={styles["market"]}
>
{" "}
Expand All @@ -32,19 +31,19 @@ const Navbar = (props) => {
</div>
<div>
<ul className={styles["about"]}>
<li className={styles["item"] + " " + inter.className}>
<li className={styles["item"] + " " + font.className}>
<Link href="/top/filers">top filers</Link>
</li>
{/* <li className={styles["item"] + " " + inter.className}>
{/* <li className={styles["item"] + " " + font.className}>
<Link href="/">about</Link>
</li> */}
<li className={styles["item"] + " " + inter.className}>
<li className={styles["item"] + " " + font.className}>
<Link href="/about/resources">resources</Link>
</li>
{/* <li className={styles["item"] + " " + inter.className}>
{/* <li className={styles["item"] + " " + font.className}>
<Link href="/">pricing</Link>
</li> */}
<li className={styles["item"] + " " + inter.className}>
<li className={styles["item"] + " " + font.className}>
<Link href="/about/contact">contact</Link>
</li>
</ul>
Expand Down
5 changes: 2 additions & 3 deletions frontend/components/Progress/Building/Building.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import styles from "./Building.module.css";

import Link from "next/link";
import { Inter } from "@next/font/google";
const interLight = Inter({ subsets: ["latin"], weight: "700" });
import { fontLight } from "@fonts";

import Loading from "@/components/Loading/Loading";

Expand All @@ -11,7 +10,7 @@ const Building = (props) => {
<Link href={`/filers/${props.cik}?persist=true`}>
<div className={[styles["building"]].join(" ")}>
<span
className={[styles["building-text"], interLight.className].join(" ")}
className={[styles["building-text"], fontLight.className].join(" ")}
>
Filer building still partially in progress.
</span>
Expand Down
7 changes: 3 additions & 4 deletions frontend/components/Progress/Console/Console.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import styles from "../Progress.module.css";
import { useEffect, useRef } from "react";

import { Inter } from "@next/font/google";
const interLight = Inter({ subsets: ["latin"], weight: "700" });
import { fontLight } from "@fonts";

import useEllipsis from "@/components/Hooks/useEllipsis";

Expand All @@ -22,13 +21,13 @@ const Console = (props) => {
return (
<span
key={index}
className={[styles["log"], interLight.className].join(" ")}
className={[styles["log"], fontLight.className].join(" ")}
>
{log}
</span>
);
})}
<span className={[styles["log"], interLight.className].join(" ")}>
<span className={[styles["log"], fontLight.className].join(" ")}>
{stall ? null : ellipsis}
</span>
<div className={styles["bottom"]} ref={ref}></div>
Expand Down
Loading

0 comments on commit fadb4db

Please sign in to comment.