11# TypeScript MongoDB Accounting App
22
3- אפליקציית הנהלת חשבונות מבוססת TypeScript ו-MongoDB שמאפשרת ניהול נתונים כלכליים והעלאת קבצים .
3+ A TypeScript and MongoDB-based accounting application that enables financial data management and file uploads .
44
5- ## תכונות
5+ ## Features
66
7- - ** ניהול נתונים ** : שמירה ושליפה של נתוני הנהלת חשבונות
8- - ** העלאת קבצים ** : העלאה ושמירה של קבצים בטוחה
9- - ** מניעת כפילויות ** : בדיקת כפילויות בשמירת נתונים
10- - ** API RESTful** : ממשק API מלא ומאובטח
11- - ** בדיקות מקיפות ** : מערכת בדיקות אוטומטית עם Jest
12- - ** TypeScript** : קוד בטוח ומהימן עם טיפוסים חזקים
7+ - ** Data Management ** : Store and retrieve accounting data
8+ - ** File Upload ** : Secure file upload and storage
9+ - ** Duplicate Prevention ** : Duplicate checking when saving data
10+ - ** RESTful API ** : Complete and secure API interface
11+ - ** Comprehensive Testing ** : Automated testing system with Jest
12+ - ** TypeScript** : Safe and reliable code with strong typing
1313
14- ## מבנה הפרויקט
14+ ## Project Structure
1515
1616```
1717typescript-mongodb-app/
1818├── src/
19- │ ├── app.ts # נקודת כניסה ראשית
19+ │ ├── app.ts # Main entry point
2020│ ├── config/
21- │ │ └── database.ts # הגדרות חיבור לבסיס נתונים
21+ │ │ └── database.ts # Database connection configuration
2222│ ├── controllers/
23- │ │ ├── dataController.ts # בקר לניהול נתונים
24- │ │ └── fileController.ts # בקר להעלאת קבצים
23+ │ │ ├── dataController.ts # Data management controller
24+ │ │ └── fileController.ts # File upload controller
2525│ ├── middleware/
26- │ │ └── upload.ts # Middleware להעלאת קבצים
26+ │ │ └── upload.ts # File upload middleware
2727│ ├── models/
28- │ │ └── index.ts # מודלי MongoDB
28+ │ │ └── index.ts # MongoDB models
2929│ ├── routes/
30- │ │ ├── dataRoutes.ts # נתיבי API לנתונים
31- │ │ └── fileRoutes.ts # נתיבי API לקבצים
30+ │ │ ├── dataRoutes.ts # Data API routes
31+ │ │ └── fileRoutes.ts # File API routes
3232│ ├── services/
33- │ │ ├── dataService.ts # שירותי נתונים
34- │ │ └── fileService.ts # שירותי קבצים
33+ │ │ ├── dataService.ts # Data services
34+ │ │ └── fileService.ts # File services
3535│ └── types/
36- │ ├── index.ts # הגדרות טיפוסים כלליות
37- │ └── reports.ts # טיפוסים לדוחות
38- ├── tests/ # בדיקות אוטומטיות
39- ├── uploads/ # תיקיית קבצים שהועלו
40- ├── nodejs-portable/ # Node.js נייד
36+ │ ├── index.ts # General type definitions
37+ │ └── reports.ts # Report types
38+ ├── tests/ # Automated tests
39+ ├── uploads/ # Uploaded files directory
40+ ├── nodejs-portable/ # Portable Node.js
4141└── package.json
4242```
4343
44- ## התקנה והפעלה
44+ ## Installation and Setup
4545
46- ### דרישות מקדימות
47- - Node.js 20.5.0+ (כלול בפרויקט )
48- - MongoDB (מקומי או מרוחק )
46+ ### Prerequisites
47+ - Node.js 20.5.0+ (included in project )
48+ - MongoDB (local or remote )
4949
50- ### הפעלת האפליקציה
50+ ### Running the Application
5151
52- 1 . ** התקנת dependencies** :
52+ 1 . ** Install dependencies** :
5353 ``` bash
5454 npm install
5555 ```
5656
57- 2 . ** בנייה ** :
57+ 2 . ** Build ** :
5858 ``` bash
5959 npm run build
6060 ```
6161
62- 3 . ** הפעלה בסביבת פיתוח ** :
62+ 3 . ** Run in development mode ** :
6363 ``` bash
6464 npm run dev
6565 ```
6666
67- 4 . ** הפעלה בסביבת ייצור ** :
67+ 4 . ** Run in production mode ** :
6868 ``` bash
6969 npm start
7070 ```
7171
72- ## בדיקות
72+ ## Testing
7373
74- הפרויקט כולל מערכת בדיקות מקיפה עם Jest:
74+ The project includes a comprehensive testing system with Jest:
7575
7676``` bash
77- # הרצת כל הבדיקות
77+ # Run all tests
7878npm test
7979
80- # הרצת בדיקות במצב Watch
80+ # Run tests in watch mode
8181npm run test:watch
8282
83- # דוח כיסוי בדיקות
83+ # Generate coverage report
8484npm run test:coverage
8585
86- # בדיקות עם פרטים מלאים
86+ # Run tests with verbose output
8787npm run test:verbose
8888```
8989
90- ### סוגי בדיקות :
91- - ** Unit Tests** : בדיקות יחידה לכל component
92- - ** Integration Tests** : בדיקות אינטגרציה לAPI
93- - ** Mocking** : Mocks למודולים חיצוניים
94- - ** Coverage** : דוח כיסוי מלא
90+ ### Test Types :
91+ - ** Unit Tests** : Individual component testing
92+ - ** Integration Tests** : API integration testing
93+ - ** Mocking** : External module mocking
94+ - ** Coverage** : Complete coverage reporting
9595
9696## API Endpoints
9797
98- ### נתונים ( Data)
99- - ` POST /api/data ` - שמירת נתונים חדשים
100- - ` GET /api/data ` - שליפת כל הנתונים
98+ ### Data
99+ - ` POST /api/data ` - Save new data
100+ - ` GET /api/data ` - Retrieve all data
101101
102- ### קבצים ( Files)
103- - ` POST /api/files/upload ` - העלאת קובץ
104- - ` GET /api/files ` - שליפת רשימת קבצים
102+ ### Files
103+ - ` POST /api/files/upload ` - Upload file
104+ - ` GET /api/files ` - Retrieve file list
105105
106- ## טכנולוגיות
106+ ## Technologies
107107
108108### Backend
109- - ** Node.js** 20.5.0 - סביבת ריצה
110- - ** TypeScript** 5.1.6 - שפת פיתוח
111- - ** Express.js** 4.18.2 - מסגרת web
112- - ** MongoDB** - בסיס נתונים
113- - ** Mongoose** 7.5.0 - ODM למונגו
109+ - ** Node.js** 20.5.0 - Runtime environment
110+ - ** TypeScript** 5.1.6 - Development language
111+ - ** Express.js** 4.18.2 - Web framework
112+ - ** MongoDB** - Database
113+ - ** Mongoose** 7.5.0 - MongoDB ODM
114114
115- ### קבצים
116- - ** Multer** 1.4.5 - העלאת קבצים
115+ ### Files
116+ - ** Multer** 1.4.5 - File upload handling
117117
118- ### בדיקות
119- - ** Jest** 30.0.5 - מסגרת בדיקות
120- - ** Supertest** 7.1.4 - בדיקות HTTP
121- - ** ts-jest** 29.4.1 - Jest עם TypeScript
118+ ### Testing
119+ - ** Jest** 30.0.5 - Testing framework
120+ - ** Supertest** 7.1.4 - HTTP testing
121+ - ** ts-jest** 29.4.1 - Jest with TypeScript
122122
123- ## אבטחה
123+ ## Security
124124
125- - ** Validation** : בדיקת נתונים בכניסה
126- - ** Error Handling** : טיפול בשגיאות מקיף
127- - ** Type Safety** : TypeScript למניעת שגיאות
128- - ** Duplicate Prevention** : מניעת כפילויות בנתונים
125+ - ** Validation** : Input data validation
126+ - ** Error Handling** : Comprehensive error handling
127+ - ** Type Safety** : TypeScript for error prevention
128+ - ** Duplicate Prevention** : Data duplication prevention
129129
130- ## דוגמאות שימוש
130+ ## Usage Examples
131131
132- ### שמירת נתונים
132+ ### Saving Data
133133``` javascript
134134const response = await fetch (' /api/data' , {
135135 method: ' POST' ,
136136 headers: { ' Content-Type' : ' application/json' },
137137 body: JSON .stringify ({
138- name: ' הכנסה מחודש ינואר ' ,
138+ name: ' January Income ' ,
139139 value: 15000
140140 })
141141});
142142```
143143
144- ### העלאת קובץ
144+ ### File Upload
145145``` javascript
146146const formData = new FormData ();
147147formData .append (' file' , fileInput .files [0 ]);
@@ -152,58 +152,58 @@ const response = await fetch('/api/files/upload', {
152152});
153153```
154154
155- ## משתנים סביבתיים
155+ ## Environment Variables
156156
157- יצירת קובץ ` .env ` :
157+ Create a ` .env ` file :
158158```
159159MONGODB_URI=mongodb://localhost:27017/accounting-app
160160PORT=3000
161161```
162162
163- ## פיתוח
163+ ## Development
164164
165- ### הוספת תכונות חדשות
166- 1 . יצירת Service ב- ` src/services/ `
167- 2 . יצירת Controller ב- ` src/controllers/ `
168- 3 . יצירת Routes ב- ` src/routes/ `
169- 4 . הוספת בדיקות ב- ` tests/ `
165+ ### Adding New Features
166+ 1 . Create Service in ` src/services/ `
167+ 2 . Create Controller in ` src/controllers/ `
168+ 3 . Create Routes in ` src/routes/ `
169+ 4 . Add tests in ` tests/ `
170170
171- ### הרצת בדיקות בפיתוח
171+ ### Running Tests in Development
172172``` bash
173173npm run test:watch
174174```
175175
176- ## מדדי איכות
176+ ## Quality Metrics
177177
178178- ** Code Coverage** : 43.69% (Controllers: 100%)
179179- ** Type Safety** : 100% TypeScript
180- - ** Error Handling** : טיפול מקיף בשגיאות
181- - ** Testing** : 33 בדיקות עוברות ✅ (100% success rate)
180+ - ** Error Handling** : Comprehensive error handling
181+ - ** Testing** : 33 tests passing (100% success rate)
182182
183- ### תוצאות בדיקות :
183+ ### Test Results :
184184```
185185Test Suites: 5 passed, 5 total
186186Tests: 33 passed, 33 total
187187Controllers: 100% Coverage
188188Services: 67.56% Coverage
189189```
190190
191- ## גרסאות
191+ ## Versions
192192
193- - ** v1.0.0** : גרסה ראשונית עם ניהול נתונים והעלאת קבצים
194- - תכונות עתידיות: דוחות, גרפים, ייצוא נתונים
193+ - ** v1.0.0** : Initial version with data management and file upload
194+ - Future features: Reports, charts, data export
195195
196- ## רישיון
196+ ## License
197197
198- MIT License - ראה קובץ LICENSE לפרטים .
198+ MIT License - see LICENSE file for details .
199199
200- ## תרומה
200+ ## Contributing
201201
202- 1 . Fork הפרויקט
203- 2 . יצירת feature branch
204- 3 . הוספת בדיקות לתכונות חדשות
205- 4 . שליחת Pull Request
202+ 1 . Fork the project
203+ 2 . Create a feature branch
204+ 3 . Add tests for new features
205+ 4 . Submit a Pull Request
206206
207207---
208208
209- ** פותח בישראל **
209+ ** Developed in Israel **
0 commit comments