✨ Built with Next.js.
Follow these simple steps to get the application running in your local environment.
Before you begin, ensure you have the following installed:
- 📦 Node.js (version 18 or later)
- 🔧 npm (usually comes with Node.js)
- 💻 Your favorite code editor
- ⚡ Git for version control
- Clone the repository or download the project files:
git clone https://github.com/ITPNYU/booking-app.git
- Navigate to the project directory:
cd booking-app/booking-app
- Install the dependencies:
npm install
- 🔐 Obtain the
.env.local
file from a project administrator (Riho or Nima) and place it in the root directory of the project.
To start the development server:
npm run dev
🌐 The application should now be running at http://localhost:3000
Once the application is running, you should be able to:
- View the homepage at http://localhost:3000
- Access the admin dashboard (if you are authorized)
- See the booking interface
This project relies on environment variables for secure configuration. Important notes:
- Request the
.env.local
file from project admin or another dev - Never commit the
.env
file to version control - Keep the environment variables secure and confidential
This application includes a testing suite to ensure any potential bugs are caught before deployment. Here's how to run the tests and what tools to use.
- Vitest: A unit testing framework for testing individual components and utilities.
- Playwright: A tool for end-to-end (E2E) testing, ensuring that the entire user experience works as expected.
In the package.json
file, the following test scripts are defined:
-
Unit Tests: Run tests for individual units or components of the app.
npm run test:unit
Uses Vitest for fast and efficient unit testing.
-
End-to-End Tests: Run comprehensive tests simulating user interactions.
npm run test:e2e
Uses Playwright to verify that the application functions as expected from a user's perspective.
-
All Tests: Run both unit and end-to-end tests sequentially.
npm run test:all
-
Ensure the application is installed and up to date:
npm install
-
Make sure the environemnt variables below are set accordingly:
NEXT_PUBLIC_BRANCH_NAME=development CI=true TEST_EMAIL_ADDRESS=<YOUR_TEST_EMAIL_ADDRESS> TEST_PASSWORD=<YOUR_TEST_EMAIL_PASSWORD>
-
Run the desired test script:
- For unit tests:
npm run test:unit
- For E2E tests:
npm run test:e2e
- For all tests:
npm run test:all
- For unit tests:
-
View the results in the console. Fix any failing tests before proceeding with development or deployment.
- Environment: Ensure you have the development
.env.local
file properly configured for your testing environment. - Playwright Setup: If running Playwright tests for the first time, install the required browsers:
npx playwright install
This project uses a CI/CD pipeline with automated deployments:
Branch | Environment | Description |
---|---|---|
main |
🔧 Development | Automatic deployment for testing new features |
staging |
🔬 Staging | Pre-production testing and QA |
prod |
🚀 Production | Live production environment |
- Always create feature branches from
main
- Test thoroughly in development
- Create pull requests for code review
- Merge to appropriate branch based on deployment target
Remember to keep your local environment up to date:
git pull
npm install