A clinic appointment system built with Node.js/Express, MongoDB, React, and Playwright for end-to-end UI automation.
Ensure the following are installed on your system:
- Node.js v18 or higher
- npm v9 or higher
- MongoDB (local installation)
- MongoDB Compass (optional, for GUI database management)
- Browsers: Chromium, Firefox, WebKit (installed automatically by Playwright)
Clone the repository and install dependencies:
git clone <repo-url>
cd QueueCare
# Install backend dependencies
cd backend
npm install
# Install frontend dependencies
cd ../frontend
npm installCreate a .env file inside the backend/ directory:
MONGO_URI=mongodb://localhost:27017/queuecare
JWT_SECRET=your_jwt_secret
PORT=5000MONGO_URI: MongoDB connection stringJWT_SECRET: Secret key for JWT authenticationPORT: Backend server port (default: 5000)
- Ensure MongoDB is running locally
- (Optional) Open MongoDB Compass and connect to:
mongodb://localhost:27017 - Create a database named
queuecare
cd backend
node server.jsExpected output:
MongoDB connected
Server running on port 5000
cd frontend
npm startOpen your browser and visit: http://localhost:3000
Use Postman, curl, or similar tools to test endpoints:
-
Register
POST /api/auth/register -
Login
POST /api/auth/login -
Create Appointment
POST /api/appointments -
Update Appointment
PUT /api/appointments/:id -
Cancel Appointment
DELETE /api/appointments/:id -
Mark as Served (Staff only)
PUT /api/appointments/:id/serve
Playwright is configured in:
frontend/playwright.config.js
cd frontend
npx playwright testnpx playwright show-report- Screenshots are captured for all tests
- Video recording is disabled
- Reports and screenshots are saved in:
frontend/playwright-report/
Create these users manually (via API or MongoDB Compass) before running tests:
- Email:
alice@patience.com - Password:
password123 - Role:
patient
- Email:
sarah@staff.com - Password:
staff123 - Role:
staff
Playwright tests include:
- User login (valid, invalid, empty inputs)
- Appointment creation
- Appointment listing
- Form validation (empty fields, invalid dates)
- Staff marking appointments as served
- Ensure MongoDB, backend, and frontend are running before executing tests
- Use MongoDB Compass to verify stored data if needed
- If tests fail due to missing users, create the default test accounts first