Welcome to Hostify! This web application is built using modern technologies to streamline property and guest house management.
Before setting up the project, ensure you have the following installed:
- Bun (v1.0 or higher)
- Prisma (installed globally via
bun add -g prisma) - Git (for version control)
- PostgreSQL (database)
- Docker (optional, for containerized setup)
- Postman (optional, for API testing)
git clone https://github.com/LaithMahdi/Hostify.git
cd Hostifybun installCreate a .env file in the root directory and configure it using .env.example as a template:
DATABASE_URL="your-database-connection-string"Replace placeholders with actual values.
bun run generate # Generate Prisma client
bun run db # Apply schema to the databasebun run devThis runs the server in watch mode. ✅ When the API starts for the first time, it will automatically seed initial data into the database.
When the API runs for the first time, it will seed the following default data:
-
seedUsers()
➤ Creates 3 users:- Admin
- Owner
- Guest
-
seedEquipments()
➤ Adds predefined equipment types for guest houses. -
seedData()
➤ Seeds a sample guest house, room, and contact info.
You do not need to run any manual script — this process is handled automatically inside the init() function of the server setup:
const init = async () => {
await seedUsers();
await seedEquipments();
await seedData();
console.log("✅ Seeding completed.");
};You can run Hostify in a fully containerized environment using Docker and Docker Compose.
docker-compose up -dThis starts:
- Hostify app server (port
3000) - PostgreSQL DB (port
5432) - Prisma Studio (port
8881)
| Service | URL |
|---|---|
| Hostify App | http://localhost:3000 |
| Prisma Studio | http://localhost:8881 |
| PostgreSQL DB | Host: localhost, Port: 5432 |
docker-compose down👉 http://localhost:3005/api-docs
➡️ Visit the OpenAPI docs for a complete list, or explore common routes like:
POST /api/v1/auth/register- Register a new userPOST /api/v1/auth/login- Log in a userGET /api/v1/auth/me- Get authenticated user info
POST /api/v1/equipment/create- Create new equipmentGET /api/v1/equipment/all- Get all equipment (paginated)GET /api/v1/equipment/:id- Get equipment by IDPUT /api/v1/equipment/update/:id- Update equipment by IDDELETE /api/v1/equipment/delete/:id- Delete equipment by IDPATCH /api/v1/equipment/patch/:id- Partially update equipment
POST /api/v1/guest-house/create- Create a new guest houseGET /api/v1/guest-house/all- Get all guest houses (paginated)GET /api/v1/guest-house/:id- Get guest house by IDPUT /api/v1/guest-house/update/:id- Update guest house by IDDELETE /api/v1/guest-house/delete/:id- Delete guest house by IDPATCH /api/v1/guest-house/patch/:id- Partially update guest house
POST /api/v1/room/create- Create a new roomGET /api/v1/room/all- Get all rooms (paginated)GET /api/v1/room/:id- Get room by IDGET /api/v1/room/my/- Get rooms associated with the userPUT /api/v1/room/update/:id- Update room by IDDELETE /api/v1/room/delete/:id- Delete room by IDPATCH /api/v1/room/patch/:id- Partially update room
POST /api/v1/client/create- Create a new clientGET /api/v1/client/added-by- Get clients added by current userGET /api/v1/client/all- Get all clientsGET /api/v1/client/:id- Get client by IDPUT /api/v1/client/update/:id- Update client by IDPATCH /api/v1/client/patch/:id- Partially update client by IDDELETE /api/v1/client/delete/:id- Delete client by ID
POST /api/v1/reservation/create- Create a new reservationPUT /api/v1/reservation/update/:id- Update reservation by IDPATCH /api/v1/reservation/patch/:id- Partially update reservation by IDDELETE /api/v1/reservation/delete/:id- Delete reservation by IDGET /api/v1/reservation/all- Get all reservationsGET /api/v1/reservation/owner- Get reservations associated with the ownerGET /api/v1/reservation/client- Get reservations associated with the client
- Open Postman.
- Click Import, then select
Hostify.postman_collection.json.
- Create a new environment (e.g., Hostify Local).
- Add:
base_url:http://localhost:3000access_token: (left blank — fills in after login)
| Command | Description |
|---|---|
bun run dev |
Start the development server |
bun run generate |
Generate the Prisma client |
bun run db |
Push the Prisma schema to the database |
bun run studio |
Open Prisma Studio (DB management) at port 8881 |
bun run reset |
- Fork the repo
- Create a feature/bugfix branch
- Commit clearly
- Push & submit a pull request
MIT License — see LICENSE for full details.
- Open an issue on GitHub
- Reach out directly to the maintainer