Skip to content

Latest commit

 

History

History
53 lines (42 loc) · 852 Bytes

README.md

File metadata and controls

53 lines (42 loc) · 852 Bytes

Example Postgres Todo App

Client

  1. Create React Typescript client
npx create-react-app client --template typescript

Server

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