Skip to content

Commit 5eff9b3

Browse files
committed
INIT: turborepo
UPDATE: migrate to eslint 9, safe next action 7, github actions for turborepo, move shadcn ui to share ui
1 parent 1471db5 commit 5eff9b3

File tree

267 files changed

+1694
-2591
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

267 files changed

+1694
-2591
lines changed

.env.example

+2
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ BACKEND_URL=
1414
DOMAIN=
1515
# specify the base url of main website (eg. http://172.16.2.9:3000)
1616
AUTH_URL=
17+
# specify the domain of redirect app (eg. localhost:3031)
18+
REDIRECT_DOMAIN=

.gitignore

+25-78
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,50 @@
1-
##############################
2-
## IntelliJ
3-
##############################
1+
# IntelliJ
42
out/
53
.idea/
64
.idea_modules/
75
*.iml
86
*.ipr
97
*.iws
108

11-
##############################
12-
## Visual Studio Code
13-
##############################
9+
# Visual Studio Code
1410
.vscode
1511
.idea
1612
.code-workspace
1713

18-
##############################
19-
## OS X
20-
##############################
14+
# OS X
2115
.DS_Store
2216

23-
##############################
24-
## Java Script
25-
##############################
26-
# compiled output
27-
/dist
28-
/tmp
29-
/out-tsc
17+
# dependencies
18+
node_modules
19+
.pnp
20+
.pnp.js
3021

31-
# Runtime data
32-
pids
33-
*.pid
34-
*.seed
35-
*.pid.lock
36-
37-
# Directory for instrumented libs generated by jscoverage/JSCover
38-
lib-cov
39-
40-
# Coverage directory used by tools like istanbul
22+
# testing
4123
coverage
4224

43-
# nyc test coverage
44-
.nyc_output
45-
46-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
47-
.grunt
48-
49-
# Bower dependency directory (https://bower.io/)
50-
bower_components
51-
52-
# node-waf configuration
53-
.lock-wscript
54-
55-
# IDEs and editors
56-
.c9/
57-
*.launch
58-
*.sublime-workspace
25+
# next.js
26+
.next/
27+
out/
28+
build
29+
.swc/
5930

6031
# misc
61-
.sass-cache
62-
connect.lock
63-
typings
32+
.DS_Store
33+
*.pem
6434

65-
# Logs
66-
logs
67-
*.log
35+
# debug
6836
npm-debug.log*
6937
yarn-debug.log*
7038
yarn-error.log*
7139

40+
# local env files
41+
.env.local
42+
.env.development.local
43+
.env.test.local
44+
.env.production.local
7245

73-
# Dependency directories
74-
node_modules/
75-
jspm_packages/
76-
77-
# Optional npm cache directory
78-
.npm
79-
80-
# Optional eslint cache
81-
.eslintcache
82-
83-
# Optional REPL history
84-
.node_repl_history
85-
86-
# Output of 'npm pack'
87-
*.tgz
88-
89-
# Yarn Integrity file
90-
.yarn-integrity
91-
92-
# dotenv environment variables file
93-
.env.production
94-
95-
# next.js build output
96-
.next
97-
98-
# Lerna
99-
lerna-debug.log
46+
# turbo
47+
.turbo
10048

101-
# System Files
102-
Thumbs.db
103-
.env.example
49+
# ui
50+
dist/

QUICK_START.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
# Quick Start
22

