https://github.com/aelyakoubi/Backend-Node.js-bed-final-bookingsite-API
BACK-END Bedfinal Bookingsite : JavaScript, Prisma, Node.js, MySQL, Error handling, Authentication, Routes, Api, CRUD 'method'
https://github.com/aelyakoubi/Backend-Node.js-bed-final-bookingsite-API
booking-api booking-app booking-platform booking-system booking-website bookingsite
Last synced: 29 days ago
JSON representation
BACK-END Bedfinal Bookingsite : JavaScript, Prisma, Node.js, MySQL, Error handling, Authentication, Routes, Api, CRUD 'method'
- Host: GitHub
- URL: https://github.com/aelyakoubi/Backend-Node.js-bed-final-bookingsite-API
- Owner: aelyakoubi
- Created: 2023-11-20T14:16:34.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-05-04T19:41:58.000Z (5 months ago)
- Last Synced: 2025-06-10T11:44:35.412Z (4 months ago)
- Topics: booking-api, booking-app, booking-platform, booking-system, booking-website, bookingsite
- Language: JavaScript
- Homepage: https://bed-bookingsite-api.onrender.com
- Size: 424 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

## 🚀 How to Get Started
You can clone the repository, install dependencies, and run the app using the following steps:
### 🧱 1. Install Frontend/Backend Dependencies
(Open **Terminal 1**)
```bash
npm install
npm install har-validator@latest # If needed
npm install uuid@latest # If needed
npm audit fix # Optional, to fix vulnerabilities
npm run dev # Starts the app on default dev port (e.g., 3000)
```### 🧭 2. Start Prisma Studio
(Open **Terminal 2** in parallel)
```bash
npx prisma studio
```---
## ⚙️ Setting Up Environment Variables
Create a `.env` file in the root directory and add your own keys (if not already included):
```env
AUTH_SECRET_KEY=your_secret_key_here
SENTRY_DSN=your_sentry_dsn_here
```---
## ✅ Running Tests
Tests are executed using **Newman**, a CLI tool for running Postman collections. The test flow mimics real API calls — such as validating success codes (`200`, `201`) or failure (`404`, etc.).
### Steps to Run Tests:
1. **Start the server**
Run in the project root:```bash
npm run dev
```2. **Verify Postman Environment Configuration**
Navigate to the `postman/environments` folder. You’ll find a file like this:```json
{
"key": "baseUrl",
"value": "http://0.0.0.0:3000",
"enabled": true
}
```> ⚠️ If your server uses a different port or URL, update `baseUrl` accordingly.
3. **Run Tests**
```bash
npm run test
```You’ll see the test results directly in the terminal. Behind the scenes, this command runs a Postman collection stored in the `postman/` folder as defined in your `package.json`.
---
### ⚠️ Important Notes:
- **Data-sensitive Tests:** Some tests use `DELETE` endpoints, which means they modify the database. Always restart the server (`npm run dev`) before rerunning tests.
- **Be cautious with test accounts or sample data**, especially if tied to registration/auth endpoints.



