Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
docs: update readme & add path & update gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
scffs committed Dec 9, 2023
1 parent 10ec9f6 commit 211760c
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 8 deletions.
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.idea
**/.env
.env
apps/api/.env
apps/shared/.env
apps/web/.env

**/.env

**/dist
14 changes: 14 additions & 0 deletions apps/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,17 @@ bun run migrate
![img_2.png](images/img_2.png)

#### API доступен по урлу http://localhost:3000/

# Возможные ошибки

- Ругается на `@prisma/client`

Необходимо в `apps/api` запустить команду
```bash
cd apps/api
npx prisma generate
```
or
```bash
npx prisma generate
```
2 changes: 1 addition & 1 deletion apps/api/__tests__/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Тесты


- Для тестов использовать ЧИСТУЮ ТЕСТОВУЮ БД
- Запускать БД как обычно в докере
- После запуска тестов надо удалить БД, иначе след. запуск тестов может упасть из-за повторяющихся данных

### Как очистить БД

#### Запуск studio
```bash
cd apps/api
Expand Down
4 changes: 2 additions & 2 deletions apps/api/__tests__/services/user.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { afterAll, describe, expect, it } from 'bun:test'
import { PrismaClient } from '@prisma/client'
import { getAllUsers, getUserById } from '../../src/services/userService'
import { getRandomID } from '../../src/utils'
import { getAllUsers, getUserById } from '@services'
import { getRandomID } from '@utils'

const testDb = new PrismaClient()

Expand Down
1 change: 1 addition & 0 deletions apps/api/src/services/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './userService'
5 changes: 3 additions & 2 deletions apps/api/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
"types": ["bun-types"],
"paths": {
"@utils": ["src/utils"],
"@handlers": ["src/handlers"]
"@handlers": ["src/handlers"],
"@services": ["src/services"]
}
},
"extends": "../../tsconfig.base.json",
"include": ["src"]
"include": ["src", "__tests__"]
}

0 comments on commit 211760c

Please sign in to comment.