Skip to content

Commit 4694d85

Browse files
authored
Merge pull request #12 from Joker666/develop
Release 1.5
2 parents 46546e0 + f2023ae commit 4694d85

File tree

12 files changed

+17
-17
lines changed

12 files changed

+17
-17
lines changed

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,30 +36,29 @@ pnpm install -g typescript
3636
pnpm install -g pino-pretty
3737
```
3838

39-
## Migration
39+
## Run the app
4040

4141
Create a new file `.env` in the root folder and copy contents from the `.env.template` file.
4242

4343
```bash
4444
docker compose up -d
4545
```
4646

47-
### Generate
47+
### Generate db table
4848

4949
```bash
5050
pnpm run db:generate
5151
```
5252

53-
### Migrate
53+
### Migrate schema
5454

5555
```bash
5656
pnpm run db:migrate
5757
```
5858

59-
## Run the app
59+
### Open Swagger UI
6060

6161
```bash
62-
pnpm run dev
6362
open http://localhost:3000/doc
6463
```
6564

drizzle.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import 'dotenv/config';
22
import { defineConfig } from 'drizzle-kit';
3-
import env from './src/lib/env.js';
3+
import env from './src/lib/env.ts';
44

55
export 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,
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import type { Logger as drizzleLogger } from 'drizzle-orm/logger';
22
import { drizzle } from 'drizzle-orm/mysql2';
33
import 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

99
const DB_ERRORS = {
1010
DUPLICATE_KEY: 'ER_DUP_ENTRY',
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { logger as httpLogger } from 'hono/logger';
99
import { trimTrailingSlash } from 'hono/trailing-slash';
1010

1111
import { NODE_ENVIRONMENTS } from './lib/constants.js';
12-
import { connection } from './lib/database.js';
12+
import { connection } from './db/database.js';
1313
import { logger } from './lib/logger.js';
1414
import { tracing } from './web/middlelayer/tracing.js';
1515
import { Server } from './web/server.js';

src/repository/user.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { 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

55
export class UserRepository {
66
public async create(user: NewUser) {

src/web/controller/auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Context } from 'hono';
2-
import { DB_ERRORS, type DatabaseError } from '../../lib/database.js';
2+
import { DB_ERRORS, type DatabaseError } from '../../db/database.js';
33
import { verify } from '../../lib/encryption.js';
44
import { type JWTPayload, encode } from '../../lib/jwt.js';
55
import type { UserService } from '../../service/user.js';

0 commit comments

Comments
 (0)