chore: initial project setup

- Add package.json with dependencies and scripts
- Configure TypeScript with tsconfig.json
- Set up Jest for testing
- Add Dockerfile and nixpacks.toml for deployment
- Add prisma.config.ts for Prisma configuration
This commit is contained in:
Andres Fabian Patiño Bermudez 2026-05-14 21:32:11 -05:00
commit 691c035130
7 changed files with 4211 additions and 0 deletions

18
Dockerfile Normal file
View File

@ -0,0 +1,18 @@
FROM node:20-alpine
RUN corepack enable && corepack prepare pnpm@10.33.0 --activate
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
COPY prisma ./prisma
COPY prisma.config.ts ./
RUN pnpm prisma generate
COPY . .
CMD ["sh", "-c", "pnpm prisma migrate deploy && pnpm run start"]

31
jest.config.ts Normal file
View File

@ -0,0 +1,31 @@
import type { Config } from "jest";
const config: Config = {
preset: "ts-jest",
testEnvironment: "node",
roots: ["<rootDir>/test"],
moduleFileExtensions: ["ts", "js", "json"],
transform: {
"^.+\\.ts$": [
"ts-jest",
{
tsconfig: {
target: "ES2022",
module: "ESNext",
moduleResolution: "bundler",
esModuleInterop: true,
strict: true,
skipLibCheck: true,
resolveJsonModule: true,
types: ["jest", "node"],
},
diagnostics: false,
},
],
},
moduleNameMapper: {
"^(\\.{1,2}/.*)\\.js$": "$1",
},
};
export default config;

5
nixpacks.toml Normal file
View File

@ -0,0 +1,5 @@
[phases.build]
cmds = ["pnpm prisma generate", "pnpm prisma migrate deploy"]
[phases.start]
cmd = "pnpm run start"

41
package.json Normal file
View File

@ -0,0 +1,41 @@
{
"name": "task-challenge-bk",
"version": "1.0.0",
"description": "Task management API with Hono",
"type": "module",
"scripts": {
"dev": "tsx watch src/index.ts",
"start": "tsx src/index.ts",
"start:prod": "node dist/index.js",
"build": "tsc",
"typecheck": "tsc --noEmit",
"test": "jest",
"test:watch": "jest --watch",
"db:migrate": "pnpm prisma migrate dev",
"db:seed": "tsx prisma/seed.ts",
"db:reset": "pnpm prisma migrate reset --force && pnpm db:seed",
"db:studio": "pnpm prisma studio"
},
"keywords": [],
"author": "",
"license": "ISC",
"packageManager": "pnpm@10.33.0",
"dependencies": {
"@hono/node-server": "^2.0.2",
"@prisma/adapter-pg": "^7.8.0",
"@prisma/client": "^7.8.0",
"dotenv": "^17.4.2",
"hono": "^4.12.18",
"pg": "^8.20.0",
"prisma": "^7.8.0"
},
"devDependencies": {
"@types/jest": "^30.0.0",
"@types/node": "^25.7.0",
"@types/pg": "^8.20.0",
"jest": "^30.4.2",
"ts-jest": "^29.4.9",
"tsx": "^4.21.0",
"typescript": "^6.0.3"
}
}

4081
pnpm-lock.yaml Normal file

File diff suppressed because it is too large Load Diff

15
prisma.config.ts Normal file
View File

@ -0,0 +1,15 @@
// This file was generated by Prisma, and assumes you have installed the following:
// npm install --save-dev prisma dotenv
import "dotenv/config";
import { defineConfig } from "prisma/config";
export default defineConfig({
schema: "prisma/schema.prisma",
migrations: {
path: "prisma/migrations",
seed: "tsx prisma/seed.ts",
},
datasource: {
url: process.env["DATABASE_URL"],
},
});

20
tsconfig.json Normal file
View File

@ -0,0 +1,20 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"esModuleInterop": true,
"strict": true,
"skipLibCheck": true,
"outDir": "./dist",
"rootDir": "./src",
"resolveJsonModule": true,
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"forceConsistentCasingInFileNames": true,
"types": ["node"]
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}