Skip to content

Commit 0e135b8

Browse files
Environment config files
1 parent 0470091 commit 0e135b8

11 files changed

+117
-9384
lines changed

.env.example

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
PGDATABASE=postgres
2-
PGUSER=[YOUR USERNAME]
31
DATABASE_URL=postgres://[YOUR URL]
4-
APP_URL=http://localhost:3003/

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,6 @@ typings/
8787
# DynamoDB Local files
8888
.dynamodb/
8989

90-
.now
90+
.now
91+
.DS_Store
92+
.env.local

bun.lockb

311 KB
Binary file not shown.

codegen.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { CodegenConfig } from '@graphql-codegen/cli'
2+
3+
const config: CodegenConfig = {
4+
schema: 'http://localhost:3003/api/graphql',
5+
documents: ['graphql/**/*.ts*'],
6+
generates: {
7+
'./graphql/__generated__/': {
8+
preset: 'client',
9+
presetConfig: {
10+
gqlTagName: 'gql'
11+
},
12+
plugins: [
13+
// 'typescript',
14+
// 'typescript-operations'
15+
],
16+
config: {
17+
// flattenGeneratedTypes: true,
18+
// flattenGeneratedTypesIncludeFragments: true,
19+
// exportFragmentSpreadSubTypes: true
20+
}
21+
}
22+
},
23+
ignoreNoDocuments: true
24+
}
25+
26+
export default config

next-env.d.ts

Lines changed: 5 additions & 0 deletions
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.

next.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/** @type {import('next').NextConfig} */
2+
const nextConfig = {
3+
reactStrictMode: true,
4+
swcMinify: true
5+
}
6+
7+
module.exports = nextConfig

now.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

package.json

Lines changed: 35 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
{
22
"name": "nextjs-pwa-graphql-sql-boilerplate",
3-
"description": "Next.js serverless PWA with GraphQL (Apollo) and Postgres SQL",
4-
"version": "1.5.0",
3+
"description": "Next.js serverless PWA with GraphQL (Postgraphile, Apollo) and Postgres SQL",
4+
"version": "2.0.0",
55
"author": "Tom Söderlund <[email protected]>",
66
"license": "ISC",
7-
"main": "server/server.js",
87
"scripts": {
9-
"test": "echo 'Running Standard.js and Jasmine unit tests...\n' && yarn lint && yarn unit",
10-
"unit": "jasmine",
11-
"lint": "standard",
12-
"fix": "standard --fix",
13-
"dev": "echo 'Running as Express server'; nodemon -w server -w graphql -w package.json server/server.js",
14-
"now": "echo 'Running as Zeit Now serverless'; now dev --listen 3003",
15-
"deploy": "now --prod",
16-
"start": "NODE_ENV=production node server/server.js",
8+
"dev": "yarn api-types:watch & yarn dev:next",
9+
"dev:next": "next dev -p 3003",
1710
"build": "next build",
18-
"heroku-postbuild": "next build",
19-
"model": "mkdir graphql/newObject; touch graphql/newObject/{hooks,queries,resolvers,schema}.js"
11+
"start": "next start",
12+
"lint": "next lint",
13+
"lint:standard": "ts-standard",
14+
"fix": "ts-standard --fix",
15+
"api-types": "graphql-codegen",
16+
"api-types:watch": "graphql-codegen --watch",
17+
"new:collection": "mkdir graphql/collections/_NEW && cp graphql/collections/_TEMPLATE/* graphql/collections/_NEW && echo '\\i graphql/collections/_NEW/schema.sql' >> graphql/collections/all_tables.sql",
18+
"database:reset": "eval $(grep '^DATABASE_URL' .env.local) && psql ${DATABASE_URL} -a -f graphql/collections/all_tables.sql"
2019
},
2120
"standard": {
2221
"parser": "babel-eslint",
@@ -31,33 +30,30 @@
3130
]
3231
},
3332
"dependencies": {
34-
"@apollo/react-hooks": "^3.1.2",
35-
"@apollo/react-ssr": "^3.1.2",
36-
"apollo-cache-inmemory": "1.6.3",
37-
"apollo-client": "2.6.4",
38-
"apollo-link-http": "1.5.15",
39-
"apollo-server-express": "^2.14.2",
40-
"apollo-server-micro": "^2.14.2",
41-
"body-parser": "^1.18.3",
42-
"dotenv": "^6.2.0",
43-
"express": "^4.16.4",
44-
"glob": "^7.1.3",
45-
"graphql": "^14.4.1",
46-
"graphql-tag": "2.10.1",
47-
"isomorphic-unfetch": "^3.0.0",
48-
"merge-graphql-schemas": "^1.7.6",
49-
"next": "latest",
50-
"next-offline": "^4.0.6",
51-
"pg": "^7.8.1",
52-
"prop-types": "^15.6.2",
53-
"react": "^16.8.3",
54-
"react-dom": "^16.8.3",
55-
"sql-wizard": "^1.3.0"
33+
"@apollo/client": "^3.8.3",
34+
"@apollo/react-hooks": "^4.0.0",
35+
"@apollo/react-ssr": "^4.0.0",
36+
"@types/node": "20.5.9",
37+
"@types/pg": "^8.10.2",
38+
"@types/react": "18.2.21",
39+
"@types/react-dom": "18.2.7",
40+
"eslint": "8.48.0",
41+
"eslint-config-next": "13.4.19",
42+
"graphile-utils": "^4.13.0",
43+
"graphql": "^16.8.0",
44+
"next": "13.4.19",
45+
"pg": "^8.11.3",
46+
"postgraphile": "^4.13.0",
47+
"postgraphile-plugin-nested-mutations": "^1.1.0",
48+
"react": "18.2.0",
49+
"react-dom": "18.2.0",
50+
"typescript": "^5.2.2"
5651
},
5752
"devDependencies": {
58-
"babel-eslint": "^10.0.1",
59-
"jasmine": "^3.3.1",
60-
"nodemon": "^1.12.1",
61-
"standard": "^12.0.1"
53+
"@graphql-codegen/cli": "^5.0.0",
54+
"@graphql-codegen/client-preset": "^4.1.0",
55+
"@graphql-codegen/typescript-operations": "^4.0.1",
56+
"@parcel/watcher": "^2.3.0",
57+
"ts-standard": "^12.0.2"
6258
}
6359
}

tsconfig.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es5",
4+
"lib": [
5+
"dom",
6+
"dom.iterable",
7+
"esnext"
8+
],
9+
"allowJs": true,
10+
"skipLibCheck": true,
11+
"strict": true,
12+
"forceConsistentCasingInFileNames": true,
13+
"noEmit": true,
14+
"esModuleInterop": true,
15+
"module": "esnext",
16+
"moduleResolution": "node",
17+
"resolveJsonModule": true,
18+
"isolatedModules": true,
19+
"jsx": "preserve",
20+
"incremental": true,
21+
"baseUrl": ".",
22+
"plugins": [
23+
{
24+
"name": "next"
25+
}
26+
]
27+
},
28+
"include": [
29+
"next-env.d.ts",
30+
"**/*.ts",
31+
"**/*.tsx",
32+
".next/types/**/*.ts"
33+
],
34+
"exclude": [
35+
"node_modules"
36+
]
37+
}

vercel.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"crons": [
3+
]
4+
}

0 commit comments

Comments
 (0)