Travelio is a full-stack property booking platform built with a Django REST API backend and a React frontend. Users can register/login, search properties, and (for owner accounts) create new property listings.
- Backend: Django, Django REST Framework, SimpleJWT, PostgreSQL
- Frontend: React, React Router, Axios
- Python 3.10+
- Node.js 18+ and npm
- PostgreSQL 14+ (or compatible)
- Go to backend directory:
cd backend
- Create and activate a virtual environment:
python -m venv venvsource venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
(includes Pillow for property image uploads.)
- Create a local environment file from the template at project root:
cp .env.example .env
- Fill in your local secret values in
.env(especiallyDJANGO_SECRET_KEYandPOSTGRES_PASSWORD). - Ensure PostgreSQL runs with values from
.env(manually or with Docker Compose). - Run migrations:
python manage.py migrate
- Start backend server:
python manage.py runserver
Backend runs at http://127.0.0.1:8000.
- Open a new terminal and go to frontend directory:
cd frontend
- Install dependencies:
npm install
- Start frontend:
npm start
Frontend runs at http://localhost:3000.
You can run PostgreSQL with Docker Compose using environment values from root .env:
docker compose up -d db
- Open
http://localhost:3000. - Register a new user (
client,owner, orreceptionist). - Login with username + password.
- After login, you are redirected to the protected home page where you can search properties.
- If logged in as
owner, use Add property to create listings.
- Auth uses JWT tokens stored in browser local storage.
- Protected routes are enforced in the frontend.
- Property photos are stored under
backend/media/property_images/(ignored by git). WithDEBUG=True, Django serves them athttp://127.0.0.1:8000/media/.... The API returns absolute URLs inimages[].image_urlfor use from the React dev server. - Bookings are exposed at
POST /api/bookings/create/. A property must have at least one Room in the database (Django admin or API) or booking will return a validation error. - Profile-related APIs:
GET /api/auth/me/(current user; includesassigned_propertyfor receptionists),GET /api/bookings/my-bookings/(your bookings). Owners:GET /api/listings/my-properties/(properties with nested rooms),GET|POST /api/listings/properties/<id>/rooms/(list/add rooms),GET|PATCH|DELETE /api/listings/rooms/<id>/(room detail),GET|POST|DELETE /api/listings/properties/<id>/receptionist/(assign or remove a receptionist byusername/user_id). - Receptionists:
GET /api/bookings/reception/(bookings at assigned property),POST /api/bookings/<id>/confirm/,POST .../check-in/,POST .../check-out/. They mayPATCHonlyavailability_statuson rooms (maintenance, etc.) for their property.