Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
3e06d63
add: [IDE] config
KAnggara75 Jan 2, 2025
f3e46d9
fix: update .gitignore
KAnggara75 Jan 2, 2025
9366c78
add: [IDE] config
KAnggara75 Jan 2, 2025
ae65eaf
fix: package name
KAnggara75 Jan 2, 2025
09ce920
fix: type to module
KAnggara75 Jan 2, 2025
2c08326
chore: add lint depedency
KAnggara75 Jan 2, 2025
8a84cd7
add: [DB] Prisma
KAnggara75 Jan 2, 2025
7555177
add: [config] dotenv depedency
KAnggara75 Jan 2, 2025
75f0a86
add: [log] winston depedency
KAnggara75 Jan 2, 2025
b90d54f
add: [log] winston config
KAnggara75 Jan 2, 2025
a028287
add: [DB] Prisma log config
KAnggara75 Jan 2, 2025
37f2267
add: zod
KAnggara75 Jan 2, 2025
46a3357
add: [IDE] config
KAnggara75 Jan 2, 2025
e059f0d
add: tsconfig
KAnggara75 Jan 2, 2025
9b7156b
add: tsconfig
KAnggara75 Jan 2, 2025
37b6f13
fix: Hono main Config
KAnggara75 Jan 4, 2025
b594be4
add: app version on /api
KAnggara75 Jan 4, 2025
6a5ea84
fix: Shutting down gracefully event
KAnggara75 Jan 4, 2025
881f566
fix: user prisma
KAnggara75 Jan 4, 2025
56bcbe0
fix: logger export name to log
KAnggara75 Jan 4, 2025
bf6b398
add: User Register
KAnggara75 Jan 4, 2025
cbb0030
fix: .env now using Bun.env
KAnggara75 Jan 4, 2025
9c13292
fix: Bun test Config
KAnggara75 Jan 4, 2025
d8e1bcd
add: logger test
KAnggara75 Jan 4, 2025
037d6a7
add: user register test
KAnggara75 Jan 4, 2025
057792f
add: user LOGIN
KAnggara75 Jan 4, 2025
b916e3f
add: GET current user
KAnggara75 Jan 4, 2025
9d06a12
add: PATCH update user
KAnggara75 Jan 4, 2025
42a24c6
add: DELETE user logout
KAnggara75 Jan 4, 2025
07307df
add: contact
KAnggara75 Jan 4, 2025
56cd384
add: address
KAnggara75 Jan 5, 2025
bf59b10
add: github action CI/CD
KAnggara75 Jan 5, 2025
59b5adf
add: github action CI/CD
KAnggara75 Jan 5, 2025
5849fdf
add: github action CI/CD
KAnggara75 Jan 5, 2025
325b0fe
fix: /usr/bin/bash: line 1: pnpm: command not found
KAnggara75 Jan 5, 2025
ea13423
fix: a package.json script test was not found
KAnggara75 Jan 5, 2025
eef6333
add: github action CI/CD
KAnggara75 Jan 5, 2025
23a3841
fix: test cov config
KAnggara75 Jan 5, 2025
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
7 changes: 7 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
DATABASE_URL="mysql://root:root@localhost:3306/bunapi"
APP_VERSION=0.1.0
APP_ENV=production
APP_DEBUG=true
API_PORT=3030
LOG_LEVEL=info
EXAMPLE_EMAIL=test@idscript.my.id
74 changes: 37 additions & 37 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ name: "CodeQL Advanced"

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]
schedule:
- cron: '40 22 * * 5'
- cron: "40 22 * * 5"

jobs:
analyze:
Expand All @@ -43,8 +43,8 @@ jobs:
fail-fast: false
matrix:
include:
- language: javascript-typescript
build-mode: none
- language: javascript-typescript
build-mode: none
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
Expand All @@ -54,39 +54,39 @@ jobs:
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
8 changes: 4 additions & 4 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
#
# Source repository: https://github.com/actions/dependency-review-action
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
name: 'Dependency review'
name: "Dependency review"
on:
pull_request:
branches: [ "main" ]
branches: ["main"]

# If using a dependency submission action in this workflow this permission will need to be set to:
#
Expand All @@ -27,9 +27,9 @@ jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Checkout repository'
- name: "Checkout repository"
uses: actions/checkout@v4
- name: 'Dependency Review'
- name: "Dependency Review"
uses: actions/dependency-review-action@v4
# Commonly enabled options, see https://github.com/actions/dependency-review-action#configuration-options for all available options.
with:
Expand Down
74 changes: 74 additions & 0 deletions .github/workflows/github-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Unit Test 🧪

on:
push:
branches: ["main", "stg"]
pull_request:
branches: ["main", "stg"]

jobs:
Format_and_Check:
runs-on: ubuntu-latest
strategy:
matrix:
bun-version: [canary, 1.0.0, 1.0.36, 1.1.0, 1.1.16, 1.1.42]
name: Bun ${{ matrix.bun-version }} sample
steps:
- uses: actions/checkout@v4.2.2
- name: Use Bun ${{ matrix.bun-version }}
uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ matrix.bun-version }}
- name: Install dependencies
run: bun i
- name: Format and Check code
run: bun run fc
Jest_Test:
runs-on: ubuntu-latest
needs: Format_and_Check
strategy:
matrix:
bun-version: [canary, 1.0.0, 1.0.36, 1.1.0, 1.1.16, 1.1.42]
name: Test with Jest Bun ${{ matrix.bun-version }}
steps:
- name: Start MySQL
run: |
sudo /etc/init.d/mysql start
mysql -e "CREATE DATABASE IF NOT EXISTS bunapi;" -uroot -proot
- uses: actions/checkout@v4.2.2
- name: Use Bun ${{ matrix.bun-version }}
uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ matrix.bun-version }}
- name: create .env
run: mv .env.example .env
- name: Install dependencies
run: bun i
- name: Migration
run: bun run mig
- name: Test
run: bun test
Create_Test_Coverage_Badges:
runs-on: ubuntu-latest
needs: Format_and_Check
name: Test with Jest Bun Latest
steps:
- name: Start MySQL
run: |
sudo /etc/init.d/mysql start
mysql -e "CREATE DATABASE IF NOT EXISTS bunapi;" -uroot -proot
- uses: actions/checkout@v4.2.2
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: create .env
run: mv .env.example .env
- name: Install dependencies
run: bun i
- name: Migration
run: bun run mig
- name: Test
run: bun test
- name: Generating coverage badges
uses: jpb06/jest-badges-action@v1.9.18
with:
branches: main, stg
130 changes: 129 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,130 @@
# deps
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/BunAPI.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/bun.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading