Skip to content

Commit

Permalink
feat(web): implement new main website
Browse files Browse the repository at this point in the history
Create new website using T3 template. It's simple and contains only text.

fix #10
  • Loading branch information
airone01 committed Apr 29, 2024
1 parent 4903165 commit 3ef8d52
Show file tree
Hide file tree
Showing 18 changed files with 621 additions and 20 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<div align="center">
<svg width="195.601" height="76.102" viewBox="0 0 195.601 76.102" xmlns="http://www.w3.org/2000/svg"><g id="svgGroup" stroke-linecap="round" fill-rule="evenodd" font-size="9pt" stroke="currentColor" stroke-width="0.25mm" fill="currentColor" style="stroke:currentColor;stroke-width:0.25mm;fill:currentColor"><path d="M 72.6 73.001 L 72.6 24.401 Q 72.6 22.301 74.3 22.301 L 88.5 22.301 Q 89.856 22.301 90.131 23.446 A 2.817 2.817 0 0 1 90.2 24.101 L 90.2 28.901 Q 90.2 29.501 90.5 29.651 A 0.336 0.336 0 0 0 90.642 29.685 Q 90.928 29.694 91.4 29.301 Q 93.7 26.901 96.3 25.101 Q 98.9 23.301 101.75 22.301 A 18.077 18.077 0 0 1 107.576 21.302 A 20.363 20.363 0 0 1 107.8 21.301 A 18.837 18.837 0 0 1 112.928 21.964 A 14.262 14.262 0 0 1 119.25 25.651 A 14.528 14.528 0 0 1 123.256 33.428 A 20.832 20.832 0 0 1 123.6 37.301 L 123.6 72.601 Q 123.6 75.301 120.8 75.301 L 107.9 75.301 Q 106.7 75.301 106.25 74.801 A 1.364 1.364 0 0 1 106.004 74.386 Q 105.846 73.988 105.81 73.372 A 6.526 6.526 0 0 1 105.8 73.001 L 105.8 39.801 A 7.593 7.593 0 0 0 105.614 38.066 Q 105.246 36.497 104.15 35.501 A 5.409 5.409 0 0 0 102.016 34.33 Q 100.907 34.001 99.5 34.001 A 9.521 9.521 0 0 0 97.042 34.311 A 8.583 8.583 0 0 0 96.15 34.601 A 9.18 9.18 0 0 0 94.022 35.782 A 11.217 11.217 0 0 0 93.2 36.451 A 17.24 17.24 0 0 0 91.822 37.839 Q 91.111 38.636 90.4 39.601 L 90.4 72.701 A 3.2 3.2 0 0 1 90.227 73.8 Q 89.715 75.204 87.687 75.294 A 6.431 6.431 0 0 1 87.4 75.301 L 75 75.301 A 4.95 4.95 0 0 1 74.963 75.301 Q 72.6 75.283 72.6 73.001 Z M 42.241 1.71 A 29.726 29.726 0 0 0 32.1 0.001 A 33.97 33.97 0 0 0 30.368 0.044 A 28.895 28.895 0 0 0 19.25 2.801 Q 13.4 5.601 9.05 10.751 A 33.952 33.952 0 0 0 6.411 14.33 A 38.461 38.461 0 0 0 2.35 22.901 A 43.226 43.226 0 0 0 0.744 29.313 A 53.382 53.382 0 0 0 0 38.401 A 54.382 54.382 0 0 0 0.67 47.117 A 40.346 40.346 0 0 0 4.05 58.151 A 37.687 37.687 0 0 0 4.838 59.703 A 31.258 31.258 0 0 0 15.4 71.351 A 28.636 28.636 0 0 0 21.678 74.426 A 31.668 31.668 0 0 0 32.1 76.101 Q 41.4 76.101 48.6 71.351 A 30.527 30.527 0 0 0 53.939 66.881 A 34.299 34.299 0 0 0 59.9 58.151 Q 64 49.701 64 38.401 A 55.126 55.126 0 0 0 63.717 32.734 A 44.254 44.254 0 0 0 61.6 22.901 A 44.212 44.212 0 0 0 60.374 19.721 A 37.07 37.07 0 0 0 54.95 10.751 Q 50.7 5.601 44.85 2.801 A 27.992 27.992 0 0 0 42.241 1.71 Z M 173.841 1.71 A 29.726 29.726 0 0 0 163.7 0.001 A 33.97 33.97 0 0 0 161.968 0.044 A 28.895 28.895 0 0 0 150.85 2.801 Q 145 5.601 140.65 10.751 A 33.952 33.952 0 0 0 138.011 14.33 A 38.461 38.461 0 0 0 133.95 22.901 A 43.226 43.226 0 0 0 132.344 29.313 A 53.382 53.382 0 0 0 131.6 38.401 A 54.382 54.382 0 0 0 132.27 47.117 A 40.346 40.346 0 0 0 135.65 58.151 A 37.687 37.687 0 0 0 136.438 59.703 A 31.258 31.258 0 0 0 147 71.351 A 28.636 28.636 0 0 0 153.278 74.426 A 31.668 31.668 0 0 0 163.7 76.101 Q 173 76.101 180.2 71.351 A 30.527 30.527 0 0 0 185.539 66.881 A 34.299 34.299 0 0 0 191.5 58.151 Q 195.6 49.701 195.6 38.401 A 55.126 55.126 0 0 0 195.317 32.734 A 44.254 44.254 0 0 0 193.2 22.901 A 44.212 44.212 0 0 0 191.974 19.721 A 37.07 37.07 0 0 0 186.55 10.751 Q 182.3 5.601 176.45 2.801 A 27.992 27.992 0 0 0 173.841 1.71 Z M 32 62.101 Q 36 62.101 38.55 59.751 A 9.873 9.873 0 0 0 40.398 57.383 Q 41.587 55.311 42.3 52.251 A 37.345 37.345 0 0 0 42.933 48.695 Q 43.5 44.413 43.5 38.501 A 104.771 104.771 0 0 0 43.378 33.28 Q 43.114 28 42.278 24.321 A 30.935 30.935 0 0 0 42.25 24.201 A 25.551 25.551 0 0 0 41.355 21.149 Q 40.213 18.045 38.45 16.351 Q 35.9 13.901 32 13.901 A 10.675 10.675 0 0 0 28.936 14.321 A 8.447 8.447 0 0 0 25.45 16.351 Q 23.633 18.096 22.502 21.365 A 25.785 25.785 0 0 0 21.7 24.251 Q 20.894 27.912 20.63 33.086 A 106.355 106.355 0 0 0 20.5 38.501 A 99.801 99.801 0 0 0 20.618 43.491 Q 20.874 48.605 21.694 52.172 A 30.204 30.204 0 0 0 21.7 52.201 A 22.829 22.829 0 0 0 22.587 55.172 Q 23.713 58.135 25.5 59.751 A 9.034 9.034 0 0 0 30.813 62.043 A 12.007 12.007 0 0 0 32 62.101 Z M 163.6 62.101 Q 167.6 62.101 170.15 59.751 A 9.873 9.873 0 0 0 171.998 57.383 Q 173.187 55.311 173.9 52.251 A 37.345 37.345 0 0 0 174.533 48.695 Q 175.1 44.413 175.1 38.501 A 104.771 104.771 0 0 0 174.978 33.28 Q 174.714 28 173.878 24.321 A 30.935 30.935 0 0 0 173.85 24.201 A 25.551 25.551 0 0 0 172.955 21.149 Q 171.813 18.045 170.05 16.351 Q 167.5 13.901 163.6 13.901 A 10.675 10.675 0 0 0 160.536 14.321 A 8.447 8.447 0 0 0 157.05 16.351 Q 155.233 18.096 154.102 21.365 A 25.785 25.785 0 0 0 153.3 24.251 Q 152.494 27.912 152.23 33.086 A 106.355 106.355 0 0 0 152.1 38.501 A 99.801 99.801 0 0 0 152.218 43.491 Q 152.474 48.605 153.294 52.172 A 30.204 30.204 0 0 0 153.3 52.201 A 22.829 22.829 0 0 0 154.187 55.172 Q 155.313 58.135 157.1 59.751 A 9.034 9.034 0 0 0 162.413 62.043 A 12.007 12.007 0 0 0 163.6 62.101 Z" vector-effect="non-scaling-stroke"/></g></svg>
<!-- Font: "Libre Franklin", Weight: 900 -->
<br />
<img src=https://skillicons.dev/icons?i=nextjs,wasm,ts,pnpm />
<img src=https://skillicons.dev/icons?i=nextjs,pnpm,ts,wasm />
<br />
<p>Just making websites.</p>
</div>
Expand Down
14 changes: 14 additions & 0 deletions apps/website/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Since the ".env" file is gitignored, you can use the ".env.example" file to
# build a new ".env" file when you clone the repo. Keep this file up-to-date
# when you add new variables to `.env`.

