- Create React Typescript client
npx create-react-app client --template typescript
- Create folder
mkdir server
- Install dependencies
cd server
npm init -y
npm i typescript @types/node @types/express cors dotenv pg sequelize typeorm
- Add server start script to package.json file
"scripts": {
"start": "tsc && node dist/app.js"
},
- Create TSConfig file (tsconfig.json)
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"outDir": "./dist",
"rootDir": "./src",
"strict": true,
"esModuleInterop": true
}
}
- Add .env file within server directory
PG_URL={secret given in Slack}
- Create directories and add code create src/ directory with app.ts, models/Todo.ts, routes/Todo.ts