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
c1f18e7
initial commit
trijit08 Jul 7, 2026
4550ab3
Create build.yml
trijit08 Jul 7, 2026
ee783cf
Update build.yml
trijit08 Jul 7, 2026
026d2c1
Update build.yml
trijit08 Jul 7, 2026
d525b72
Update build.yml
trijit08 Jul 7, 2026
572b978
Create blank.yml
trijit08 Jul 7, 2026
0101109
commit state 1
trijit08 Jul 8, 2026
f06e752
Update demo1.yml
trijit08 Jul 8, 2026
f851c3c
Merge pull request #2 from trijit08/feature
trijit08 Jul 8, 2026
0ca5c53
Update demo1.yml
trijit08 Jul 8, 2026
d988719
Update demo1.yml
trijit08 Jul 8, 2026
3a7fef4
Merge pull request #3 from trijit08/feature
trijit08 Jul 8, 2026
6888f50
commit test
trijit08 Jul 8, 2026
1514b76
Update demo1.yml
trijit08 Jul 8, 2026
723424d
Update App.jsx
trijit08 Jul 8, 2026
193e3c0
Merge branch 'main' into feature
trijit08 Jul 8, 2026
af2fbf3
Update demo1.yml
trijit08 Jul 8, 2026
fa236de
Merge pull request #4 from trijit08/feature
trijit08 Jul 8, 2026
ed379de
Update App.jsx
trijit08 Jul 8, 2026
8517d2b
Update vite.config.js
trijit08 Jul 8, 2026
32e0689
changes for environment variable
trijit08 Jul 10, 2026
b27aa53
controll flow change
trijit08 Jul 11, 2026
15d7163
Update MainContent.test.jsx
trijit08 Jul 11, 2026
47aba61
Merge pull request #5 from trijit08/feature
trijit08 Jul 11, 2026
db9eb2a
Update execution-flow.yml
trijit08 Jul 11, 2026
ed5770c
Merge branch 'main' into feature
trijit08 Jul 11, 2026
da787b1
Merge branch 'main' into feature
trijit08 Jul 11, 2026
1be063d
Update execution-flow.yml
trijit08 Jul 11, 2026
d2f6fb8
Merge pull request #6 from trijit08/feature
trijit08 Jul 11, 2026
949e123
Update execution-flow.yml
trijit08 Jul 11, 2026
886cadf
Merge branch 'main' of https://github.com/trijit08/example
trijit08 Jul 11, 2026
e375680
Update execution-flow.yml
trijit08 Jul 11, 2026
9a5577d
Update execution-flow.yml
trijit08 Jul 11, 2026
6a394b6
Update execution-flow.yml
trijit08 Jul 11, 2026
30c10f4
fdf
trijit08 Jul 11, 2026
445f158
Update execution-flow.yml
trijit08 Jul 11, 2026
ccacfc9
Update execution-flow.yml
trijit08 Jul 11, 2026
4f0f8eb
Update vite.config.js
trijit08 Jul 11, 2026
2eff6e8
Update vite.config.js
trijit08 Jul 11, 2026
38368a1
commit changes
trijit08 Jul 12, 2026
976ee34
Update deploy.yml
trijit08 Jul 12, 2026
6b7f730
Update deploy.yml
trijit08 Jul 12, 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
Binary file added .DS_Store
Binary file not shown.
24 changes: 24 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"root": true,
"env": {
"node": true,
"browser": true
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module"
},
"extends": ["plugin:react/recommended", "plugin:react/jsx-runtime"],
"rules": {
"react/react-in-jsx-scope": "off",
"semi": [2, "always"]
},
"settings": {
"react": {
"version": "detect"
}
}
}
Binary file added .github/.DS_Store
Binary file not shown.
11 changes: 11 additions & 0 deletions .github/workflows/blank.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Issue event
on: issues

jobs:
PrintIssue:
runs-on: ubuntu-22.04
steps:
- name: Echo
run: echo ${{ github.event.issue.number }}


22 changes: 22 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build Node
on: [push,workflow_dispatch]

jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v6.4.0
with:
node-version: 16
- name: Install Dependencies
run: npm ci
- name: Run lint
run: npm run lint
- name: Run Build
run: npm run build
- name: Run test
run: npm run test

