Skip to content

Instantly share code, notes, and snippets.

View rajeshdavidbabu's full-sized avatar
🎯
Coding and other things !

Rajesh Babu rajeshdavidbabu

🎯
Coding and other things !
View GitHub Profile
@rajeshdavidbabu
rajeshdavidbabu / server.js
Created May 20, 2018 18:07
Server.js for heroku deployment
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) => {
@rajeshdavidbabu
rajeshdavidbabu / index.js
Last active May 14, 2020 11:46
A simple graphql query execution
const {
parse,
validate,
execute,
GraphQLSchema,
GraphQLObjectType,
GraphQLString,
GraphQLID
} = require('graphql');
@rajeshdavidbabu
rajeshdavidbabu / package.json
Last active January 9, 2022 19:03
Package.json for React-TS-Boilerplate
{
"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": {
@rajeshdavidbabu
rajeshdavidbabu / .gitignore
Last active January 9, 2022 22:10
.gitignore Configuration For React-Typescript
# dependencies
/node_modules
# testing
/coverage
# production
/build
/dist
@rajeshdavidbabu
rajeshdavidbabu / .prettierrc.js
Last active January 9, 2022 22:03
Prettier config React-Typescript
module.exports = {
semi: true,
trailingComma: 'all',
singleQuote: true,
printWidth: 100,
tabWidth: 2,
};
@rajeshdavidbabu
rajeshdavidbabu / tsconfig.json
Last active January 9, 2022 22:07
TS config React-TS Architecture
{
"compilerOptions": {
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"allowSyntheticDefaultImports": true,
"skipLibCheck": true,
"esModuleInterop": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "node",
@rajeshdavidbabu
rajeshdavidbabu / .babelrc
Last active January 9, 2022 21:54
Babelrc for React-TS Application
// 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 }
@rajeshdavidbabu
rajeshdavidbabu / .eslintrc.js
Last active January 9, 2022 21:56
eslintrc.js for React-TS Boilerplate
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'react-hooks'],
extends: [
'plugin:react/recommended',
'plugin:react-hooks/recommended',
@rajeshdavidbabu
rajeshdavidbabu / .eslintignore
Created January 9, 2022 22:01
.eslintignore file for React-TS Boilerplate
# this is required to avoid eslint command being stuck in the process.
/build
@rajeshdavidbabu
rajeshdavidbabu / index.html
Created January 9, 2022 22:18
index.html for React-TS boilerplate
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>React TS Boilerplate App</title>
</head>
<body>
<div id="root"></div>
</body>
</html>