Skip to content

ITPNYU/booking-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Booking App

✨ Built with Next.js.

πŸš€ Getting Started

Follow these simple steps to get the application running in your local environment.

πŸ“‹ Prerequisites

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

πŸ› οΈ Installation

  1. Clone the repository or download the project files:
git clone https://github.com/ITPNYU/booking-app.git
  1. Navigate to the project directory:
cd booking-app/booking-app
  1. Install the dependencies:
npm install
  1. πŸ” Obtain the .env.local file from a project administrator (Riho or Nima) and place it in the root directory of the project.

Running the Application

To start the development server:

npm run dev

🌐 The application should now be running at http://localhost:3000

πŸ” Verifying Installation

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

πŸ”’ Environment Variables

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

πŸ§ͺ Testing the Application

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.

Testing Tools

  • 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.

Available Test Scripts

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

Running Tests

  1. Ensure the application is installed and up to date:

    npm install
  2. 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>
  3. 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
  4. View the results in the console. Fix any failing tests before proceeding with development or deployment.

Notes

  • 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

🚒 Deployment

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

πŸ“ Deployment Guidelines

  1. Always create feature branches from main
  2. Test thoroughly in development
  3. Create pull requests for code review
  4. Merge to appropriate branch based on deployment target

πŸ”„ Regular Maintenance

Remember to keep your local environment up to date:

git pull
npm install

About

No description, website, or topics provided.

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published