Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
d8a23fc
undo Lane's giant mistake
jumanasaif Mar 12, 2026
5b1273c
ubdate README
jumanasaif Mar 12, 2026
3dadbdc
add workflow
jumanasaif Mar 12, 2026
242d207
update workflow
jumanasaif Mar 12, 2026
f857c04
update workflow
jumanasaif Mar 12, 2026
10df4aa
update workflow
jumanasaif Mar 13, 2026
ec62f23
update README
jumanasaif Mar 13, 2026
a0038bd
Merge pull request #1 from jumanasaif/addtests
jumanasaif Mar 13, 2026
c2845c0
Update README with badge and additional note
jumanasaif Mar 13, 2026
8ac34fd
Update README formatting and content
jumanasaif Mar 13, 2026
f293a7b
update README
jumanasaif Mar 13, 2026
bca20d4
Merge branch 'main' into addtests
jumanasaif Mar 13, 2026
c610718
Merge pull request #2 from jumanasaif/addtests
jumanasaif Mar 13, 2026
a549d9e
update package.json
jumanasaif Mar 13, 2026
be349e3
add style check to CI
jumanasaif Mar 13, 2026
482b233
fix formatting
jumanasaif Mar 13, 2026
921ccb7
add linter
jumanasaif Mar 13, 2026
dbbe588
fix syntax
jumanasaif Mar 13, 2026
6e92249
fix syntax
jumanasaif Mar 13, 2026
2a7afae
fail CI on lint warnings
jumanasaif Mar 14, 2026
d8d450c
fail CI on lint warnings
jumanasaif Mar 14, 2026
7b0135b
[200~Fix Security Issues
jumanasaif Mar 14, 2026
3c6a15e
Fix Security Issues
jumanasaif Mar 14, 2026
e3cc778
Fix Security Issues
jumanasaif Mar 14, 2026
3c57e0d
add CD workflow
jumanasaif Mar 14, 2026
c684e1b
Merge pull request #3 from jumanasaif/addtests
jumanasaif Mar 14, 2026
30b2e8e
add gcloud build pipeline
jumanasaif Mar 14, 2026
0f566fb
Merge pull request #4 from jumanasaif/addtests
jumanasaif Mar 14, 2026
7c69b42
add gcloud build pipeline
jumanasaif Mar 14, 2026
a63eb14
Merge pull request #5 from jumanasaif/addtests
jumanasaif Mar 14, 2026
194180b
fix gcloud build pipeline
jumanasaif Mar 14, 2026
d70aa92
Merge pull request #6 from jumanasaif/addtests
jumanasaif Mar 14, 2026
1829d3f
fix gcloud build pipeline
jumanasaif Mar 14, 2026
d7da6f5
Merge pull request #7 from jumanasaif/addtests
jumanasaif Mar 14, 2026
25f0116
fix gcloud build pipeline
jumanasaif Mar 14, 2026
6ccbaa9
Merge pull request #8 from jumanasaif/addtests
jumanasaif Mar 14, 2026
72be304
fix cd
jumanasaif Mar 14, 2026
37ad684
Merge pull request #9 from jumanasaif/addtests
jumanasaif Mar 14, 2026
d12a261
Cloud run ubdate
jumanasaif Mar 14, 2026
7439c5b
Merge pull request #10 from jumanasaif/addtests
jumanasaif Mar 14, 2026
8f7e6c1
add automatic database migrations
jumanasaif Mar 15, 2026
77e5efa
Merge pull request #11 from jumanasaif/addtests
jumanasaif Mar 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: cd

on:
push:
branches: [main]

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest

env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}

steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install dependencies
run: npm ci

- name: Build app
run: npm run build

- name: Authenticate to GCP
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GCP_CREDENTIALS }}

- name: Setup gcloud CLI
uses: google-github-actions/setup-gcloud@v3
with:
project_id: clear-arbor-490220-q3

- name: Build and Push Docker Image
run: |
gcloud builds submit --tag us-central1-docker.pkg.dev/clear-arbor-490220-q3/notely-ar-repo/notely:latest .

- name: Run database migrations
run: npm run db:migrate

