settings
folder contains settings configuration split into 3 files:base.py
for common settingsdevelopment.py
for devproduction.py
for prod
rest_framework
- to create Rest APIdjoser
&rest_framework_simplejwt
- to provide authentication. You might find its configuration in settings file.
ReactJS
- for building frontend conponentsaxios
- for making internal requestsredux
- for dispatching responses into fe storagebabel
- for compiling frontend parts
-
api/bookings/
- to interract with bookings by api methods:get
put
post
delete
. Optional postfix /int:pk -
api/parcing_space/
- to interract with parking spaces by api methods:get
post
delete
. Optional postfix /int:pk -
/
- to interract with frontend views
Contains all the backend parts.
Views are stored in file named api.py
Custom data validation functions stored in
services
directory. Because additional requireents were not specified, basic booking algorythm is performed. So in order to check wether the parking space is available, system simply serializes data from booking records and builds ann array with available time intervals. The better algoryth may be implemented, such as storing slots in reddis and building bool vectors for each day f.e.
Serializer validation also performed. User cant make booking for the past, either book time back forward
Contains all the frontend parts.
src
- main frontend directory containing:actions
- for api requests functions(bookings
) and storing const wariables(types
)redusers
- for dispatching requestscomponents
- for React components
Permissions are hardcoded in
src/actions/types.js
. In order to ensure scaleability there might be a need to create custom permissions model and an endpoint to access permissions dynamicaly.