Booking
MIT License
To install MongoDB on macOS:
brew update
brew tap mongodb/brew
brew install [email protected]
brew install mongosh
# start service
brew services start [email protected]
# install mongodb-compass GUI
brew install mongodb-compass
Environment variables
touch .env
echo DB_URI=mongodb://localhost:27017/booking > .env
To start development locally:
yarn dev
To populate the database with data stored locally in the "mocks" folder:
curl --location --request POST 'http://localhost:3000/api/seeding/rooms' --header 'Accept: application/json'
Open http://localhost:3000 with your browser to see the result.
src/
├── components
│ ├── Atoms
│ │ ├── Button
│ │ │ ├── Button.stories.tsx
│ │ │ └── Button.tsx
│ │ ├── Checkbox
│ │ └── Icon
│ │ ├── Icon.stories.tsx
│ │ ├── Icon.tsx
│ │ └── svgs
│ ├── Molecules
│ │ ├── Carousel
│ │ │ ├── Carousel.fixture.ts
│ │ │ ├── Carousel.stories.tsx
│ │ │ └── Carousel.tsx
│ │ ├── Loader
│ │ │ ├── Loader.stories.tsx
│ │ │ └── Loader.tsx
│ │ └── SearchField
│ │ ├── SearchField.stories.tsx
│ │ └── SearchField.tsx
│ ├── Organisms
│ │ ├── Card
│ │ │ ├── CardBooking.stories.tsx
│ │ │ ├── CardDefault.stories.tsx
│ │ │ ├── Card.fixtures.tsx
│ │ │ └── Card.tsx
│ │ ├── CardList
│ │ │ ├── CardListBooking.stories.tsx
│ │ │ ├── CardListDefault.stories.tsx
│ │ │ ├── CardList.fixtures.tsx
│ │ │ └── CardList.tsx
│ │ └── Toast
│ │ ├── Toast.fixtures.tsx
│ │ ├── Toast.stories.tsx
│ │ └── Toast.tsx
│ ├── Pages
│ │ └── Home
│ │ ├── Home.stories.tsx
│ │ └── Home.tsx
│ └── Templates
│ ├── Footer
│ │ ├── Footer.stories.tsx
│ │ └── Footer.tsx
│ ├── Header
│ │ ├── Header.stories.tsx
│ │ └── Header.tsx
│ └── Layout
│ ├── Layout.stories.tsx
│ └── Layout.tsx
├── containers
│ ├── helpers
│ │ └── home.mapper.tsx
│ └── Home.container.tsx
├── helpers
│ └── constants.ts
├── mocks
│ ├── fixtures
│ │ └── rooms.ts
│ └── http.ts
├── pages
│ ├── api
│ │ ├── room
│ │ │ └── [id].ts
│ │ ├── rooms
│ │ └── seeding
│ │ └── rooms
│ ├── _app.tsx
│ ├── _document.tsx
│ └── index.tsx
├── server
│ ├── config
│ │ └── env.ts
│ ├── controllers
│ │ └── room.ts
│ ├── factories
│ │ ├── apiError.ts
│ │ └── roomErrors.ts
│ ├── helpers
│ ├── middlewares
│ │ └── errors.ts
│ ├── repository
│ │ ├── db.ts
│ │ └── models
│ │ └── room.ts
│ ├── routes
│ └── services
│ └── room.ts
├── services
│ ├── http.ts
│ └── room.service.ts
├── shared
│ └── schemas
│ ├── errors.ts
│ ├── http.ts
│ └── room.ts
├── store
│ ├── room
│ │ ├── room.slice.ts
│ │ └── room.thunk.ts
│ ├── rootReducer.ts
│ └── store.ts
└── styles
└── globals.scss