Welcome to the AutoAfya Backend repository! This project is a collaborative effort between Joanne Wendoh, Alvin Obala, and Arnold Kisuri. AutoAfya is a motor car servicing application designed to streamline the car maintenance process for users. This repository contains the backend code for the application, which is built using Flask.
App was deployed and this is the live link: https://autoafya-backend-phase4-groupproject-iqky.onrender.com
The frontend repo link: AutoAfya Frontend
AutoAfya is a web application that helps users schedule and manage car servicing appointments. The backend provides a robust API for handling data related to services, appointments, and user management.
- User Management: Register, login, and manage user profiles.
- Service Management: CRUD operations for car services.
- Appointment Booking: Schedule and manage car servicing appointments.
- Service History: View past and upcoming services for each user.
- Flask: Python microframework for building web applications.
- SQLAlchemy: ORM for managing database operations.
- Marshmallow: Library for object serialization and deserialization.
- SQLite: Lightweight database for development purposes.
To get started with the AutoAfya backend project, follow these instructions:
Make sure you have the following software installed on your machine:
- Python 3.7 or higher
- pip (Python package installer)
-
Clone the repository and navigate to the project directory:
git clone https://github.com/J-Wendoh/AutoAfya-BACKEND-phase4-groupproject.git cd AutoAfya-BACKEND-phase4-groupproject
-
Create a virtual environment and activate it:
python3 -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the project dependencies:
pip install -r requirements.txt
-
Set the Flask application environment variable:
export FLASK_APP=app.py # On Windows, use `set FLASK_APP=app.py`
-
Initialize the database:
flask db init flask db migrate flask db upgrade
-
Start the development server:
flask run
The API will be available at http://localhost:5000
.
####Get all services:
URL: /customer/services Method: GET Get service by ID:
URL: /customer/services/int:service_id Method: GET Get reviews for a specific service:
URL: /customer/services/int:service_id/reviews Method: GET
####Booking Endpoints:
Create or get bookings for the current user:
URL: /customer/booking Method: POST or GET Update a specific booking by ID:
URL: /customer/booking/int:booking_id Method: PATCH Delete a specific booking by ID:
URL: /customer/booking/int:booking_id/delete Method: DELETE
####User Endpoints:
Fetch the username of the current user: URL: /customer/username Method: GET Review Endpoints: Create a review:
URL: /customer/review Method: POST Update a specific review by ID:
URL: /customer/review/int:review_id Method: PATCH Delete a specific review by ID:
URL: /customer/review/int:review_id/delete Method: DELETE Get all reviews:
URL: /customer/reviews/all Method: GET Get reviews by the current user:
URL: /customer/reviews/user Method: GET
We welcome contributions to the AutoAfya backend project! To contribute, follow these steps:
- Fork the repository: Create a personal fork of the repository on GitHub.
- Clone your fork: Clone the forked repository to your local machine.
git clone https://github.com/YOUR_USERNAME/AutoAfya-BACKEND-phase4-groupproject.git
- Create a branch: Create a new branch for your feature or fix.
git checkout -b feature/your-feature
- Make changes: Implement your changes and test them.
- Commit your changes: Commit your changes with a descriptive message.
git add . git commit -m "Add feature: your-feature"
- Push your changes: Push your changes to your forked repository.
git push origin feature/your-feature
- Create a Pull Request: Open a pull request on the main repository to merge your changes.
Please ensure that your code follows the existing code style and includes tests for any new features.
This project is a group effort by:
This project is licensed under the MIT License.