Skip to content

Commit

Permalink
feat: landing page
Browse files Browse the repository at this point in the history
  • Loading branch information
sspzoa committed Oct 7, 2024
1 parent 7060cb4 commit 24532bc
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img alt="Deening" src="assets/images/logo.png" width="144">
<img alt="Deening" src="app/static/icon.png" width="144">
<p align="center">
<strong>Deening Back for All</strong>
</p>
Expand Down
9 changes: 7 additions & 2 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from fastapi import FastAPI, Depends
from fastapi.staticfiles import StaticFiles

from app.dependencies.auth import verify_token
from app.routes import ping
from app.routes import ping, root
from app.routes.food import ingredient_detect
from app.routes.recipe import recipe, ingredient, cooking_step

Expand All @@ -20,11 +21,15 @@
},
)

# Static files configuration
app.mount("/static", StaticFiles(directory="app/static"), name="static")

# Public routes
app.include_router(root.router)
app.include_router(ping.router)

# Protected routes
app.include_router(recipe.router, dependencies=[Depends(verify_token)])
app.include_router(ingredient.router, dependencies=[Depends(verify_token)])
app.include_router(cooking_step.router, dependencies=[Depends(verify_token)])
app.include_router(ingredient_detect.router, dependencies=[Depends(verify_token)])
app.include_router(ingredient_detect.router, dependencies=[Depends(verify_token)])
12 changes: 12 additions & 0 deletions app/routes/root.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from fastapi import APIRouter
from starlette.responses import FileResponse

router = APIRouter()


@router.get("/")
async def root():
"""
Landing Page
"""
return FileResponse("app/static/index.html")
File renamed without changes
28 changes: 28 additions & 0 deletions app/static/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>디닝 - Deening</title>
<link rel="icon" type="image/png" href="static/icon.png">
<script src="https://cdn.tailwindcss.com"></script>
<style>
@import url('https://fastly.jsdelivr.net/gh/wanteddev/[email protected]/packages/wanted-sans/fonts/webfonts/variable/split/WantedSansVariable.min.css');

body {
font-family: 'Wanted Sans Variable', sans-serif;
}
</style>
</head>
<body>
<div class="h-[100dvh] flex flex-col justify-center items-center gap-12">
<img draggable="false" src="static/logo.svg" alt="logo" class="h-24">
<div class="flex flex-row gap-4 text-lg">
<a target="_blank" rel="noreferrer noopener" href="https://github.com/sspzoa/deening-back" class="cursor-pointer ease-in-out duration-300 hover:opacity-50">GitHub</a>
<span>|</span>
<a target="_blank" rel="noreferrer noopener" href="/docs" class="cursor-pointer ease-in-out duration-300 hover:opacity-50">Swagger</a>
<span>|</span>
<a target="_blank" rel="noreferrer noopener" href="/redoc" class="cursor-pointer ease-in-out duration-300 hover:opacity-50">Redoc</a>
</div>
</body>
</html>
12 changes: 12 additions & 0 deletions app/static/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 24532bc

Please sign in to comment.