-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6b6dbdc
commit 1532c90
Showing
26 changed files
with
479 additions
and
409 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,13 @@ | ||
import os | ||
|
||
from fastapi import ( | ||
FastAPI, | ||
) | ||
from fastapi.staticfiles import StaticFiles | ||
from fastapi import FastAPI | ||
from fastapi_pagination import add_pagination | ||
from starlette.responses import RedirectResponse | ||
|
||
from .routers import admin, open, protected | ||
|
||
dev = False | ||
|
||
env_value = os.environ.get("FASTAPI_APP_ENV") | ||
|
||
if env_value and env_value == "development": | ||
print("RUNNING IN DEV MODE") | ||
dev = True | ||
|
||
|
||
build_dir = os.environ.get("FRONTEND_BUILD_DIR") | ||
|
||
app = FastAPI() | ||
|
||
app.include_router(open.router) | ||
app.include_router(protected.router) | ||
app.include_router(admin.router) | ||
|
||
add_pagination(app) | ||
|
||
|
||
@app.get("/login", response_class=RedirectResponse) | ||
async def redirect_home(): | ||
# proxy handles log in so if you reach here go home | ||
return "/" | ||
|
||
|
||
if build_dir: | ||
app.mount("/", StaticFiles(directory="/client/dist", html=True), name="site") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#build client | ||
#build api | ||
#copy to runtime | ||
|
||
FROM node:18-bullseye-slim as build-web | ||
|
||
WORKDIR /client | ||
|
||
RUN yes | npm install -g pnpm | ||
|
||
RUN apt update | ||
|
||
COPY . . | ||
|
||
RUN yes | pnpm install | ||
|
||
RUN pnpm vite build | ||
|
||
From nginx as host | ||
|
||
COPY --from=build-web /client/dist/ /usr/share/nginx/html | ||
COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf | ||
|
||
# change this entrypoint if it is not the same as the repo | ||
ENTRYPOINT ["nginx","-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
server { | ||
listen 80; | ||
server_name localhost; | ||
|
||
#access_log /var/log/nginx/host.access.log main; | ||
|
||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
try_files $uri /index.html =404; | ||
} | ||
|
||
#error_page 404 /404.html; | ||
|
||
# redirect server error pages to the static page /50x.html | ||
# | ||
error_page 500 502 503 504 /50x.html; | ||
location = /50x.html { | ||
root /usr/share/nginx/html; | ||
} | ||
|
||
# proxy the PHP scripts to Apache listening on 127.0.0.1:80 | ||
# | ||
#location ~ \.php$ { | ||
# proxy_pass http://127.0.0.1; | ||
#} | ||
|
||
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 | ||
# | ||
#location ~ \.php$ { | ||
# root html; | ||
# fastcgi_pass 127.0.0.1:9000; | ||
# fastcgi_index index.php; | ||
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; | ||
# include fastcgi_params; | ||
#} | ||
|
||
# deny access to .htaccess files, if Apache's document root | ||
# concurs with nginx's one | ||
# | ||
#location ~ /\.ht { | ||
# deny all; | ||
#} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,38 @@ | ||
import { SvgIcon } from "@mui/material" | ||
import { SvgIcon } from "@mui/material"; | ||
|
||
export default function DiamondIcon() { | ||
return ( | ||
<SvgIcon fontSize="large" > | ||
<svg | ||
xmlns:dc="http://purl.org/dc/elements/1.1/" | ||
xmlns:cc="http://creativecommons.org/ns#" | ||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | ||
xmlns:svg="http://www.w3.org/2000/svg" | ||
xmlns="http://www.w3.org/2000/svg" | ||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | ||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" | ||
aria-hidden="true" | ||
role="img" | ||
class="iconify iconify--logos" | ||
width="31.88" | ||
height="32" | ||
preserveAspectRatio="xMidYMid meet" | ||
viewBox="0 0 256 257" | ||
version="1.1" | ||
id="svg3914" | ||
sodipodi:docname="vite.svg" | ||
stroke="currentColor" | ||
fill="currentColor" | ||
inkscape:version="0.92.2 (5c3e80d, 2017-08-06)"> | ||
|
||
<g | ||
transform="matrix(1.0538199,0,0,-1.0538199,0.67781236,254.87384)"> | ||
<path d="m 167.021,50.0199 c -6.42,-0.9168 -8.488,-5.9148 -4.598,-11.1019 l 17.776,-23.6981 c 17.752,10.0723 32.708,24.493 43.391,41.843 l -56.569,-7.043" /> | ||
<path d="m 74.6574,75.2738 c 6.4203,0.9184 8.4887,5.9121 4.5985,11.0992 l -46.4973,61.999 c -3.8938,5.187 -2.8301,6.248 2.357,2.357 l 61.9891,-46.49 c 5.1873,-3.894 10.1813,-1.823 11.0993,4.595 l 10.959,113.025 c 0.914,6.42 2.417,6.42 3.335,0 l 10.959,-113.042 c 0.918,-6.417 5.912,-8.485 11.099,-4.595 l 62.012,46.507 c 5.188,3.891 6.248,2.83 2.358,-2.357 L 162.425,86.3699 c -3.89,-5.1867 -1.822,-10.182 4.599,-11.0988 l 62.314,-7.7582 c 7.761,15.941 12.12,33.8391 12.12,52.7621 0,66.674 -54.052,120.726 -120.729,120.726 C 54.052,241.001 0,186.949 0,120.275 0,101.342 4.36563,83.434 12.1297,67.4898 l 62.5277,7.784"/> | ||
<path d="m 108.203,16.4551 c -0.918,6.4179 -5.912,8.4859 -11.0995,4.5988 L 78.5465,7.13203 C 88.6414,3.36797 99.3848,0.933984 110.553,0 l -2.35,16.4551"/> | ||
<path d="M 133.457,16.4711 131.106,0.0148438 C 142.258,0.966016 152.978,3.41289 163.06,7.18984 L 144.559,21.0691 c -5.19,3.8899 -10.185,1.8188 -11.102,-4.598"/> | ||
<path d="M 74.6574,50.016 17.8488,57.0879 C 28.5656,39.6781 43.5848,25.2109 61.4137,15.1301 l 17.8422,23.7871 c 3.8902,5.1867 1.8218,10.1808 -4.5985,11.0988"/> | ||
</g> | ||
</svg> | ||
</SvgIcon> | ||
) | ||
} | ||
return ( | ||
<SvgIcon fontSize="large"> | ||
<svg | ||
xmlns:dc="http://purl.org/dc/elements/1.1/" | ||
xmlns:cc="http://creativecommons.org/ns#" | ||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | ||
xmlns:svg="http://www.w3.org/2000/svg" | ||
xmlns="http://www.w3.org/2000/svg" | ||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | ||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" | ||
aria-hidden="true" | ||
role="img" | ||
className="iconify iconify--logos" | ||
width="31.88" | ||
height="32" | ||
preserveAspectRatio="xMidYMid meet" | ||
viewBox="0 0 256 257" | ||
version="1.1" | ||
id="svg3914" | ||
sodipodi:docname="vite.svg" | ||
stroke="currentColor" | ||
fill="currentColor" | ||
inkscape:version="0.92.2 (5c3e80d, 2017-08-06)" | ||
> | ||
<g transform="matrix(1.0538199,0,0,-1.0538199,0.67781236,254.87384)"> | ||
<path d="m 167.021,50.0199 c -6.42,-0.9168 -8.488,-5.9148 -4.598,-11.1019 l 17.776,-23.6981 c 17.752,10.0723 32.708,24.493 43.391,41.843 l -56.569,-7.043" /> | ||
<path d="m 74.6574,75.2738 c 6.4203,0.9184 8.4887,5.9121 4.5985,11.0992 l -46.4973,61.999 c -3.8938,5.187 -2.8301,6.248 2.357,2.357 l 61.9891,-46.49 c 5.1873,-3.894 10.1813,-1.823 11.0993,4.595 l 10.959,113.025 c 0.914,6.42 2.417,6.42 3.335,0 l 10.959,-113.042 c 0.918,-6.417 5.912,-8.485 11.099,-4.595 l 62.012,46.507 c 5.188,3.891 6.248,2.83 2.358,-2.357 L 162.425,86.3699 c -3.89,-5.1867 -1.822,-10.182 4.599,-11.0988 l 62.314,-7.7582 c 7.761,15.941 12.12,33.8391 12.12,52.7621 0,66.674 -54.052,120.726 -120.729,120.726 C 54.052,241.001 0,186.949 0,120.275 0,101.342 4.36563,83.434 12.1297,67.4898 l 62.5277,7.784" /> | ||
<path d="m 108.203,16.4551 c -0.918,6.4179 -5.912,8.4859 -11.0995,4.5988 L 78.5465,7.13203 C 88.6414,3.36797 99.3848,0.933984 110.553,0 l -2.35,16.4551" /> | ||
<path d="M 133.457,16.4711 131.106,0.0148438 C 142.258,0.966016 152.978,3.41289 163.06,7.18984 L 144.559,21.0691 c -5.19,3.8899 -10.185,1.8188 -11.102,-4.598" /> | ||
<path d="M 74.6574,50.016 17.8488,57.0879 C 28.5656,39.6781 43.5848,25.2109 61.4137,15.1301 l 17.8422,23.7871 c 3.8902,5.1867 1.8218,10.1808 -4.5985,11.0988" /> | ||
</g> | ||
</svg> | ||
</SvgIcon> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.