Skip to content

Commit

Permalink
Merge pull request #36 from krystxf/feat/appstore-link
Browse files Browse the repository at this point in the history
refactor: download button image, constants package
  • Loading branch information
krystxf authored Nov 5, 2024
2 parents e4edaf6 + 5c0c50f commit 38fee96
Show file tree
Hide file tree
Showing 35 changed files with 415 additions and 132 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*
!apps/*
!packages/*
!package.json
!pnpm-lock.yaml
!pnpm-workspace.yaml
20 changes: 20 additions & 0 deletions .github/workflows/docker-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Docker

on: push

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- uses: docker/build-push-action@v4
with:
context: .
file: "Dockerfile"
tags: metro-now:latest
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
push: false
44 changes: 44 additions & 0 deletions .github/workflows/web-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Web

on: push

jobs:
ci:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}

steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 2

- uses: pnpm/action-setup@v4

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: Install dependencies
run: |
pnpm install
- name: Build
run: |
cd apps/web
pnpm build
- name: Lint
run: |
cd apps/web
pnpm lint
- name: Types check
run: |
cd apps/web
pnpm types:check
1 change: 1 addition & 0 deletions apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
},
"dependencies": {
"@apollo/server": "^4.11.0",
"@metro-now/constants": "workspace:*",
"@nestjs/apollo": "^12.2.0",
"@nestjs/cache-manager": "^2.2.2",
"@nestjs/common": "^10.4.4",
Expand Down
4 changes: 2 additions & 2 deletions apps/backend/src/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { GRAPHQL_PATH } from "@metro-now/constants";
import { ApolloDriver, type ApolloDriverConfig } from "@nestjs/apollo";
import { CacheModule } from "@nestjs/cache-manager";
import { Module } from "@nestjs/common";
Expand All @@ -7,7 +8,6 @@ import { ScheduleModule } from "@nestjs/schedule";

import { cacheModuleConfig } from "src/config/cache-module.config";
import { configModuleConfig } from "src/config/config-module.config";
import { GRAPHQL_API_ROOT } from "src/constants/graphql.const";
import { DepartureModule } from "src/modules/departure/departure.module";
import { ImportModule } from "src/modules/import/import.module";
import { LoggerModule } from "src/modules/logger/logger.module";
Expand All @@ -32,7 +32,7 @@ import { StopModule } from "src/modules/stop/stop.module";
driver: ApolloDriver,
playground: true,
autoSchemaFile: "schema.gql",
path: GRAPHQL_API_ROOT,
path: GRAPHQL_PATH,
}),
],
controllers: [],
Expand Down
1 change: 0 additions & 1 deletion apps/backend/src/constants/graphql.const.ts

This file was deleted.

15 changes: 8 additions & 7 deletions apps/backend/src/constants/swagger.const.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { GRAPHQL_API_ROOT } from "src/constants/graphql.const";

export const SWAGGER_API_ROOT = "/";
export const SWAGGER_JSON_URL = "/swagger-json";
import {
GRAPHQL_PATH,
SOURCE_CODE_URL,
SWAGGER_JSON_PATH,
} from "@metro-now/constants";

export const SWAGGER_TITLE = "Metro Now API";
export const SWAGGER_VERSION = "1.0";
Expand All @@ -10,7 +11,7 @@ export const SWAGGER_DESCRIPTION = `
Thank you for checking out my project.
### Links
- [GraphQL Playground](${GRAPHQL_API_ROOT})
- [Swagger JSON file](${SWAGGER_JSON_URL})
- [Source code](https://github.com/krystxf/metro-now)
- [GraphQL Playground](${GRAPHQL_PATH})
- [Swagger JSON file](${SWAGGER_JSON_PATH})
- [Source code](${SOURCE_CODE_URL})
`;
7 changes: 3 additions & 4 deletions apps/backend/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { SWAGGER_JSON_PATH, SWAGGER_PATH } from "@metro-now/constants";
import { NestFactory } from "@nestjs/core";
import { DocumentBuilder, SwaggerModule } from "@nestjs/swagger";

import { AppModule } from "src/app.module";
import {
SWAGGER_API_ROOT,
SWAGGER_DESCRIPTION,
SWAGGER_JSON_URL,
SWAGGER_TITLE,
SWAGGER_VERSION,
} from "src/constants/swagger.const";
Expand All @@ -26,11 +25,11 @@ async function bootstrap() {
.build();

SwaggerModule.setup(
SWAGGER_API_ROOT,
SWAGGER_PATH,
app,
SwaggerModule.createDocument(app, swaggerDocumentBuilder),
{
jsonDocumentUrl: SWAGGER_JSON_URL,
jsonDocumentUrl: SWAGGER_JSON_PATH,
customSiteTitle: SWAGGER_TITLE,
},
);
Expand Down
13 changes: 0 additions & 13 deletions apps/backend/src/utils/graphql.utils.ts

This file was deleted.

2 changes: 2 additions & 0 deletions apps/web/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const nextConfig = {
pageExtensions: ["js", "jsx", "md", "mdx", "ts", "tsx"],
images: {
formats: ["image/avif", "image/webp"],
deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
},
};

Expand Down
4 changes: 3 additions & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
"typecheck": "tsc --pretty"
"types:check": "tsc --pretty"
},
"dependencies": {
"@heroicons/react": "^2.1.5",
"@metro-now/constants": "workspace:*",
"@next/mdx": "^14.2.2",
"next": "14.2.10",
"nextra": "^2.13.4",
Expand Down
94 changes: 94 additions & 0 deletions apps/web/public/download-on-appstore-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/web/public/metro-now-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions apps/web/src/app/fonts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Noto_Sans, Noto_Sans_Mono } from "next/font/google";

export const notoSans = Noto_Sans({
display: "auto",
preload: true,
subsets: ["latin"],
});

export const notoSansMono = Noto_Sans_Mono({
display: "auto",
preload: true,
subsets: ["latin"],
});
6 changes: 2 additions & 4 deletions apps/web/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";

const inter = Inter({ subsets: ["latin"] });
import { notoSans } from "./fonts";

export const metadata: Metadata = {
title: "Metro Now",
Expand All @@ -16,7 +14,7 @@ export default function RootLayout({
}>) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
<body className={notoSans.className}>{children}</body>
</html>
);
}
9 changes: 9 additions & 0 deletions apps/web/src/app/not-found.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.status_code {
opacity: 0.075;
font-weight: 900;
color: transparent;
-webkit-text-stroke: 1px black;
font-size: clamp(10vw, 60vw, 100vw);
position: absolute;
pointer-events: none;
}
Loading

1 comment on commit 38fee96

@vercel
Copy link

@vercel vercel bot commented on 38fee96 Nov 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.