File tree Expand file tree Collapse file tree 12 files changed +17
-17
lines changed
Expand file tree Collapse file tree 12 files changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -36,30 +36,29 @@ pnpm install -g typescript
3636pnpm install -g pino-pretty
3737```
3838
39- ## Migration
39+ ## Run the app
4040
4141Create a new file ` .env ` in the root folder and copy contents from the ` .env.template ` file.
4242
4343``` bash
4444docker compose up -d
4545```
4646
47- ### Generate
47+ ### Generate db table
4848
4949``` bash
5050pnpm run db:generate
5151```
5252
53- ### Migrate
53+ ### Migrate schema
5454
5555``` bash
5656pnpm run db:migrate
5757```
5858
59- ## Run the app
59+ ### Open Swagger UI
6060
6161``` bash
62- pnpm run dev
6362open http://localhost:3000/doc
6463```
6564
Original file line number Diff line number Diff line change 11import 'dotenv/config' ;
22import { defineConfig } from 'drizzle-kit' ;
3- import env from './src/lib/env.js ' ;
3+ import env from './src/lib/env.ts ' ;
44
55export default defineConfig ( {
6- schema : '.src/schema/schema.ts' ,
7- out : '.src/schema/migration' ,
6+ schema : './ src/db /schema/schema.ts' ,
7+ out : './ src/db /schema/migration' ,
88 dialect : 'mysql' ,
99 dbCredentials : {
1010 host : env . DB_HOST ,
Original file line number Diff line number Diff line change 11import type { Logger as drizzleLogger } from 'drizzle-orm/logger' ;
22import { drizzle } from 'drizzle-orm/mysql2' ;
33import mysql from 'mysql2/promise' ;
4- import * as schema from '.. /schema/schema.js' ;
5- import type { userSchema } from '.. /schema/schema.js' ;
6- import env from './env.js' ;
7- import { logger } from './logger.js' ;
4+ import * as schema from './schema/schema.js' ;
5+ import type { userSchema } from './schema/schema.js' ;
6+ import env from '../lib /env.js' ;
7+ import { logger } from '../lib /logger.js' ;
88
99const DB_ERRORS = {
1010 DUPLICATE_KEY : 'ER_DUP_ENTRY' ,
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import { logger as httpLogger } from 'hono/logger';
99import { trimTrailingSlash } from 'hono/trailing-slash' ;
1010
1111import { NODE_ENVIRONMENTS } from './lib/constants.js' ;
12- import { connection } from './lib /database.js' ;
12+ import { connection } from './db /database.js' ;
1313import { logger } from './lib/logger.js' ;
1414import { tracing } from './web/middlelayer/tracing.js' ;
1515import { Server } from './web/server.js' ;
Original file line number Diff line number Diff line change 11import { eq } from 'drizzle-orm' ;
2- import { userSchema } from '../schema/schema.js' ;
3- import { db , type NewUser } from '../lib /database.js' ;
2+ import { userSchema } from '../db/ schema/schema.js' ;
3+ import { db , type NewUser } from '../db /database.js' ;
44
55export class UserRepository {
66 public async create ( user : NewUser ) {
Original file line number Diff line number Diff line change 11import type { Context } from 'hono' ;
2- import { DB_ERRORS , type DatabaseError } from '../../lib /database.js' ;
2+ import { DB_ERRORS , type DatabaseError } from '../../db /database.js' ;
33import { verify } from '../../lib/encryption.js' ;
44import { type JWTPayload , encode } from '../../lib/jwt.js' ;
55import type { UserService } from '../../service/user.js' ;
You can’t perform that action at this time.
0 commit comments