diff --git a/README.md b/README.md index 6597c5c..6cccc47 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ A fast and efficient **Vehicle Allocation System** built using **FastAPI** and **MongoDB**, designed to allow employees to allocate vehicles for specific dates, manage allocation statuses, and handle driver assignments. The system ensures that a vehicle is not double-booked and enforces date restrictions to prevent allocation modifications after the allocation date. +![Banner](./docs-docusaurus/static/img/vallocation_banner.png) + > [!NOTE] > Please check the [official website](https://fahimfba.github.io/vallocation/) for the complete instructions along with some popular resources! @@ -99,10 +101,13 @@ The API will now be available at `http://127.0.0.1:8000`. ```bash vallocation/ │ +├── .github/ # Action Workflows ├── config/ │ └── database.py # Database configuration for MongoDB │ -├── docs/ # Documentation (Docusaurus) +├── docs/ # Documentation (Static Site - Generated by Docusaurus) +│ +├── docs-docusaurus/ # Documentation (Docusaurus) │ ├── models/ │ └── vallocation_model.py # Pydantic model for vehicle allocations @@ -117,6 +122,7 @@ vallocation/ ├── .gitignore # Git ignore rules ├── LICENSE # License file for the project ├── main.py # Entry point of the FastAPI application +├── README.md # Repository README ├── requirements.txt # Python dependencies for the project ``` @@ -259,5 +265,5 @@ Each allocation is stored in MongoDB in the following format: - **Fahim** - Developer, Architect - **[Contributors](https://github.com/FahimFBA/vallocation/contributors)** -Feel free to open issues or submit pull requests to help improve this project! +Feel free to open [issues](https://github.com/FahimFBA/vallocation/issues) or submit [pull requests](https://github.com/FahimFBA/vallocation/pulls) to help improve this project! diff --git a/docs-docusaurus/docs/intro.md b/docs-docusaurus/docs/intro.md index 6ae1290..d4bb963 100644 --- a/docs-docusaurus/docs/intro.md +++ b/docs-docusaurus/docs/intro.md @@ -102,10 +102,13 @@ The API will now be available at `http://127.0.0.1:8000`. ```bash vallocation/ │ +├── .github/ # Action Workflows ├── config/ │ └── database.py # Database configuration for MongoDB │ -├── docs/ # Documentation (Docusaurus) +├── docs/ # Documentation (Static Site - Generated by Docusaurus) +│ +├── docs-docusaurus/ # Documentation (Docusaurus) │ ├── models/ │ └── vallocation_model.py # Pydantic model for vehicle allocations @@ -120,6 +123,7 @@ vallocation/ ├── .gitignore # Git ignore rules ├── LICENSE # License file for the project ├── main.py # Entry point of the FastAPI application +├── README.md # Repository README ├── requirements.txt # Python dependencies for the project ``` @@ -264,5 +268,5 @@ Each allocation is stored in MongoDB in the following format: - **Fahim** - Developer, Architect - **[Contributors](https://github.com/FahimFBA/vallocation/contributors)** -Feel free to open issues or submit pull requests to help improve this project! +Feel free to open [issues](https://github.com/FahimFBA/vallocation/issues) or submit [pull requests](https://github.com/FahimFBA/vallocation/pulls) to help improve this project! diff --git a/docs/404.html b/docs/404.html index 33f347b..b3d5cfa 100644 --- a/docs/404.html +++ b/docs/404.html @@ -5,7 +5,7 @@ Page Not Found | Vehicle Allocation (Vallocation) - + diff --git a/docs/assets/images/vallocation_banner-2616bd730802c91535b6fcffab6ff2d8.png b/docs/assets/images/vallocation_banner-2616bd730802c91535b6fcffab6ff2d8.png new file mode 100644 index 0000000..40c5341 Binary files /dev/null and b/docs/assets/images/vallocation_banner-2616bd730802c91535b6fcffab6ff2d8.png differ diff --git a/docs/assets/js/0e384e19.4e1704de.js b/docs/assets/js/0e384e19.4e1704de.js new file mode 100644 index 0000000..c009615 --- /dev/null +++ b/docs/assets/js/0e384e19.4e1704de.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[976],{619:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>o,contentTitle:()=>t,default:()=>h,frontMatter:()=>s,metadata:()=>a,toc:()=>c});var l=i(4848),r=i(8453);const s={sidebar_position:1},t="Vehicle Allocation (Vallocation)",a={id:"intro",title:"Vehicle Allocation (Vallocation)",description:"A fast and efficient Vehicle Allocation System built using FastAPI and MongoDB, designed to allow employees to allocate vehicles for specific dates, manage allocation statuses, and handle driver assignments. The system ensures that a vehicle is not double-booked and enforces date restrictions to prevent allocation modifications after the allocation date.",source:"@site/docs/intro.md",sourceDirName:".",slug:"/intro",permalink:"/vallocation/docs/intro",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",next:{title:"Resources",permalink:"/vallocation/docs/resources"}},o={},c=[{value:"Table of Contents",id:"table-of-contents",level:2},{value:"Overview",id:"overview",level:2},{value:"Features",id:"features",level:2},{value:"Tech Stack",id:"tech-stack",level:2},{value:"Requirements",id:"requirements",level:2},{value:"Installation",id:"installation",level:2},{value:"1. Clone the repository",id:"1-clone-the-repository",level:3},{value:"2. Create a virtual environment",id:"2-create-a-virtual-environment",level:3},{value:"3. Install the required dependencies",id:"3-install-the-required-dependencies",level:3},{value:"4. Set up environment variables",id:"4-set-up-environment-variables",level:3},{value:"5. Run the application",id:"5-run-the-application",level:3},{value:"Project Structure",id:"project-structure",level:2},{value:"API Endpoints",id:"api-endpoints",level:2},{value:"Create an Allocation",id:"create-an-allocation",level:3},{value:"Update an Allocation",id:"update-an-allocation",level:3},{value:"Delete an Allocation",id:"delete-an-allocation",level:3},{value:"Get Allocation History",id:"get-allocation-history",level:3},{value:"Example Request:",id:"example-request",level:4},{value:"Example Response:",id:"example-response",level:4},{value:"Pagination & Filters:",id:"pagination--filters",level:4},{value:"Database Schema",id:"database-schema",level:2},{value:"Contributors",id:"contributors",level:2}];function d(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.header,{children:(0,l.jsx)(n.h1,{id:"vehicle-allocation-vallocation",children:"Vehicle Allocation (Vallocation)"})}),"\n",(0,l.jsxs)(n.p,{children:["A fast and efficient ",(0,l.jsx)(n.strong,{children:"Vehicle Allocation System"})," built using ",(0,l.jsx)(n.strong,{children:"FastAPI"})," and ",(0,l.jsx)(n.strong,{children:"MongoDB"}),", designed to allow employees to allocate vehicles for specific dates, manage allocation statuses, and handle driver assignments. The system ensures that a vehicle is not double-booked and enforces date restrictions to prevent allocation modifications after the allocation date."]}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.img,{alt:"Banner",src:i(8895).A+"",width:"1846",height:"896"})}),"\n",(0,l.jsx)(n.h2,{id:"table-of-contents",children:"Table of Contents"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.a,{href:"#overview",children:"Overview"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.a,{href:"#features",children:"Features"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.a,{href:"#tech-stack",children:"Tech Stack"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.a,{href:"#requirements",children:"Requirements"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.a,{href:"#installation",children:"Installation"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.a,{href:"#project-structure",children:"Project Structure"})}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.a,{href:"#api-endpoints",children:"API Endpoints"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.a,{href:"#create-an-allocation",children:"Create an Allocation"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.a,{href:"#update-an-allocation",children:"Update an Allocation"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.a,{href:"#delete-an-allocation",children:"Delete an Allocation"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.a,{href:"#get-allocation-history",children:"Get Allocations History"})}),"\n"]}),"\n"]}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.a,{href:"#database-schema",children:"Database Schema"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.a,{href:"#contributors",children:"Contributors"})}),"\n"]}),"\n",(0,l.jsx)(n.h2,{id:"overview",children:"Overview"}),"\n",(0,l.jsxs)(n.p,{children:["The ",(0,l.jsx)(n.strong,{children:"Vehicle Allocation System"})," is a RESTful API that allows employees to reserve vehicles for specific days. Each vehicle has an assigned driver, and only one vehicle can be allocated per employee for a given day. Additionally, users can view, update, and delete allocations, provided the actions are performed before the allocated date."]}),"\n",(0,l.jsx)(n.p,{children:"This project is designed to handle a high number of users and vehicles, with optimizations for load handling and database efficiency."}),"\n",(0,l.jsx)(n.h2,{id:"features",children:"Features"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Create Allocations:"})," Employees can allocate vehicles for future dates."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Update Allocations:"})," Modify existing allocations before the allocation date."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Delete Allocations:"})," Cancel allocations before the allocation date."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Conflict Prevention:"})," Prevents multiple allocations of the same vehicle on the same date."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Status Tracking:"})," Tracks the status of each allocation (e.g., pending, confirmed, canceled)."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Driver Assignment:"})," Each vehicle is pre-assigned to a driver."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Performance Optimized:"})," Handles a large number of concurrent users and operations."]}),"\n"]}),"\n",(0,l.jsx)(n.h2,{id:"tech-stack",children:"Tech Stack"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Backend:"})," FastAPI"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Database:"})," MongoDB (Async with Motor)"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"ORM:"})," Pydantic (For schema validation)"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Environment Management:"})," Python virtual environment"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Testing:"})," Pytest"]}),"\n"]}),"\n",(0,l.jsx)(n.h2,{id:"requirements",children:"Requirements"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.strong,{children:"Python 3.9+"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.strong,{children:"MongoDB"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.strong,{children:"FastAPI"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.strong,{children:"Pydantic"})}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Motor"})," (Async MongoDB driver)"]}),"\n"]}),"\n",(0,l.jsx)(n.h2,{id:"installation",children:"Installation"}),"\n",(0,l.jsx)(n.p,{children:"Follow these steps to set up and run the project locally."}),"\n",(0,l.jsx)(n.h3,{id:"1-clone-the-repository",children:"1. Clone the repository"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-bash",children:"git clone https://github.com/FahimFBA/vallocation\r\ncd vallocation\n"})}),"\n",(0,l.jsx)(n.h3,{id:"2-create-a-virtual-environment",children:"2. Create a virtual environment"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-bash",children:"python -m venv env\r\nsource env/bin/activate # On Windows: `env\\Scripts\\activate`\n"})}),"\n",(0,l.jsx)(n.h3,{id:"3-install-the-required-dependencies",children:"3. Install the required dependencies"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-bash",children:"pip install -r requirements.txt\n"})}),"\n",(0,l.jsx)(n.h3,{id:"4-set-up-environment-variables",children:"4. Set up environment variables"}),"\n",(0,l.jsxs)(n.p,{children:["Create a ",(0,l.jsx)(n.code,{children:".env"})," file in the root directory with the following content:"]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{children:"MONGO_USERNAME=your_username\r\nMONGO_PASSWORD=your_password\r\nMONGO_CLUSTER_URL=your_mongodb_cluster_name\n"})}),"\n",(0,l.jsx)(n.h3,{id:"5-run-the-application",children:"5. Run the application"}),"\n",(0,l.jsx)(n.p,{children:"Start the FastAPI server:"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-bash",children:"uvicorn main:app --reload\n"})}),"\n",(0,l.jsx)(n.p,{children:"or,"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-bash",children:"fastapi dev main.py\n"})}),"\n",(0,l.jsxs)(n.p,{children:["The API will now be available at ",(0,l.jsx)(n.code,{children:"http://127.0.0.1:8000"}),"."]}),"\n",(0,l.jsx)(n.h2,{id:"project-structure",children:"Project Structure"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-bash",children:"vallocation/\r\n\u2502\r\n\u251c\u2500\u2500 .github/ # Action Workflows\r\n\u251c\u2500\u2500 config/\r\n\u2502 \u2514\u2500\u2500 database.py # Database configuration for MongoDB\r\n\u2502\r\n\u251c\u2500\u2500 docs/ # Documentation (Static Site - Generated by Docusaurus)\r\n\u2502\r\n\u251c\u2500\u2500 docs-docusaurus/ # Documentation (Docusaurus)\r\n\u2502\r\n\u251c\u2500\u2500 models/\r\n\u2502 \u2514\u2500\u2500 vallocation_model.py # Pydantic model for vehicle allocations\r\n\u2502\r\n\u251c\u2500\u2500 routers/\r\n\u2502 \u2514\u2500\u2500 route.py # FastAPI routes for vehicle allocation\r\n\u2502\r\n\u251c\u2500\u2500 schemas/\r\n\u2502 \u2514\u2500\u2500 schemas.py # Pydantic schemas for request/response models\r\n\u2502\r\n\u251c\u2500\u2500 .env.example # Example environment variables file\r\n\u251c\u2500\u2500 .gitignore # Git ignore rules\r\n\u251c\u2500\u2500 LICENSE # License file for the project\r\n\u251c\u2500\u2500 main.py # Entry point of the FastAPI application\r\n\u251c\u2500\u2500 README.md # Repository README\r\n\u251c\u2500\u2500 requirements.txt # Python dependencies for the project\n"})}),"\n",(0,l.jsx)(n.h2,{id:"api-endpoints",children:"API Endpoints"}),"\n",(0,l.jsx)(n.h3,{id:"create-an-allocation",children:"Create an Allocation"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Endpoint:"})," ",(0,l.jsx)(n.code,{children:"POST /allocate"})]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Description:"})," Allocates a vehicle for a given employee on a specified date."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Request Body:"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\r\n "employee_id": 101,\r\n "vehicle_id": 456,\r\n "allocation_date": "2024-11-01"\r\n}\n'})}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Response:"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\r\n "id": "60c72b2f9b7e4e2d88d0f66b",\r\n "employee_id": 101,\r\n "vehicle_id": 456,\r\n "driver_id": 45,\r\n "allocation_date": "2024-11-01",\r\n "status": "pending"\r\n}\n'})}),"\n"]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"update-an-allocation",children:"Update an Allocation"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Endpoint:"})," ",(0,l.jsx)(n.code,{children:"PUT /allocate/{allocation_id}"})]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Description:"})," Updates an existing allocation (e.g., change date or status)."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Request Body:"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\r\n "allocation_date": "2024-11-02",\r\n "status": "confirmed"\r\n}\n'})}),"\n"]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"delete-an-allocation",children:"Delete an Allocation"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Endpoint:"})," ",(0,l.jsx)(n.code,{children:"DELETE /allocate/{allocation_id}"})]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Description:"})," Deletes an allocation before the allocation date."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Response:"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\r\n "message": "Allocation deleted successfully"\r\n}\n'})}),"\n"]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"get-allocation-history",children:"Get Allocation History"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.strong,{children:"Endpoint:"})," ",(0,l.jsx)(n.code,{children:"GET /history/"})]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.strong,{children:"Description:"})," Fetches allocation history with optional filters (e.g., by employee, vehicle, driver, or allocation date) and supports pagination."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Query Parameters:"})}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"employee_id"})," (optional): Filter allocations by employee ID."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"vehicle_id"})," (optional): Filter allocations by vehicle ID."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"driver_id"})," (optional): Filter allocations by driver ID."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"allocation_date"})," (optional): Filter allocations by allocation date (format: ",(0,l.jsx)(n.code,{children:"YYYY-MM-DD"}),")."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"skip"})," (optional, default: 0): Number of records to skip for pagination."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"limit"})," (optional, default: 10): Maximum number of records to return."]}),"\n"]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Response:"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\r\n "total": 100,\r\n "skip": 0,\r\n "limit": 10,\r\n "results": [\r\n {\r\n "id": "60c72b2f9b7e4e2d88d0f66b",\r\n "employee_id": 101,\r\n "vehicle_id": 456,\r\n "driver_id": 45,\r\n "allocation_date": "2024-11-01",\r\n "status": "pending"\r\n },\r\n {\r\n "id": "60c72b3f9b7e4e2d88d0f66c",\r\n "employee_id": 102,\r\n "vehicle_id": 457,\r\n "driver_id": 46,\r\n "allocation_date": "2024-11-02",\r\n "status": "confirmed"\r\n }\r\n ]\r\n}\n'})}),"\n"]}),"\n"]}),"\n",(0,l.jsx)(n.h4,{id:"example-request",children:"Example Request:"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{children:"GET /history/?employee_id=101&skip=0&limit=10\n"})}),"\n",(0,l.jsx)(n.h4,{id:"example-response",children:"Example Response:"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\r\n "total": 100,\r\n "skip": 0,\r\n "limit": 10,\r\n "results": [\r\n {\r\n "id": "60c72b2f9b7e4e2d88d0f66b",\r\n "employee_id": 101,\r\n "vehicle_id": 456,\r\n "driver_id": 45,\r\n "allocation_date": "2024-11-01",\r\n "status": "pending"\r\n },\r\n {\r\n "id": "60c72b3f9b7e4e2d88d0f66c",\r\n "employee_id": 101,\r\n "vehicle_id": 458,\r\n "driver_id": 47,\r\n "allocation_date": "2024-11-03",\r\n "status": "confirmed"\r\n }\r\n ]\r\n}\n'})}),"\n",(0,l.jsx)(n.h4,{id:"pagination--filters",children:"Pagination & Filters:"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:["The endpoint allows pagination by using the ",(0,l.jsx)(n.code,{children:"skip"})," and ",(0,l.jsx)(n.code,{children:"limit"})," query parameters."]}),"\n",(0,l.jsxs)(n.li,{children:["You can apply multiple filters like ",(0,l.jsx)(n.code,{children:"employee_id"}),", ",(0,l.jsx)(n.code,{children:"vehicle_id"}),", ",(0,l.jsx)(n.code,{children:"driver_id"}),", or ",(0,l.jsx)(n.code,{children:"allocation_date"})," to narrow down the results."]}),"\n"]}),"\n",(0,l.jsx)(n.h2,{id:"database-schema",children:"Database Schema"}),"\n",(0,l.jsx)(n.p,{children:"Each allocation is stored in MongoDB in the following format:"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\r\n "_id": "ObjectId(\'60c72b2f9b7e4e2d88d0f66b\')",\r\n "employee_id": 101,\r\n "vehicle_id": 456,\r\n "driver_id": 45,\r\n "allocation_date": "2024-11-01",\r\n "status": "pending"\r\n}\n'})}),"\n",(0,l.jsx)(n.h2,{id:"contributors",children:"Contributors"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Fahim"})," - Developer, Architect"]}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.strong,{children:(0,l.jsx)(n.a,{href:"https://github.com/FahimFBA/vallocation/contributors",children:"Contributors"})})}),"\n"]}),"\n",(0,l.jsxs)(n.p,{children:["Feel free to open ",(0,l.jsx)(n.a,{href:"https://github.com/FahimFBA/vallocation/issues",children:"issues"})," or submit ",(0,l.jsx)(n.a,{href:"https://github.com/FahimFBA/vallocation/pulls",children:"pull requests"})," to help improve this project!"]})]})}function h(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,l.jsx)(n,{...e,children:(0,l.jsx)(d,{...e})}):d(e)}},8895:(e,n,i)=>{i.d(n,{A:()=>l});const l=i.p+"assets/images/vallocation_banner-2616bd730802c91535b6fcffab6ff2d8.png"},8453:(e,n,i)=>{i.d(n,{R:()=>t,x:()=>a});var l=i(6540);const r={},s=l.createContext(r);function t(e){const n=l.useContext(s);return l.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:t(e.components),l.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/docs/assets/js/runtime~main.5aa29cb0.js b/docs/assets/js/runtime~main.5aa29cb0.js new file mode 100644 index 0000000..36a5394 --- /dev/null +++ b/docs/assets/js/runtime~main.5aa29cb0.js @@ -0,0 +1 @@ +(()=>{"use strict";var e,a,t,r,c,f={},o={};function d(e){var a=o[e];if(void 0!==a)return a.exports;var t=o[e]={id:e,loaded:!1,exports:{}};return f[e].call(t.exports,t,t.exports,d),t.loaded=!0,t.exports}d.m=f,d.c=o,e=[],d.O=(a,t,r,c)=>{if(!t){var f=1/0;for(i=0;i=c)&&Object.keys(d.O).every((e=>d.O[e](t[n])))?t.splice(n--,1):(o=!1,c0&&e[i-1][2]>c;i--)e[i]=e[i-1];e[i]=[t,r,c]},d.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return d.d(a,{a:a}),a},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,d.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var c=Object.create(null);d.r(c);var f={};a=a||[null,t({}),t([]),t(t)];for(var o=2&r&&e;"object"==typeof o&&!~a.indexOf(o);o=t(o))Object.getOwnPropertyNames(o).forEach((a=>f[a]=()=>e[a]));return f.default=()=>e,d.d(c,f),c},d.d=(e,a)=>{for(var t in a)d.o(a,t)&&!d.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},d.f={},d.e=e=>Promise.all(Object.keys(d.f).reduce(((a,t)=>(d.f[t](e,a),a)),[])),d.u=e=>"assets/js/"+({36:"e8e6f722",48:"a94703ab",61:"1f391b9e",98:"a7bd4aaa",134:"393be207",168:"a13f0c16",203:"c35208e4",209:"01a85c17",212:"621db11d",235:"a7456010",249:"ccc49370",279:"458b89ea",325:"59362658",328:"e273c56f",401:"17896441",403:"7b03775a",450:"91576f7f",472:"814f3328",518:"331bc03b",557:"d9f32620",602:"acf7ee9a",609:"925b3f96",634:"c4f5d8e4",637:"f4f34a3a",643:"a6aa9e1f",647:"5e95c892",694:"8717b14a",711:"9e4087bc",737:"7661071f",742:"aba21aa0",813:"6875c492",858:"36994c47",864:"d92a3c43",867:"33fc5bb8",903:"acecf23e",972:"73664a40",976:"0e384e19",979:"6f3bcb71",991:"92501bdc",997:"6f7026d7"}[e]||e)+"."+{36:"2a1c4b91",48:"46f96676",61:"dbf5a73a",98:"304ebab0",134:"1849e491",168:"7e313a03",203:"0b7c01b6",209:"d97fcaee",212:"680f510d",235:"47cad1bc",237:"02cb92cf",249:"af7d37c2",279:"17d0891d",325:"c49ce643",328:"bd26b6f3",401:"ae602934",403:"24f43e1c",450:"61e17b2b",472:"229cfd99",518:"649d0b65",557:"2bc59f1f",599:"3d5c534f",602:"8b060a7e",609:"23e99db0",634:"e45831b4",637:"adee01e7",643:"4a2795cc",647:"4bba8c03",694:"680c49a0",711:"c2e72ae7",737:"c9c74a4d",742:"eb7bf6f2",813:"475a5802",858:"5b43e344",864:"ec367c20",867:"94321b3a",903:"a6bcc559",972:"5ad32c38",973:"7003decf",976:"4e1704de",979:"f9486397",991:"83574a52",997:"f8469653"}[e]+".js",d.miniCssF=e=>{},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),r={},c="docs:",d.l=(e,a,t,f)=>{if(r[e])r[e].push(a);else{var o,n;if(void 0!==t)for(var b=document.getElementsByTagName("script"),i=0;i{o.onerror=o.onload=null,clearTimeout(s);var c=r[e];if(delete r[e],o.parentNode&&o.parentNode.removeChild(o),c&&c.forEach((e=>e(t))),a)return a(t)},s=setTimeout(u.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=u.bind(null,o.onerror),o.onload=u.bind(null,o.onload),n&&document.head.appendChild(o)}},d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.p="/vallocation/",d.gca=function(e){return e={17896441:"401",59362658:"325",e8e6f722:"36",a94703ab:"48","1f391b9e":"61",a7bd4aaa:"98","393be207":"134",a13f0c16:"168",c35208e4:"203","01a85c17":"209","621db11d":"212",a7456010:"235",ccc49370:"249","458b89ea":"279",e273c56f:"328","7b03775a":"403","91576f7f":"450","814f3328":"472","331bc03b":"518",d9f32620:"557",acf7ee9a:"602","925b3f96":"609",c4f5d8e4:"634",f4f34a3a:"637",a6aa9e1f:"643","5e95c892":"647","8717b14a":"694","9e4087bc":"711","7661071f":"737",aba21aa0:"742","6875c492":"813","36994c47":"858",d92a3c43:"864","33fc5bb8":"867",acecf23e:"903","73664a40":"972","0e384e19":"976","6f3bcb71":"979","92501bdc":"991","6f7026d7":"997"}[e]||e,d.p+d.u(e)},(()=>{var e={354:0,869:0};d.f.j=(a,t)=>{var r=d.o(e,a)?e[a]:void 0;if(0!==r)if(r)t.push(r[2]);else if(/^(354|869)$/.test(a))e[a]=0;else{var c=new Promise(((t,c)=>r=e[a]=[t,c]));t.push(r[2]=c);var f=d.p+d.u(a),o=new Error;d.l(f,(t=>{if(d.o(e,a)&&(0!==(r=e[a])&&(e[a]=void 0),r)){var c=t&&("load"===t.type?"missing":t.type),f=t&&t.target&&t.target.src;o.message="Loading chunk "+a+" failed.\n("+c+": "+f+")",o.name="ChunkLoadError",o.type=c,o.request=f,r[1](o)}}),"chunk-"+a,a)}},d.O.j=a=>0===e[a];var a=(a,t)=>{var r,c,f=t[0],o=t[1],n=t[2],b=0;if(f.some((a=>0!==e[a]))){for(r in o)d.o(o,r)&&(d.m[r]=o[r]);if(n)var i=n(d)}for(a&&a(t);b Archive | Vehicle Allocation (Vallocation) - + diff --git a/docs/blog/authors/all-sebastien-lorber-articles/index.html b/docs/blog/authors/all-sebastien-lorber-articles/index.html index efff715..201b978 100644 --- a/docs/blog/authors/all-sebastien-lorber-articles/index.html +++ b/docs/blog/authors/all-sebastien-lorber-articles/index.html @@ -5,7 +5,7 @@ Sébastien Lorber - 3 posts | Vehicle Allocation (Vallocation) - + diff --git a/docs/blog/authors/index.html b/docs/blog/authors/index.html index 139dc0b..db76f08 100644 --- a/docs/blog/authors/index.html +++ b/docs/blog/authors/index.html @@ -5,7 +5,7 @@ Authors | Vehicle Allocation (Vallocation) - + diff --git a/docs/blog/authors/yangshun/index.html b/docs/blog/authors/yangshun/index.html index 93c1e56..9f25dbf 100644 --- a/docs/blog/authors/yangshun/index.html +++ b/docs/blog/authors/yangshun/index.html @@ -5,7 +5,7 @@ Yangshun Tay - 3 posts | Vehicle Allocation (Vallocation) - + diff --git a/docs/blog/first-blog-post/index.html b/docs/blog/first-blog-post/index.html index 7d5a66a..c88d986 100644 --- a/docs/blog/first-blog-post/index.html +++ b/docs/blog/first-blog-post/index.html @@ -5,7 +5,7 @@ First Blog Post | Vehicle Allocation (Vallocation) - + diff --git a/docs/blog/index.html b/docs/blog/index.html index 198461d..552019e 100644 --- a/docs/blog/index.html +++ b/docs/blog/index.html @@ -5,7 +5,7 @@ Blog | Vehicle Allocation (Vallocation) - + diff --git a/docs/blog/long-blog-post/index.html b/docs/blog/long-blog-post/index.html index 06889b9..7d7f4d9 100644 --- a/docs/blog/long-blog-post/index.html +++ b/docs/blog/long-blog-post/index.html @@ -5,7 +5,7 @@ Long Blog Post | Vehicle Allocation (Vallocation) - + diff --git a/docs/blog/mdx-blog-post/index.html b/docs/blog/mdx-blog-post/index.html index d4fc718..f114fc1 100644 --- a/docs/blog/mdx-blog-post/index.html +++ b/docs/blog/mdx-blog-post/index.html @@ -5,7 +5,7 @@ MDX Blog Post | Vehicle Allocation (Vallocation) - + diff --git a/docs/blog/tags/docusaurus/index.html b/docs/blog/tags/docusaurus/index.html index 6f19512..6b8ab30 100644 --- a/docs/blog/tags/docusaurus/index.html +++ b/docs/blog/tags/docusaurus/index.html @@ -5,7 +5,7 @@ 4 posts tagged with "Docusaurus" | Vehicle Allocation (Vallocation) - + diff --git a/docs/blog/tags/facebook/index.html b/docs/blog/tags/facebook/index.html index 1070c70..5315547 100644 --- a/docs/blog/tags/facebook/index.html +++ b/docs/blog/tags/facebook/index.html @@ -5,7 +5,7 @@ One post tagged with "Facebook" | Vehicle Allocation (Vallocation) - + diff --git a/docs/blog/tags/hello/index.html b/docs/blog/tags/hello/index.html index 970ec73..b7e00ef 100644 --- a/docs/blog/tags/hello/index.html +++ b/docs/blog/tags/hello/index.html @@ -5,7 +5,7 @@ 2 posts tagged with "Hello" | Vehicle Allocation (Vallocation) - + diff --git a/docs/blog/tags/hola/index.html b/docs/blog/tags/hola/index.html index d15d716..f13a25c 100644 --- a/docs/blog/tags/hola/index.html +++ b/docs/blog/tags/hola/index.html @@ -5,7 +5,7 @@ One post tagged with "Hola" | Vehicle Allocation (Vallocation) - + diff --git a/docs/blog/tags/index.html b/docs/blog/tags/index.html index 0f8836e..a3c1301 100644 --- a/docs/blog/tags/index.html +++ b/docs/blog/tags/index.html @@ -5,7 +5,7 @@ Tags | Vehicle Allocation (Vallocation) - + diff --git a/docs/blog/welcome/index.html b/docs/blog/welcome/index.html index 0393db6..6bcd34f 100644 --- a/docs/blog/welcome/index.html +++ b/docs/blog/welcome/index.html @@ -5,7 +5,7 @@ Welcome | Vehicle Allocation (Vallocation) - + diff --git a/docs/docs/intro/index.html b/docs/docs/intro/index.html index dbdfbbf..01b8794 100644 --- a/docs/docs/intro/index.html +++ b/docs/docs/intro/index.html @@ -5,12 +5,13 @@ Vehicle Allocation (Vallocation) | Vehicle Allocation (Vallocation) - +

Vehicle Allocation (Vallocation)

A fast and efficient Vehicle Allocation System built using FastAPI and MongoDB, designed to allow employees to allocate vehicles for specific dates, manage allocation statuses, and handle driver assignments. The system ensures that a vehicle is not double-booked and enforces date restrictions to prevent allocation modifications after the allocation date.

+

Banner

Table of Contents

  • Overview
  • @@ -77,7 +78,7 @@

    5. Run
    fastapi dev main.py

    The API will now be available at http://127.0.0.1:8000.

    Project Structure

    -
    vallocation/

    ├── config/
    │ └── database.py # Database configuration for MongoDB

    ├── docs/ # Documentation (Docusaurus)

    ├── models/
    │ └── vallocation_model.py # Pydantic model for vehicle allocations

    ├── routers/
    │ └── route.py # FastAPI routes for vehicle allocation

    ├── schemas/
    │ └── schemas.py # Pydantic schemas for request/response models

    ├── .env.example # Example environment variables file
    ├── .gitignore # Git ignore rules
    ├── LICENSE # License file for the project
    ├── main.py # Entry point of the FastAPI application
    ├── requirements.txt # Python dependencies for the project
    +
    vallocation/

    ├── .github/ # Action Workflows
    ├── config/
    │ └── database.py # Database configuration for MongoDB

    ├── docs/ # Documentation (Static Site - Generated by Docusaurus)

    ├── docs-docusaurus/ # Documentation (Docusaurus)

    ├── models/
    │ └── vallocation_model.py # Pydantic model for vehicle allocations

    ├── routers/
    │ └── route.py # FastAPI routes for vehicle allocation

    ├── schemas/
    │ └── schemas.py # Pydantic schemas for request/response models

    ├── .env.example # Example environment variables file
    ├── .gitignore # Git ignore rules
    ├── LICENSE # License file for the project
    ├── main.py # Entry point of the FastAPI application
    ├── README.md # Repository README
    ├── requirements.txt # Python dependencies for the project

    API Endpoints

    Create an Allocation

      @@ -145,8 +146,8 @@

      Database Sch

      Contributors

      -

      Feel free to open issues or submit pull requests to help improve this project!

+

Feel free to open issues or submit pull requests to help improve this project!

\ No newline at end of file diff --git a/docs/docs/resources/index.html b/docs/docs/resources/index.html index e34b4d3..b6e5269 100644 --- a/docs/docs/resources/index.html +++ b/docs/docs/resources/index.html @@ -5,7 +5,7 @@ Resources | Vehicle Allocation (Vallocation) - + diff --git a/docs/index.html b/docs/index.html index a1b570f..aa4d632 100644 --- a/docs/index.html +++ b/docs/index.html @@ -5,7 +5,7 @@ Hello from Vehicle Allocation (Vallocation) | Vehicle Allocation (Vallocation) - + diff --git a/docs/markdown-page/index.html b/docs/markdown-page/index.html index 32399d0..c387406 100644 --- a/docs/markdown-page/index.html +++ b/docs/markdown-page/index.html @@ -5,7 +5,7 @@ Markdown page example | Vehicle Allocation (Vallocation) - +