---
# System prepended metadata

title: 'INTERNAL:'

---


# INTERNAL: 

heroku_pg admin link for cs_demo_db: 
```https://data.heroku.com/datastores/38cee9ee-5003-4333-87f4-2c3d20458f1c#administration```

uri: ```postgresql://godugvmyduvduy:3b89454dd6a4090ac4a5574a00a2e13393dda232f258b3a6033c4ac4d24858ff@ec2-50-19-127-115.compute-1.amazonaws.com/d16hrptvvsaq3f```


---

## TECH STACK


electron + react + redux + typescript boilerplate

## DB NOTES

```sql
CREATE TABLE students (
    id SERIAL PRIMARY KEY,
    name character varying,
    birthday_month integer REFERENCES month(id),
    cohort_number integer REFERENCES cohort(id),
    country integer REFERENCES residence(id)
);

CREATE TABLE residence (
    id SERIAL PRIMARY KEY,
    country_name character varying
);

CREATE TABLE month (
    id SERIAL PRIMARY KEY,
    name character varying
);

CREATE TABLE cohort (
    id SERIAL PRIMARY KEY,
    name character varying
);

CREATE TABLE student_teacher_relations (
    student_id integer PRIMARY KEY REFERENCES students(id),
    teacher_id integer REFERENCES teachers(id)
);
```

## example relationships:

**one to many**

in table RESIDENCE, ID references both the students and tables' country columns

**one to one**

in STUDENTS, birthday_month references the table MONTH's id column

**many to many**

the teachers and students

**a column that's both a primary key and a foreign key**


## Static/Strong Type(Script) Checking

**lint-staged**

lint-staged will run `prettier --fix` whenever `git add` is called on a file

**VSCode instructions:**

if you'd like your local code to mirror the formatted version run by the husky task on push, install the eslint, prettier and typescript god extensions and add the following to ur settings.json:

```
  "eslint.alwaysShowStatus": true,
  "prettier.tslintIntegration": true,
  "prettier.eslintIntegration": true,
  "eslint.autoFixOnSave": true,
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    {
      "language": "typescript",
      "autoFix": true
    },
    {
      "language": "typescriptreact",
      "autoFix": true
    }
  ],
  "editor.formatOnSave": true,
  "[javascript]": {
    "editor.formatOnSave": false
  },
  "[javascriptreact]": {
    "editor.formatOnSave": false
  },
  "[typescript]": {
    "editor.formatOnSave": false,
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[typescriptreact]": {
    "editor.formatOnSave": false,
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  }
```

## project layout | overview

```sh
.
├── .eslintrc                 - list of rules to use with eslint
├── .prettierrc               - style formatting rules
├── .stylelintrc              - style rule enforcing
├── .testcafe-electron-rc     - automates TS/JS e2e testing
├── .travis.yml               - main CI/CD
│
├── app
│   ├── Routes.tsx            - react router routes
│   ├── actions               - redux action types and definitions
│   ├── app.global.css        - global styles
│   ├── app.html              - launches electron's BrowserView component
│   ├── constants             - routes required() by Routes.tsx for conditional routing
│   ├── components            - react components
│   ├── containers            - react containers
│   ├── index.tsx             - main app wrapper
│   ├── main.dev.babel.js     - babel development env hook
│   ├── main.dev.ts           - the main process, launches index.tsx (render process)
│   ├── menu.ts               - configures menu & shortcuts
│   ├── reducers              - redux reducers, visually
│   ├── store                 - redux stores
│
├── appveyor.yml              - CI/CD for Windows & Linux
├── babel.config.js           - transpilation configuration / plugins for dev | prod
├── configs                   - contains base, dev, prod, dll, renderer webpack configs
├── internals                 - misc
├── package.json              - u know
├── renovate.json             - automated dependency handling
├── resources                 - icons for builds/releases
├── test                      - test suite dir (enzyme, e2e, examples)
├── tsconfig.json             - tsc's configuration
└── yarn.lock                 - lockfile
```
```