# This file will be committed to version control, so make sure not to have any
# secrets in it. If you are cloning this repo, create a copy of this file named
# ".env" and populate it with your secrets.

# When adding additional environment variables, the schema in "/src/env.js"
# should be updated accordingly.

# Example:
# SERVERVAR="foo"
# NEXT_PUBLIC_CLIENTVAR="bar"
42 changes: 42 additions & 0 deletions apps/website/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/** @type {import("eslint").Linter.Config} */
const config = {
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": true
},
"plugins": [
"@typescript-eslint"
],
"extends": [
"next/core-web-vitals",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked"
],
"rules": {
"@typescript-eslint/array-type": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/consistent-type-imports": [
"warn",
{
"prefer": "type-imports",
"fixStyle": "inline-type-imports"
}
],
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_"
}
],
"@typescript-eslint/require-await": "off",
"@typescript-eslint/no-misused-promises": [
"error",
{
"checksVoidReturn": {
"attributes": false
}
}
]
}
}
module.exports = config;
42 changes: 42 additions & 0 deletions apps/website/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# database
/prisma/db.sqlite
/prisma/db.sqlite-journal

# next.js
/.next/
/out/
next-env.d.ts

# production
/build

# misc
.DS_Store
*.pem

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

# local env files
# do not commit any .env files to git, except for the .env.example file. https://create.t3.gg/en/usage/env-variables#using-environment-variables
.env
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
5 changes: 5 additions & 0 deletions apps/website/.xo-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"rules": {
"import/extensions": "off"
}
}
8 changes: 8 additions & 0 deletions apps/website/README.md

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions apps/website/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
* for Docker builds.
*/
await import('./src/env.js');

