Skip to content

Commit

Permalink
🚀 chore: Ready for beta open
Browse files Browse the repository at this point in the history
  • Loading branch information
kms0219kms committed Sep 30, 2024
1 parent aaa1a3c commit 6a1b81a
Show file tree
Hide file tree
Showing 18 changed files with 1,712 additions and 210 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/be-grpc-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Deploy gRPC Backend to GitHub Container Registry

on:
push:
branches:
- main
workflow_dispatch:
workflow_call:

env:
IMAGE_NAME: am-to-mxm_grpc

jobs:
push:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- id: dockertag
name: Get Docker tag
uses: ASzc/change-string-case-action@v6
with:
string: ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest

- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin

- name: Build and push
uses: docker/build-push-action@v6
with:
file: ./grpc.Dockerfile
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.dockertag.outputs.lowercase }}
21 changes: 21 additions & 0 deletions .github/workflows/fe-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Vercel Preview Deployment
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

on:
push:
branches-ignore:
- main

jobs:
Deploy-Preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --token=${{ secrets.VERCEL_TOKEN }}
21 changes: 21 additions & 0 deletions .github/workflows/fe-production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Vercel Production Deployment
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

on:
push:
branches:
- main

jobs:
Deploy-Production:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prod --token=${{ secrets.VERCEL_TOKEN }}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,11 @@ web_modules/

# dotenv environment variable files
.env
.env.development
.env.development.local
.env.test
.env.test.local
.env.production
.env.production.local
.env.local

Expand Down Expand Up @@ -125,4 +128,5 @@ dist
.vscode-test

# Cache
cache.sqlite
cache.sqlite
.vercel
81 changes: 81 additions & 0 deletions apps/backend/envoy-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
admin:
address:
socket_address:
address: 0.0.0.0
port_value: 52347

static_resources:
listeners:
- name: listener_0
address:
socket_address:
address: 0.0.0.0
port_value: 52346

filter_chains:
- filters:
- name: envoy.http_connection_manager
typed_config:
'@type': >-
type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
codec_type: auto
stat_prefix: ingress_http
route_config:
name: local_route
virtual_hosts:
- name: local_service
domains:
- '*'
routes:
- match:
prefix: /
route:
cluster: grpc
cors:
allow_origin_string_match:
- prefix: "*"
allow_methods: GET, PUT, DELETE, POST, OPTIONS
allow_headers: keep-alive,user-agent,cache-control,content-type,content-transfer-encoding,x-accept-content-transfer-encoding,x-accept-response-streaming,x-user-agent,x-grpc-web,grpc-timeout,authorization
max_age: "1728000"
expose_headers: grpc-status,grpc-message

http_filters:
- name: envoy.grpc_web
typed_config:
'@type': >-
type.googleapis.com/envoy.extensions.filters.http.grpc_web.v3.GrpcWeb
- name: envoy.filters.http.cors
typed_config:
'@type': >-
type.googleapis.com/envoy.extensions.filters.http.cors.v3.Cors
- name: envoy.filters.http.router
typed_config:
'@type': >-
type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
clusters:
- name: grpc
connect_timeout: 0.25s
type: LOGICAL_DNS
lb_policy: ROUND_ROBIN

typed_extension_protocol_options:
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
'@type': >-
type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
explicit_http_config:
http2_protocol_options: {}

load_assignment:
cluster_name: grpc
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 172.29.64.1
port_value: 52345
8 changes: 1 addition & 7 deletions apps/backend/envoy.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
admin:
address:
socket_address:
address: 0.0.0.0
port_value: 52347

static_resources:
listeners:
- name: listener_0
Expand Down Expand Up @@ -77,5 +71,5 @@ static_resources:
- endpoint:
address:
socket_address:
address: 172.29.64.1
address: am-to-mxm-grpc-1
port_value: 52345
19 changes: 2 additions & 17 deletions apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
"dist/src"
],
"scripts": {
"start": "node dist/src/index.js",
"start": "tsx src/index.ts",
"dev": "tsx watch src/index",
"build": "tsup src/index.ts",
"lint": "eslint --ignore-path ../../.gitignore --cache --cache-location ./node_modules/.cache/eslint src/"
"lint": "eslint --ignore-path ../../.gitignore src/"
},
"dependencies": {
"@grpc/grpc-js": "^1.11.3",
Expand All @@ -25,21 +24,7 @@
},
"devDependencies": {
"@types/node": "20.12.7",
"tsup": "^8.3.0",
"tsx": "^4.19.1",
"typescript": "^5.4.3"
},
"tsup": {
"entry": [
"src/index.ts"
],
"format": [
"esm"
],
"sourcemap": true,
"treeshake": true,
"clean": true,
"minify": true,
"dts": true
}
}
4 changes: 3 additions & 1 deletion apps/backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ import * as grpc from '@grpc/grpc-js';

import { SearchService } from './services/search.service';

process.loadEnvFile('.env');
try {
process.loadEnvFile('.env');
} catch {} // eslint-disable-line no-empty

const logger: Logger<ILogObj> = new Logger({
name: 'lunaiz.am2mxm.api.v1',
Expand Down
30 changes: 30 additions & 0 deletions apps/frontend/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,38 @@ export function Layout({ children }: { children: React.ReactNode }) {
rel="stylesheet"
href="https://cdn.jsdelivr.net/gh/orioncactus/[email protected]/dist/web/variable/pretendardvariable-dynamic-subset.min.css"
/>

{/* Google Tag Manager */}
<script
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{
__html: `
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-PDKX2QV5');
`,
}}
/>
{/* End Google Tag Manager */}
</head>
<body>
{/* Google Tag Manager (noscript) */}
<noscript>
<iframe
title="Google Tag Manager"
src="https://www.googletagmanager.com/ns.html?id=GTM-PDKX2QV5"
height="0"
width="0"
style={{
display: 'none',
visibility: 'hidden',
}}
/>
</noscript>
{/* End Google Tag Manager (noscript) */}

<div className="flex min-h-screen">
{Object.keys(routes).includes(location.pathname) && (
<MainSearchArea
Expand Down
1 change: 1 addition & 0 deletions apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"dev": "remix vite:dev",
"lint": "eslint --ignore-path ../../.gitignore --cache --cache-location ./node_modules/.cache/eslint app/",
"start": "remix-serve ./build/server/index.js",
"generate": "remix build",
"typecheck": "tsc"
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
naver-site-verification: naver08bc76fd83b96df1f5e0dcffa7bd8ed6.html
2 changes: 2 additions & 0 deletions apps/frontend/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Allow:/
17 changes: 17 additions & 0 deletions apps/frontend/public/sitemap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/sitemap.xsl"?>

<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://am-to-mxm.lunaiz.com/</loc>
<lastmod>1970-01-01T00:00:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://am-to-mxm.lunaiz.com/source</loc>
<lastmod>1970-01-01T00:00:00+00:00</lastmod>
<priority>0.80</priority>
</url>
</urlset>
Loading

0 comments on commit 6a1b81a

Please sign in to comment.