87 changes: 87 additions & 0 deletions .github/workflows/continue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Website Deployment
on:
push:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Get code
uses: actions/checkout@v3
- name: Cache dependencies
id: cache
uses: actions/cache@v3
with:
path: ~/.npm
key: deps-node-modules-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: npm ci
- name: Lint code
run: npm run lint
test:
runs-on: ubuntu-latest
steps:
- name: Get code
uses: actions/checkout@v3
- name: Cache dependencies
id: cache
uses: actions/cache@v3
with:
path: node_modules
key: deps-node-modules-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
- name: Test code
continue-on-error: true
id: test_step
run: npm run test
- name: Upload test report
uses: actions/upload-artifact@v6
with:
name: test-report
path: test.json
build:
needs: test
runs-on: ubuntu-latest
steps:
- name: Get code
uses: actions/checkout@v3
- name: Cache dependencies
id: cache
uses: actions/cache@v3
with:
path: node_modules
key: deps-node-modules-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
- name: Build website
id: build-website
run: npm run build
- name: Upload artifacts
uses: actions/upload-artifact@v6
with:
name: dist-files
path: dist
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Get build artifacts
uses: actions/download-artifact@v3
with:
name: dist-files
- name: Output contents
run: ls
- name: Deploy
run: echo "Deploying..."
report:
needs: [ build,lint]
if: failure()
runs-on: ubuntu-latest
steps:
- name: Output information
run: |
echo "${{ steps.cache.output.cache-hit }}"
24 changes: 24 additions & 0 deletions .github/workflows/demo1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Events Demo 1
on:
workflow_dispatch:
push:
branches:
- feature
paths-ignore:
- 'src/**'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Output event data
run: echo "${{ toJSON(github.event) }}"
- name: Get code
uses: actions/checkout@v3
- name: Install dependencies
run: npm ci
- name: Test code
run: npm run test
- name: Build code
run: npm run build
- name: Deploy project
run: echo "Deploying...."
49 changes: 49 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Deployment (Container)
on:
push:
branches:
- main
- dev
env:
CACHE_KEY: node-deps
MONGODB_DB_NAME: gha-demo
jobs:
test:
environment: testing
runs-on: ubuntu-latest
container:
image: node:16
env:
MONGODB_CONNECTION_PROTOCOL: mongodb+srv
MONGODB_CLUSTER_ADDRESS: cluster0.ntrwp.mongodb.net
MONGODB_USERNAME: ${{ secrets.MONGODB_USERNAME }}
MONGODB_PASSWORD: ${{ secrets.MONGODB_PASSWORD }}
PORT: 8080
steps:
- name: Get Code
uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ env.CACHE_KEY }}-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: npm ci
- name: Run server
run: npm start & npx wait-on http://127.0.0.1:$PORT # requires MongoDB Atlas to accept requests from anywhere!
- name: Run tests
run: npm test
- name: Output information
run: |
echo "MONGODB_USERNAME: $MONGODB_USERNAME"
deploy:
needs: test
runs-on: ubuntu-latest
steps:
- name: Output information
env:
PORT: 3000
run: |
echo "MONGODB_DB_NAME: $MONGODB_DB_NAME"
echo "MONGODB_USERNAME: $MONGODB_USERNAME"
echo "${{ env.PORT }}"
87 changes: 87 additions & 0 deletions .github/workflows/execution-flow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Website Deployment
on:
push:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Get code
uses: actions/checkout@v3
- name: Cache dependencies
id: cache
uses: actions/cache@v3
with:
path: ~/.npm
key: deps-node-modules-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: npm ci
- name: Lint code
run: npm run lint
test:
runs-on: ubuntu-latest
steps:
- name: Get code
uses: actions/checkout@v3
- name: Cache dependencies
id: cache
uses: actions/cache@v3
with:
path: node_modules
key: deps-node-modules-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
- name: Test code
id: test_step
run: npm run test
- name: Upload test report
if: failure() && steps.test_step.outcome == 'failure'
uses: actions/upload-artifact@v6
with:
name: test-report
path: test.json
build:
needs: test
runs-on: ubuntu-latest
steps:
- name: Get code
uses: actions/checkout@v3
- name: Cache dependencies
id: cache
uses: actions/cache@v3
with:
path: node_modules
key: deps-node-modules-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
- name: Build website
id: build-website
run: npm run build
- name: Upload artifacts
uses: actions/upload-artifact@v6
with:
name: dist-files
path: dist
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Get build artifacts
uses: actions/download-artifact@v3
with:
name: dist-files
- name: Output contents
run: ls
- name: Deploy
run: echo "Deploying..."
report:
needs: [ build,lint]
if: failure()
runs-on: ubuntu-latest
steps:
- name: Output information
run: |
echo "${{ steps.cache.output.cache-hit }}"
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
/test-results/
/playwright-report/
/playwright/.cache/
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"window.zoomLevel": 7
}
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM node:16

ENV MONGODB_CONNECTION_PROTOCOL mongodb+srv
ENV MONGODB_DB_NAME gha-demo1
ENV MONGODB_CLUSTER_ADDRESS cluster0.ntrwp.mongodb.net
ENV MONGODB_USERNAME maximilian
ENV MONGODB_PASSWORD eI3R3UfNlJgWJe17

WORKDIR /app

COPY package*.json .

RUN npm install

COPY . .

CMD ["npm", "start"]
2 changes: 0 additions & 2 deletions README.md

This file was deleted.

12 changes: 12 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import bodyParser from 'body-parser';
import express from 'express';

import eventRoutes from './routes/events.js';

const app = express();

app.use(bodyParser.json());

app.use(eventRoutes);

app.listen(process.env.PORT);
27 changes: 27 additions & 0 deletions data/database.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { MongoClient } from 'mongodb';

const connectionProtocol = process.env.MONGODB_CONNECTION_PROTOCOL;
const clusterAddress = process.env.MONGODB_CLUSTER_ADDRESS;
const dbUser = process.env.MONGODB_USERNAME;
const dbPassword = process.env.MONGODB_PASSWORD;
const dbName = process.env.MONGODB_DB_NAME;

const uri = `${connectionProtocol}://${dbUser}:${dbPassword}@${clusterAddress}/?retryWrites=true&w=majority`;
const client = new MongoClient(uri);

console.log('Trying to connect to db');

try {
await client.connect();
await client.db(dbName).command({ ping: 1 });
console.log('Connected successfully to server');
} catch (error) {
console.log('Connection failed.');
await client.close();
console.log('Connection closed.');
process.exit(1);
}

const database = client.db(dbName);

export default database;
Loading