Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ymuichiro committed Feb 29, 2024
0 parents commit cfbd9fa
Show file tree
Hide file tree
Showing 143 changed files with 47,451 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
.next
nginx
.env.development
6 changes: 6 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# NEXT_PUBLIC_API_URL="http://localhost:1337"
# NEXT_PUBLIC_HOSTING_URL="http://localhost:3000"
NEXT_PUBLIC_API_URL="https://cms.symbol-community.com"
NEXT_PUBLIC_HOSTING_URL="https://symbol-community.com"
NEXT_PUBLIC_GA_MEASUREMENT_ID="G-XXXXXXXXX"
NEXT_PUBLIC_SYMBOL_NODE="https://hideyoshi.mydns.jp:3001"
4 changes: 4 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
NEXT_PUBLIC_API_URL="https://cms.symbol-community.com"
NEXT_PUBLIC_HOSTING_URL="https://symbol-community.com"
NEXT_PUBLIC_GA_MEASUREMENT_ID="G-4CKY7DGFS8"
NEXT_PUBLIC_SYMBOL_NODE="https://hideyoshi.mydns.jp:3001"
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
.DS_Store
dist
dist-ssr
*.local
.eslintcache
4 changes: 4 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extends:
- next/core-web-vitals
rules:
'react-hooks/exhaustive-deps': off
23 changes: 23 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Docker publish to ghcr.io

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
- uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/${{ github.repository }}:latest
50 changes: 50 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# strapi
.tmp
.cache
build
backend/public/uploads
sitemap*.xml
robots.txt

# dependencies
node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
.next
frontend/out/
sw.js
sw.js.map
workbox-*

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local
**.env

# vercel
.vercel

# typescript
*.tsbuildinfo
dist
# Local Netlify folder
.netlify
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
.DS_Store
dist
dist-ssr
*.local
.eslintcache
5 changes: 5 additions & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
endOfLine: lf
printWidth: 120
singleQuote: true
jsxSingleQuote: true
semi: true
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:20-bookworm-slim as build

WORKDIR /app
COPY . /app

RUN npm ci && \
npm run build

RUN rm -rf src && rm package-lock.json

EXPOSE 3000

CMD ["node_modules/.bin/next", "start"]
5 changes: 5 additions & 0 deletions next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
45 changes: 45 additions & 0 deletions next-sitemap.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/** @type {import('next-sitemap').IConfig} */
module.exports = {
siteUrl: process.env.NEXT_PUBLIC_HOSTING_URL,
generateRobotsTxt: true,
sitemapSize: 7000,
exclude: ['/404', '/ja/404', '/en/404', '/ko/404', '/zh/404', '/zh-hant-tw/404', '/server-sitemap.xml'],
additionalPaths: async (config) => [
await config.transform(config, '/ja'),
await config.transform(config, '/ja/news'),
await config.transform(config, '/ja/about'),
await config.transform(config, '/ja/community'),
await config.transform(config, '/ja/docs'),
await config.transform(config, '/ja/support/rest'),
await config.transform(config, '/en'),
await config.transform(config, '/en/news'),
await config.transform(config, '/en/about'),
await config.transform(config, '/en/community'),
await config.transform(config, '/en/docs'),
await config.transform(config, '/en/support/rest'),
await config.transform(config, '/ko'),
await config.transform(config, '/ko/news'),
await config.transform(config, '/ko/about'),
await config.transform(config, '/ko/community'),
await config.transform(config, '/ko/docs'),
await config.transform(config, '/ko/support/rest'),
await config.transform(config, '/zh'),
await config.transform(config, '/zh/news'),
await config.transform(config, '/zh/docs'),
await config.transform(config, '/zh/about'),
await config.transform(config, '/zh/community'),
await config.transform(config, '/zh/support/rest'),
await config.transform(config, '/zh-hant-tw'),
await config.transform(config, '/zh-hant-tw/news'),
await config.transform(config, '/zh-hant-tw/about'),
await config.transform(config, '/zh-hant-tw/community'),
await config.transform(config, '/zh-hant-tw/docs'),
await config.transform(config, '/zh-hant-tw/support/rest'),
await config.transform(config, '/static/playground.html'),
await config.transform(config, '/events/tomatina'),
await config.transform(config, '/events/potatina'),
],
robotsTxtOptions: {
additionalSitemaps: [`${process.env.NEXT_PUBLIC_HOSTING_URL}/server-sitemap.xml`],
},
};
28 changes: 28 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const withPWA = require('next-pwa')({
dest: 'public',
register: true,
skipWaiting: true,
disable: process.env.NODE_ENV === 'development',
runtimeCaching: [],
publicExcludes: ['!**/*'],
buildExcludes: [() => true],
fallbacks: false,
cacheStartUrl: false,
});

const nextConfig = withPWA({
i18n: {
locales: ['en', 'ja', 'ko', 'zh', 'zh-hant-tw'],
defaultLocale: 'en',
localeDetection: false,
},
images: {
domains: ['cms.symbol-community.com'],
},
compiler: {
emotion: true,
},
reactStrictMode: true,
});

module.exports = nextConfig;
73 changes: 73 additions & 0 deletions nginx/custom/502.html

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions nginx/default
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
server {
server_name cms.symbol-community.com;
location / {
proxy_pass http://localhost:1337/;
}
listen 443 ssl http2; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/symbol-community.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/symbol-community.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

error_page 502 /502.html;
location /502.html {
root /var/www/html;
}
}

server {
if ($host = cms.symbol-community.com) {
return 301 https://$host$request_uri;
} # managed by Certbot

listen 80;
server_name cms.symbol-community.com;
return 404; # managed by Certbot
}
Loading

0 comments on commit cfbd9fa

Please sign in to comment.