- name: Deploy to Cloud Run
run: |
gcloud run deploy notely \
--image us-central1-docker.pkg.dev/clear-arbor-490220-q3/notely-ar-repo/notely:latest \
--region us-central1 \
--allow-unauthenticated \
--project clear-arbor-490220-q3 \
--max-instances=4
88 changes: 88 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: ci

on:
pull_request:
branches: [main]
push:
branches: [main]

jobs:
tests:
name: Tests
runs-on: ubuntu-latest


steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm run test -- --coverage


style:
name: Style
runs-on: ubuntu-latest


steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install dependencies
run: npm ci

- name: Check formatting
run: npm run format:check

- name: Check linting
run: npm run lint -- --max-warnings=0


build-and-push:
name: Build and Push Docker Image
runs-on: ubuntu-latest
needs: [tests, style]

steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install dependencies
run: npm ci

- name: Build app
run: npm run build

- name: Authenticate to GCP
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GCP_CREDENTIALS }}

- name: Setup gcloud CLI
uses: google-github-actions/setup-gcloud@v3
with:
project_id: clear-arbor-490220-q3

- name: Build and Push Docker Image
run: |
gcloud builds submit --tag us-central1-docker.pkg.dev/clear-arbor-490220-q3/notely-ar-repo/notely:latest .

10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
node_modules/
coverage/
dist/
.env
.vscode
node_modules/
coverage/
dist/
.env
.vscode
22 changes: 11 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM --platform=linux/amd64 node:22-slim

WORKDIR /usr/src/app

ADD . .

RUN npm ci

RUN npm run build

CMD ["node", "dist/main.js"]
FROM --platform=linux/amd64 node:22-slim
WORKDIR /usr/src/app
ADD . .
RUN npm ci
RUN npm run build
CMD ["node", "dist/main.js"]
52 changes: 28 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
# learn-cicd-typescript-starter (Notely)

This repo contains the typescript starter code for the "Notely" application for the "Learn CICD" course on [Boot.dev](https://boot.dev).

## Local Development

Make sure you're on Node version 22+.

Create a `.env` file in the root of the project with the following contents:

```bash
PORT="8080"
```

Run the server:

```bash
npm install
npm run dev
```

_This starts the server in non-database mode._ It will serve a simple webpage at `http://localhost:8080`.

You do _not_ need to set up a database or any interactivity on the webpage yet. Instructions for that will come later in the course!
![Tests](https://github.com/jumanasaif/learn-cicd-typescript-starter/actions/workflows/ci.yml/badge.svg)
# learn-cicd-typescript-starter (Notely)

This repo contains the typescript starter code for the "Notely" application for the "Learn CICD" course on [Boot.dev](https://boot.dev).

## Local Development

Make sure you're on Node version 22+.

Create a `.env` file in the root of the project with the following contents:

```bash
PORT="8080"
```

Run the server:

```bash
npm install
npm run dev
```

_This starts the server in non-database mode._ It will serve a simple webpage at `http://localhost:8080`.

You do _not_ need to set up a database or any interactivity on the webpage yet. Instructions for that will come later in the course!

Jumana's version of Boot.dev's Notely app.

24 changes: 12 additions & 12 deletions drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { defineConfig } from "drizzle-kit";

import { config } from "./src/config";

export default defineConfig({
out: "./src/db/migrations",
schema: "./src/db/schema.ts",
dialect: "turso",
dbCredentials: {
url: config.db.url || "",
},
});
import { defineConfig } from "drizzle-kit";
import { config } from "./src/config";
export default defineConfig({
out: "./src/db/migrations",
schema: "./src/db/schema.ts",
dialect: "turso",
dbCredentials: {
url: config.db.url || "",
},
});
22 changes: 22 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import js from "@eslint/js";
import globals from "globals";
import tseslint from "typescript-eslint";
import { defineConfig } from "eslint/config";
import pluginSecurity from "eslint-plugin-security";

export default defineConfig([
{
ignores: ["dist/**", "node_modules/**"],
},
{
files: ["**/*.{js,mjs,cjs,ts,mts,cts}"],
plugins: { js },
extends: ["js/recommended"],
},
{
files: ["**/*.{js,mjs,cjs,ts,mts,cts}"],
languageOptions: { globals: globals.browser },
},
tseslint.configs.recommended,
pluginSecurity.configs.recommended,
]);
Loading