This backend is tailored for our Group Room Booking App, powered by a FastAPI server. It facilitates room booking functionalities by serving data from various sources, including web scraping and Pocketbase, to provide real-time room availability and booking management.
- FastAPI Framework: Utilizes the FastAPI framework for high performance and easy API creation with Python.
- Real-Time Data: Integrates web scraping to gather up-to-date information on room availability from different websites.
- Pocketbase Integration: Manages and stores data related to room bookings, user information, and room details in a Pocketbase instance.
- Scalability: Designed to handle increasing loads with efficient request handling and data management.
-
Clone the repository:
git clone https://github.com/your-repository-url.git cd your-repository-directory
-
Install the requirements:
pip install -r requirements.txt
-
Run the server:
python -m uvicorn --app-dir="./app" --reload main:app --reload
Ensure the following configurations are set up before running the server:
- Pocketbase Configuration: Set up your Pocketbase instance and configure the connection details in app/config.py.
- Web Scraping Sources: Define the URLs and scraping logic in app/scrapers/ to fetch room availability data.
For detailed information on the API endpoints, please refer to our API documentation.
The backend includes scripts that periodically scrape websites for updated room availability and other relevant data. These scripts are located in the app/scrapers/ directory and can be scheduled using tools like cron or Celery.
Pocketbase is used to manage all data related to room bookings, including user information and room details. This ensures quick data retrieval and efficient management of booking data.
Run Tests:
pytest app/test_main.py
Ensure tests cover API endpoints, data processing, and interactions with the Pocketbase database.
To deploy the FastAPI backend, follow these steps:
- Set up a server: Ensure it meets the requirements for running FastAPI applications.
- Clone the repository and install dependencies: Follow the installation steps above.
- Configure environment variables: Set up all necessary configurations for the production environment.
- Run the server: Use a process manager like
gunicorn
oruvicorn
for production deployment.
We welcome contributions to enhance the backend functionality. To contribute, please:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Commit and push your changes to your branch.
- Submit a pull request with a detailed description of your changes.
This project is licensed under the MIT License. See the LICENSE file for more details.