You can clone the repository, install dependencies, and run the app using the following steps:
(Open Terminal 1)
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)
(Open Terminal 2 in parallel)
npx prisma studio
Create a .env file in the root directory and add your own keys (if not already included):
AUTH_SECRET_KEY=your_secret_key_here SENTRY_DSN=your_sentry_dsn_here
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.).
-
Start the server Run in the project root:
npm run dev
-
Verify Postman Environment Configuration Navigate to the
postman/environmentsfolder. You’ll find a file like this:{ "key": "baseUrl", "value": "http://0.0.0.0:3000", "enabled": true }⚠️ If your server uses a different port or URL, updatebaseUrlaccordingly. -
Run Tests
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.
- Data-sensitive Tests: Some tests use
DELETEendpoints, 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.
Positive API integrationtest 2025年05月04日 213712 Negative API integrationtest 2025年05月04日 213807 bed-final-repository_image03 image image