{"id":26296343,"url":"https://github.com/maxroecker/bookingapp","last_synced_at":"2025-06-11T17:02:17.280Z","repository":{"id":221175701,"uuid":"753442446","full_name":"MaxRoecker/bookingapp","owner":"MaxRoecker","description":"A simple booking app.","archived":false,"fork":false,"pushed_at":"2024-02-08T15:16:01.000Z","size":254,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T04:17:54.943Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MaxRoecker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-06T06:00:29.000Z","updated_at":"2024-02-06T06:01:26.000Z","dependencies_parsed_at":"2024-02-06T16:11:52.916Z","dependency_job_id":null,"html_url":"https://github.com/MaxRoecker/bookingapp","commit_stats":null,"previous_names":["maxroecker/bookingapp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MaxRoecker/bookingapp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxRoecker%2Fbookingapp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxRoecker%2Fbookingapp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxRoecker%2Fbookingapp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxRoecker%2Fbookingapp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MaxRoecker","download_url":"https://codeload.github.com/MaxRoecker/bookingapp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxRoecker%2Fbookingapp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259301644,"owners_count":22836970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-15T04:17:57.259Z","updated_at":"2025-06-11T17:02:17.134Z","avatar_url":"https://github.com/MaxRoecker.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BookingApp\n\nA simple booking app made with React, Typescript, Vite, and TailwindCSS.\nTested with Vitest and Playwright.\n\n## Development\n\nUse the `npm` package manager to install dependencies. Make sure you are using\nthe latest stable version of Node.js (v20.11).\n\n```bash\nnpm install\n```\n\n### Environment\n\nSet up the environment variables under the `.env` or `.env.local` files. The\nfile `.env-example` includes the required environment variables that are\nnon-sensitive.\n\n### Testing and linting\n\nYou can use the `test` script to run all the tests.\n\n```bash\nnpm run test\n```\n\nYou can use the `e2e` script to run all available E2E tests with Playwright.\n\n```bash\nnpm run e2e\n```\n\nYou can lint your code with the `lint` script, only `typecheck` the code with\nthe `types` script, or check the formatting with the `format` script.\n\n```bash\nnpm run lint\nnpm run types\nnpm run format\n```\n\n### Structure\n\nInside the `src/` directory, you will find the following files:\n\n- `app.tsx`: the root component.\n- `index.css`: the CSS entry point for TailwindCSS;\n- `main.tsx`: the main entry-point of the application;\n- `vite-env.d.ts`: typing definition for environment variables;\n\nThis project follows a \"domain\" structuring, i.e., all the directories inside\nthe `src/`. Currently, there are two business domains: `bookings` and\n`properties`. There is also the `commons` domain, which is used to group\nresources and code that can be used anywhere in the application. Inside a domain\ndirectory, there are other directories: `components`, `hooks`, `assets`,\n`mocks`, and `pages`, which are self-explanatory in their contents.\n\nTests are placed right next to the code they are testing. If there is a\ncomponent file `component.tsx`, its test should be placed in the same directory\nas `component.test.tsx`.\n\nAll the E2E tests are palced apart from the `src` directory, under its own\ndirectory named `e2e`.\n\n### Mocking\n\nAll the data required in network requests can be mocked. We use\n[MSW](https://mswjs.io/) to mock the HTTP requests/responses. You can see\nexamples of mocking inside the `[domain]/mock/http-handlers.ts`.\n\nAll the client-side network requests are made using the\n[SWR](https://swr.vercel.app/) hooks to efficiently use available resources,\nprevent duplication of requests, and utilize the cache.\n\n### Routing\n\nWe use [React Router v6](https://reactrouter.com/en/main) as the routing\nlibrary. All the routes are defined in `app.tsx`. All the pages are defined in\nthe `[domain]/pages` directory.\n\n### Data model\n\nThe `property` domain, in the context of this application, models a physical\nreal estate property that can receive bookings from users. A property has a\nname, a description, a thumbnail image, a rating, and a price per night.\n\nThe `booking` domain models the abstract reservation of a property within a\ntime interval. A booking is associated with a property and has a starting date\nand an ending date. The value of the booking is calculated by multiplying the\nnumber of nights between the starting and ending dates by the price per night\nof the associated property. Bookings are exclusive to properties; the same\nproperty cannot receive two different overlapping bookings.\n\nAdditionally, a property has an integer value called `offsetDays` that is\nrequired, usually by the property host, for cleaning between bookings. If there\nis a booking within a set of days, a number of `offsetDays` before and after\nare unavailable for booking.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxroecker%2Fbookingapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxroecker%2Fbookingapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxroecker%2Fbookingapp/lists"}