33
1. Download [NodeJS](https://nodejs.org/en/download/)
4-
2. Install bun (optional)
4+
2. Install bun
55

66
```bash
77
npm i -g bun
88
```
99

10-
3. Start up main app:
10+
3. Start up app:
1111

1212
```bash
13-
cd main-app
14-
npm install
15-
npm run dev
13+
bun run dev
1614
```
1715

18-
4. Start up react-redirect
16+
# Docker
17+
18+
1. Download docker
19+
2. Add copy and rename .env.example to .env
20+
3. Fill environment variables
21+
4. Start up docker compose
1922

2023
```bash
21-
cd redirect-app
22-
npm install
23-
npm run dev
24+
docker compose up
2425
```
2526

2627
[Go back](README.md)

redirect-app/.gitignore apps/redirect/.gitignore

+4-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
/node_modules
55
/.pnp
66
.pnp.js
7-
.yarn/install-state.gz
87

98
# testing
109
/coverage
@@ -26,13 +25,10 @@ yarn-debug.log*
2625
yarn-error.log*
2726

2827
# local env files
29-
.env*.local
28+
.env.local
29+
.env.development.local
30+
.env.test.local
31+
.env.production.local
3032

3133
# vercel
3234
.vercel
33-
34-
# typescript
35-
*.tsbuildinfo
36-
next-env.d.ts
37-
38-
bun.lockb
File renamed without changes.

apps/redirect/README.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
## Getting Started
2+
3+
First, run the development server:
4+
5+
```bash
6+
yarn dev
7+
```
8+
9+
Open [http://localhost:3001](http://localhost:3001) with your browser to see the result.
10+
11+
You can start editing the page by modifying `src/app/page.tsx`. The page auto-updates as you edit the file.
12+
13+
To create [API routes](https://nextjs.org/docs/app/building-your-application/routing/router-handlers) add an `api/` directory to the `app/` directory with a `route.ts` file. For individual endpoints, create a subfolder in the `api` directory, like `api/hello/route.ts` would map to [http://localhost:3001/api/hello](http://localhost:3001/api/hello).
14+
15+
## Learn More
16+
17+
To learn more about Next.js, take a look at the following resources:
18+
19+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
20+
- [Learn Next.js](https://nextjs.org/learn/foundations/about-nextjs) - an interactive Next.js tutorial.
21+
22+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
23+
24+
## Deploy on Vercel
25+
26+
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_source=github.com&utm_medium=referral&utm_campaign=turborepo-readme) from the creators of Next.js.
27+
28+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.

apps/redirect/eslint.config.mjs

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import nextConfig from '@repo/eslint-config/next.config.mjs'
2+
3+
/** @type {import("eslint").Linter.Config[]} */
4+
export default [...nextConfig]

apps/redirect/next-env.d.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/basic-features/typescript for more information.
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
/** @type {import('next').NextConfig} */
2-
const nextConfig = {
3-
output: "standalone",
2+
const config = {
3+
output: 'standalone',
44
reactStrictMode: true,
5+
transpilePackages: ['@repo/ui'],
56
eslint: {
67
ignoreDuringBuilds: true,
78
},
8-
};
9+
}
910

10-
export default nextConfig;
11+
export default config

apps/redirect/package.json

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "redirect",
3+
"version": "1.0.0",
4+
"private": true,
5+
"type": "module",
6+
"scripts": {
7+
"dev": "next dev --turbo --port 3001",
8+
"build": "next build",
9+
"start": "next start",
10+
"lint": "eslint src",
11+
"type-check": "tsc --noEmit"
12+
},
13+
"dependencies": {
14+
"@repo/ui": "*",
15+
"next": "^14.2.3",
16+
"next-themes": "^0.3.0",
17+
"object-hash": "^3.0.0",
18+
"react": "^18.2.0",
19+
"react-dom": "^18.2.0"
20+
},
21+
"devDependencies": {
22+
"@repo/eslint-config": "*",
23+
"@repo/typescript-config": "*",
24+
"@types/node": "^20.11.24",
25+
"@types/object-hash": "^3.0.6",
26+
"@types/react": "^18.2.61",
27+
"@types/react-dom": "^18.2.19",
28+
"autoprefixer": "^10.4.18",
29+
"postcss": "^8.4.35",
30+
"tailwindcss": "^3.4.1",
31+
"typescript": "^5.3.3"
32+
}
33+
}

apps/redirect/postcss.config.mjs

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from '@repo/ui/postcss.config.mjs'

apps/redirect/public/circles.svg

+17
Loading

apps/redirect/public/next.svg

+1
Loading

apps/redirect/public/turborepo.svg

+32
Loading

apps/redirect/public/vercel.svg

+1
Loading
File renamed without changes.
File renamed without changes.
File renamed without changes.

redirect-app/src/app/layout.tsx apps/redirect/src/app/layout.tsx

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1+
import './styles.css'
2+
import '@repo/ui/styles.css'
3+
4+
import { cn } from '@repo/ui/lib/utils'
5+
import { Toaster } from '@repo/ui/toaster'
16
import type { Metadata } from 'next'
27
import { Inter as FontSans } from 'next/font/google'
38
import { PublicEnvScript } from 'next-runtime-env'
4-
import './styles.css'
59
import { ReactNode } from 'react'
610

7-
import cn from '@/shared/lib/tailwind-merge'
811
import ThemeProvider from '@/shared/providers/theme-provider'
9-
import Toaster from '@/shared/ui/toaster'
1012

1113
const fontSans = FontSans({
1214
subsets: ['latin'],
@@ -30,7 +32,7 @@ export default function RootLayout({
3032
</head>
3133
<body
3234
className={cn(
33-
'min-h-screen bg-background font-sans antialiased',
35+
'bg-background min-h-screen font-sans antialiased',
3436
fontSans.variable
3537
)}
3638
>
File renamed without changes.

redirect-app/src/entities/redirect/index.ts apps/redirect/src/entities/redirect/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ import getRedirectByUrlPath from './get-redirect-by-url-path'
22
import { RedirectType } from './redirect-type'
33
import { RedirectTypesEnum } from './redirect-types-enum'
44

5-
export { getRedirectByUrlPath, RedirectTypesEnum, type RedirectType }
5+
export { getRedirectByUrlPath, type RedirectType, RedirectTypesEnum }

0 commit comments

Comments
 (0)