/** @type {import("next").NextConfig} */
const config = {};

export default config;
44 changes: 44 additions & 0 deletions apps/website/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "website",
"version": "0.1.0",
"description": "A simple website",
"private": true,
"type": "module",
"packageManager": "[email protected]",
"scripts": {
"build": "next build",
"dev": "next dev",
"lint": "xo",
"lint:fix": "xo --fix",
"test": "echo No tests defined"
},
"dependencies": {
"@0n0/ui": "workspace:*",
"@t3-oss/env-nextjs": "^0.10.1",
"lucide-react": "^0.316.0",
"next": "^14.2.1",
"next-themes": "^0.2.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"zod": "^3.23.3"
},
"devDependencies": {
"@0n0/tailwind-config": "workspace:*",
"@types/eslint": "^8.56.2",
"@types/node": "^20.11.20",
"@types/react": "^18.2.57",
"@types/react-dom": "^18.2.19",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
"eslint": "^8.57.0",
"eslint-config-next": "^14.1.3",
"postcss": "^8.4.34",
"prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.5.11",
"tailwindcss": "^3.4.1",
"typescript": "^5.4.2"
},
"ct3aMetadata": {
"initVersion": "7.32.0"
}
}
1 change: 1 addition & 0 deletions apps/website/postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@0n0/tailwind-config/postcss.config.cjs');
6 changes: 6 additions & 0 deletions apps/website/prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/** @type {import('prettier').Config & import('prettier-plugin-tailwindcss').PluginOptions} */
const config = {
plugins: ['prettier-plugin-tailwindcss'],
};

export default config;
Binary file added apps/website/public/favicon.ico
Binary file not shown.
43 changes: 43 additions & 0 deletions apps/website/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import {Poppins} from 'next/font/google';
import {ModeToggle} from '@0n0/ui/mode-toggle';
import '@0n0/ui/globals.css';
import {themes} from '@0n0/ui/lib/themes';
import {ThemeProvider} from '@/theme-provider';

// eslint-disable-next-line new-cap
const poppins = Poppins({
weight: '500',
subsets: ['latin'],
});

export const metadata = {
title: 'Create T3 App',
description: 'Generated by create-t3-app',
icons: [{rel: 'icon', url: '/favicon.ico'}],
};

