/smartParkingAPI

An api used to collect and handle information from smart parking sensors

Primary LanguagePython

smartParkingAPI

An api used to collect and handle information from smart parking sensors. Designed using Django and Django Rest Framework. This was designed as part of a smart parking system in part for the completion of my computer science final year project. It serves to provide information for both the Admin Interface and the Mobile Application.

Features

  • CRUD handling for all models ie ParkingLot, ParkingSession, User, Sensor & Slot
  • Information processing and aggregation used by the Admin Interface
  • Server side report generation and formatting using ReportLab
  • Response pagination
  • Token Authentication
  • Access restriction using django-cors-headers

Setting up dev

  • Clone the repository
    git clone <url>
  • Navigate into the created directory
    cd smartParkingAPI
  • Create and activate a virtual environment
    python -m venv <env> && .\<env>\Scripts\Activate
  • Install the necessary requirements
    python -m pip install -r requirements.txt
  • Run the server
    python manage.py runserver

You can now access the server on localhost:8000

Caution

Make sure to make the necessary adjustments to the django-cors-headers settings before access

Django Cors Headers

The currently allowed domains are localhost:5173 (React+Vite) and localhost:5500. To allow access to your own domain, follow the instructions listed in this repository.

Technologies Used