{"id":30654021,"url":"https://github.com/laithmahdi/hostify","last_synced_at":"2026-05-01T12:33:20.250Z","repository":{"id":291161517,"uuid":"927907687","full_name":"LaithMahdi/Hostify","owner":"LaithMahdi","description":"Hositify is a comprehensive web application designed to streamline the management of maison d'hôte (guest houses) in Tunisia. This platform offers an all-in-one solution for property owners,","archived":false,"fork":false,"pushed_at":"2025-05-02T19:00:10.000Z","size":8042,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-31T08:21:05.432Z","etag":null,"topics":["hono","hono-api","prsima","zod","zod-validation"],"latest_commit_sha":null,"homepage":"https://hostify-lime.vercel.app","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/LaithMahdi.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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-05T18:33:34.000Z","updated_at":"2025-05-02T19:00:14.000Z","dependencies_parsed_at":"2025-05-02T20:18:35.958Z","dependency_job_id":"8b0b268b-b4a3-4dbd-9f8e-2b6e77a07d86","html_url":"https://github.com/LaithMahdi/Hostify","commit_stats":null,"previous_names":["laithmahdi/hostify"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LaithMahdi/Hostify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LaithMahdi%2FHostify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LaithMahdi%2FHostify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LaithMahdi%2FHostify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LaithMahdi%2FHostify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LaithMahdi","download_url":"https://codeload.github.com/LaithMahdi/Hostify/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LaithMahdi%2FHostify/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32497812,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["hono","hono-api","prsima","zod","zod-validation"],"created_at":"2025-08-31T08:10:43.059Z","updated_at":"2026-05-01T12:33:20.228Z","avatar_url":"https://github.com/LaithMahdi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hostify Project\n\nWelcome to **Hostify**! This web application is built using modern technologies to streamline property and guest house management.\n\n---\n\n## 🚀 Prerequisites\n\nBefore setting up the project, ensure you have the following installed:\n\n- [Bun](https://bun.sh/) (v1.0 or higher)\n- [Prisma](https://www.prisma.io/) (installed globally via `bun add -g prisma`)\n- [Git](https://git-scm.com/) (for version control)\n- [PostgreSQL](https://www.postgresql.org/) (database)\n- [Docker](https://www.docker.com/) _(optional, for containerized setup)_\n- [Postman](https://www.postman.com/) _(optional, for API testing)_\n\n---\n\n## ⚙️ Setup Instructions\n\n### 1️⃣ Clone the Repository\n\n```bash\ngit clone https://github.com/LaithMahdi/Hostify.git\ncd Hostify\n```\n\n### 2️⃣ Install Dependencies\n\n```bash\nbun install\n```\n\n### 3️⃣ Set Up Environment Variables\n\nCreate a `.env` file in the root directory and configure it using `.env.example` as a template:\n\n```env\nDATABASE_URL=\"your-database-connection-string\"\n```\n\nReplace placeholders with actual values.\n\n### 4️⃣ Set Up the Database\n\n```bash\nbun run generate  # Generate Prisma client\nbun run db        # Apply schema to the database\n```\n\n### 5️⃣ Start the Development Server\n\n```bash\nbun run dev\n```\n\nThis runs the server in watch mode. ✅ When the API starts for the **first time**, it will **automatically seed initial data** into the database.\n\n---\n\n## 🌱 Initial Seeding (Runs Automatically on First Start)\n\nWhen the API runs for the first time, it will seed the following default data:\n\n- `seedUsers()`  \n  ➤ Creates 3 users:\n\n  - **Admin**\n  - **Owner**\n  - **Guest**\n\n- `seedEquipments()`  \n  ➤ Adds predefined equipment types for guest houses.\n\n- `seedData()`  \n  ➤ Seeds a sample **guest house**, **room**, and **contact info**.\n\nYou do **not need** to run any manual script — this process is handled automatically inside the `init()` function of the server setup:\n\n```ts\nconst init = async () =\u003e {\n  await seedUsers();\n  await seedEquipments();\n  await seedData();\n  console.log(\"✅ Seeding completed.\");\n};\n```\n\n---\n\n## 🐳 Docker Setup (Optional)\n\nYou can run Hostify in a fully containerized environment using Docker and Docker Compose.\n\n### 🔹 Build and Start Services\n\n```bash\ndocker-compose up -d\n```\n\nThis starts:\n\n- Hostify app server (port `3000`)\n- PostgreSQL DB (port `5432`)\n- Prisma Studio (port `8881`)\n\n### 🔹 Access Services\n\n| Service       | URL                             |\n| ------------- | ------------------------------- |\n| Hostify App   | http://localhost:3000           |\n| Prisma Studio | http://localhost:8881           |\n| PostgreSQL DB | Host: `localhost`, Port: `5432` |\n\n### 🔹 Stop Containers\n\n```bash\ndocker-compose down\n```\n\n---\n\n## 📌 API Documentation\n\n👉 [http://localhost:3005/api-docs](http://localhost:3005/api-docs)\n\n### 📍 API Endpoints Overview\n\n➡️ Visit the OpenAPI docs for a complete list, or explore common routes like:\n\n## 🔐 Auth Endpoints\n\n- `POST    /api/v1/auth/register` - Register a new user\n- `POST    /api/v1/auth/login` - Log in a user\n- `GET     /api/v1/auth/me` - Get authenticated user info\n\n## 🧰 Equipment Endpoints\n\n- `POST    /api/v1/equipment/create` - Create new equipment\n- `GET     /api/v1/equipment/all` - Get all equipment (paginated)\n- `GET     /api/v1/equipment/:id` - Get equipment by ID\n- `PUT     /api/v1/equipment/update/:id` - Update equipment by ID\n- `DELETE  /api/v1/equipment/delete/:id` - Delete equipment by ID\n- `PATCH   /api/v1/equipment/patch/:id` - Partially update equipment\n\n## 🏡 Guest House Endpoints\n\n- `POST    /api/v1/guest-house/create` - Create a new guest house\n- `GET     /api/v1/guest-house/all` - Get all guest houses (paginated)\n- `GET     /api/v1/guest-house/:id` - Get guest house by ID\n- `PUT     /api/v1/guest-house/update/:id` - Update guest house by ID\n- `DELETE  /api/v1/guest-house/delete/:id` - Delete guest house by ID\n- `PATCH   /api/v1/guest-house/patch/:id` - Partially update guest house\n\n## 🛏 Room Endpoints\n\n- `POST    /api/v1/room/create` - Create a new room\n- `GET     /api/v1/room/all` - Get all rooms (paginated)\n- `GET     /api/v1/room/:id` - Get room by ID\n- `GET     /api/v1/room/my/` - Get rooms associated with the user\n- `PUT     /api/v1/room/update/:id` - Update room by ID\n- `DELETE  /api/v1/room/delete/:id` - Delete room by ID\n- `PATCH   /api/v1/room/patch/:id` - Partially update room\n\n## 👤 Client Endpoints\n\n- `POST    /api/v1/client/create` - Create a new client\n- `GET     /api/v1/client/added-by` - Get clients added by current user\n- `GET     /api/v1/client/all` - Get all clients\n- `GET     /api/v1/client/:id` - Get client by ID\n- `PUT     /api/v1/client/update/:id` - Update client by ID\n- `PATCH   /api/v1/client/patch/:id` - Partially update client by ID\n- `DELETE  /api/v1/client/delete/:id` - Delete client by ID\n\n## 📅 Reservation Endpoints\n\n- `POST    /api/v1/reservation/create` - Create a new reservation\n- `PUT     /api/v1/reservation/update/:id` - Update reservation by ID\n- `PATCH   /api/v1/reservation/patch/:id` - Partially update reservation by ID\n- `DELETE  /api/v1/reservation/delete/:id` - Delete reservation by ID\n- `GET     /api/v1/reservation/all` - Get all reservations\n- `GET     /api/v1/reservation/owner` - Get reservations associated with the owner\n- `GET     /api/v1/reservation/client` - Get reservations associated with the client\n\n---\n\n## 🛠️ API Testing with Postman\n\n### 🔹 Import the Collection\n\n1. Open Postman.\n2. Click **Import**, then select `Hostify.postman_collection.json`.\n\n### 🔹 Setup Environment\n\n1. Create a new environment (e.g., **Hostify Local**).\n2. Add:\n   - `base_url`: `http://localhost:3000`\n   - `access_token`: _(left blank — fills in after login)_\n\n---\n\n## 🔧 Useful Scripts\n\n| Command            | Description                                     |\n| ------------------ | ----------------------------------------------- |\n| `bun run dev`      | Start the development server                    |\n| `bun run generate` | Generate the Prisma client                      |\n| `bun run db`       | Push the Prisma schema to the database          |\n| `bun run studio`   | Open Prisma Studio (DB management) at port 8881 |\n| `bun run reset`    | ⚠️ Reset the database (deletes all data)        |\n\n---\n\n## 🤝 Contributing\n\n1. Fork the repo\n2. Create a feature/bugfix branch\n3. Commit clearly\n4. Push \u0026 submit a pull request\n\n---\n\n## 📜 License\n\nMIT License — see `LICENSE` for full details.\n\n---\n\n## ❓ Questions?\n\n- Open an issue on GitHub\n- Reach out directly to the maintainer\n\n---\n\n### 🚀 Happy Coding \u0026 Enjoy Hostify! 🎉\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaithmahdi%2Fhostify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaithmahdi%2Fhostify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaithmahdi%2Fhostify/lists"}