This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const path = require('path'); | |
const port = process.env.PORT || 8080; | |
const app = express(); | |
// the __dirname is the current directory from where the script is running | |
app.use(express.static(__dirname)); | |
// send the user to index html page inspite of the url | |
app.get('*', (req, res) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { | |
parse, | |
validate, | |
execute, | |
GraphQLSchema, | |
GraphQLObjectType, | |
GraphQLString, | |
GraphQLID | |
} = require('graphql'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "react-ts-architecture", | |
"version": "1.0.0", | |
"description": "A React TS based frontend-application without CRA", | |
"scripts": { | |
"test": "npm run test" | |
}, | |
// Engines field helps us to create our project with the required node and npm versions | |
// for our project. | |
"engines": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# dependencies | |
/node_modules | |
# testing | |
/coverage | |
# production | |
/build | |
/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
semi: true, | |
trailingComma: 'all', | |
singleQuote: true, | |
printWidth: 100, | |
tabWidth: 2, | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compilerOptions": { | |
"lib": ["dom", "dom.iterable", "esnext"], | |
"allowJs": true, | |
"allowSyntheticDefaultImports": true, | |
"skipLibCheck": true, | |
"esModuleInterop": true, | |
"strict": true, | |
"forceConsistentCasingInFileNames": true, | |
"moduleResolution": "node", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The presets add a pre-defined set of plugins latest for latest JavaScript syntax, react and typescript. | |
{ | |
"presets": ["@babel/preset-env", "@babel/preset-react", "@babel/preset-typescript"], | |
"plugins": [ | |
[ | |
// A plugin that enables the re-use of Babel's injected helper code to save on codesize. | |
"@babel/plugin-transform-runtime", | |
{ | |
// Adds required corejs polyfills to your production code. | |
"corejs": { "version": 3, "proposals": true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
parser: '@typescript-eslint/parser', | |
parserOptions: { | |
ecmaVersion: 2018, | |
sourceType: 'module', | |
}, | |
plugins: ['@typescript-eslint', 'react-hooks'], | |
extends: [ | |
'plugin:react/recommended', | |
'plugin:react-hooks/recommended', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this is required to avoid eslint command being stuck in the process. | |
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>React TS Boilerplate App</title> | |
</head> | |
<body> | |
<div id="root"></div> | |
</body> | |
</html> |
OlderNewer