Skip to content

Commit 32877f3

Browse files
committed
init
0 parents  commit 32877f3

File tree

22 files changed

+6743
-0
lines changed

22 files changed

+6743
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# cra-template-next-express-typescript
2+
3+
A template for Next.js application with Typescript and custom Express server.

package.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "cra-template-next-express-typescript",
3+
"version": "1.0.0",
4+
"description": "The base Typescript NextJS with Express custom server",
5+
"main": "template.json",
6+
"keywords": [
7+
"react",
8+
"create-react-app",
9+
"nextjs",
10+
"express",
11+
"typescript",
12+
"template"
13+
],
14+
"author": "Tien N. Nhan <tien@nnhan.com>",
15+
"license": "MIT",
16+
"engines": {
17+
"node": ">= 10"
18+
},
19+
"files": [
20+
"template",
21+
"template.json"
22+
]
23+
}

template.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"dependencies": {
3+
"express": "^4.17.1",
4+
"next": "^9.2.1",
5+
"react": "^16.12.0",
6+
"react-dom": "^16.12.0"
7+
},
8+
"scripts": {
9+
"dev": "nodemon",
10+
"build": "yarn clean && yarn build:server && yarn build:next",
11+
"start": "NODE_ENV=production node dist/index.js",
12+
"build:server": "tsc --project tsconfig.build-server.json && babel server --out-dir dist --extensions \".ts\" --source-maps inline",
13+
"build:next": "next build",
14+
"clean": "rm -rf .next dist"
15+
},
16+
"devDependencies": {
17+
"@babel/cli": "^7.8.4",
18+
"@types/express": "^4.17.2",
19+
"@types/node": "^13.7.0",
20+
"@types/react": "^16.9.19",
21+
"babel-plugin-module-resolver": "^4.0.0",
22+
"nodemon": "^2.0.2",
23+
"ts-node": "^8.6.2",
24+
"tsconfig-paths": "^3.9.0",
25+
"typescript": "^3.7.5"
26+
}
27+
}

template/.babelrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"presets": ["next/babel"],
3+
"plugins": [
4+
[
5+
"module-resolver",
6+
{
7+
"root": ["./"],
8+
"alias": {
9+
"@src": "./src",
10+
"@server": "./server"
11+
}
12+
}
13+
]
14+
]
15+
}

template/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# cra-template-next-express-typescript
2+
3+
A template for Next.js application with Typescript and custom Express server.

template/gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
*.log
3+
.next
4+
dist

template/next-env.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/types/global" />

template/nodemon.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"watch": ["server"],
3+
"ext": "ts",
4+
"ignore": ["server/tests/*"],
5+
"exec": "ts-node -r tsconfig-paths/register --project tsconfig.server.json server/index.ts"
6+
}

template/package.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "next-express-typescript",
3+
"version": "1.0.0",
4+
"main": "index.js",
5+
"license": "MIT",
6+
"dependencies": {
7+
"express": "^4.17.1",
8+
"next": "^9.2.1",
9+
"react": "^16.12.0",
10+
"react-dom": "^16.12.0"
11+
},
12+
"scripts": {
13+
"dev": "nodemon",
14+
"build": "yarn clean && yarn build:server && yarn build:next",
15+
"start": "NODE_ENV=production node dist/index.js",
16+
"build:server": "tsc --project tsconfig.build-server.json && babel server --out-dir dist --extensions \".ts\" --source-maps inline",
17+
"build:next": "next build",
18+
"clean": "rm -rf .next dist"
19+
},
20+
"devDependencies": {
21+
"@babel/cli": "^7.8.4",
22+
"@types/express": "^4.17.2",
23+
"@types/node": "^13.7.0",
24+
"@types/react": "^16.9.19",
25+
"babel-plugin-module-resolver": "^4.0.0",
26+
"nodemon": "^2.0.2",
27+
"ts-node": "^8.6.2",
28+
"tsconfig-paths": "^3.9.0",
29+
"typescript": "^3.7.5"
30+
}
31+
}

template/public/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!-- Remove this file after create application -->

0 commit comments

Comments
 (0)