export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang='en'>
<body className={`${poppins.className} flex flex-col min-h-screen antialiased bg-background text-foreground`}>
<ThemeProvider
attribute='class'
defaultTheme='orange-dark'
themes={[...themes]}
disableTransitionOnChange
>
<nav className='grow-0 flex flex-row-reverse p-2'>
<ModeToggle />
</nav>
<div className='h-full grow flex flex-col justify-center items-center'>
{children}
</div>
</ThemeProvider>
</body>
</html>
);
}
19 changes: 19 additions & 0 deletions apps/website/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import Link from 'next/link';
import {Button} from '@0n0/ui/button';
import {ClapperboardIcon, GithubIcon} from 'lucide-react';

export default function HomePage() {
return (
<main className='flex flex-col items-center justify-center'>
<p className='text-center'>
Hello, world!<br />
This website and all of its future subdomains are a <i>work in progress</i>.<br />
In the meantime, check out my <Link href='https://mov.0n0.sh/'>
<Button>self-hosted movie-web instance</Button>
</Link> or my <Link href='https://github.com/AirOne01'>
<Button>Github</Button>
</Link>.
</p>
</main>
);
}
9 changes: 9 additions & 0 deletions apps/website/src/components/theme-provider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use client';

import * as React from 'react';
import {ThemeProvider as NextThemesProvider} from 'next-themes';
import {type ThemeProviderProps} from 'next-themes/dist/types';

export function ThemeProvider({children, ...properties}: ThemeProviderProps) {
return <NextThemesProvider {...properties}>{children}</NextThemesProvider>;
}
41 changes: 41 additions & 0 deletions apps/website/src/env.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import process from 'node:process';
import {createEnv} from '@t3-oss/env-nextjs';
import {z} from 'zod';

export const env = createEnv({
/**
* Specify your server-side environment variables schema here. This way you can ensure the app
* isn't built with invalid env vars.
*/
server: {
NODE_ENV: z.enum(['development', 'test', 'production']),
},

/**
* Specify your client-side environment variables schema here. This way you can ensure the app
* isn't built with invalid env vars. To expose them to the client, prefix them with
* `NEXT_PUBLIC_`.
*/
client: {
// NEXT_PUBLIC_CLIENTVAR: z.string(),
},

/**
* You can't destruct `process.env` as a regular object in the Next.js edge runtimes (e.g.
* middlewares) or client-side so we need to destruct manually.
*/
runtimeEnv: {
NODE_ENV: process.env.NODE_ENV,
// NEXT_PUBLIC_CLIENTVAR: process.env.NEXT_PUBLIC_CLIENTVAR,
},
/**
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially
* useful for Docker builds.
*/
skipValidation: Boolean(process.env.SKIP_ENV_VALIDATION),
/**
* Makes it so that empty strings are treated as undefined. `SOME_VAR: z.string()` and
* `SOME_VAR=''` will throw an error.
*/
emptyStringAsUndefined: true,
});
3 changes: 3 additions & 0 deletions apps/website/tailwind.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/** @type {import('tailwindcss').Config} */
// @ts-ignore
module.exports = require('./node_modules/@0n0/tailwind-config/tailwind.config.cjs');
56 changes: 56 additions & 0 deletions apps/website/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"compilerOptions": {
/* Base Options: */
"esModuleInterop": true,
"skipLibCheck": true,
"target": "es2022",
"allowJs": true,
"resolveJsonModule": true,
"moduleDetection": "force",
"isolatedModules": true,
/* Strictness */
"strict": true,
"noUncheckedIndexedAccess": true,
"checkJs": true,
/* Bundled projects */
"lib": [
"dom",
"dom.iterable",
"ES2022"
],
"noEmit": true,
"module": "ESNext",
"moduleResolution": "Bundler",
"jsx": "preserve",
"plugins": [
{
"name": "next"
}
],
"incremental": true,
/* Path Aliases */
"baseUrl": ".",
"paths": {
"~/*": [
"./src/*"
],
"@/*": [
"./src/components/*"
],
"@globals": [
"./src/styles/globals.css"
]
}
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
"**/*.cjs",
"**/*.js",
".next/types/**/*.ts",
],
"exclude": [
"node_modules"
]
}
Loading

0 comments on commit 3ef8d52

Please sign in to comment.