LifeFence is a geofencing-driven faculty attendance management system, designed to automate the attendance process using real-time location data. The project utilizes a Python FastAPI backend, a Flutter frontend, and integrates with the Supabase database to provide a seamless and efficient attendance management solution.
Ensure you have the following installed on your system:
- Python 3.12+
- Poetry (for dependency management)
- Supabase account & project setup
- Supabase CLI (for managing the database)
The project is organized into three main directories:
-
lifefence-backend: The Python FastAPI backend responsible for handling the geofencing logic, user authentication, and API services. It integrates with the Supabase database for data storage and retrieval.
-
lifefence-frontend: The Flutter frontend that provides a cross-platform interface (Android, iOS, Web) for users to interact with the attendance system, view geofencing zones, and track attendance.
-
literature-review: This directory contains research materials, literature surveys, and documentation regarding geofencing technology and its applications in real-world scenarios.
- Geofencing API: Determine when a faculty member enters or exits a geofenced zone.
- Authentication: JWT-based user authentication and authorization.
- Automated Attendance Tracking: Automatically marks attendance based on the user's location within predefined geofencing zones.
- Real-time Location Tracking: Tracks the real-time location of users to ensure accurate attendance records.
- Cross-platform Support: Provides a seamless user experience across Android, iOS, and web platforms.
- Comprehensive Reports: Generates detailed attendance reports and analytics for faculty and administrators.
- Supabase Integration: Seamless integration with the Supabase database for storing user data, attendance logs, and geofencing information.
- Scalable Architecture: Built with scalability in mind to accommodate growing numbers of users and geofencing zones.
-
Clone the Repository
git clone https://github.com/your-org/lifefence-backend.git cd lifefence-backend
-
Install Dependencies Using Poetry to install required dependencies:
poetry install
-
Setup Environment Variables
Create a
.env
(make a copy of the.env.example
and add the required parameters) file in the root directory and add the following environment variables:DATABASE_URL=<your-database-url> JWT_SECRET=""<your-jwt-secret>
-
Run Database Migrations Use the Supabase CLI or direct SQL scripts to set up your database schema.
If you're using Supabase CLI:
supabase db push
-
Start the Backend Start the FastAPI development server:
poetry run uvicorn app.main:app --reload
The API will be available at
http://localhost:8000
.
Once the server is running, you can access the interactive API documentation (Swagger UI) at:
http://localhost:8000/docs
Pull the pre-built docker image
docker pull kreativethinker/lifefence-backend:latest
Deploy using:
docker run kreativethinker/lifefence-backend
To run the test suite using pytest
and pytest-asyncio
, run:
poetry run pytest
- Supabase is used for data storage. Ensure your Supabase instance has the necessary schema and tables for the application (e.g., users, attendance logs, geofenced areas).
- More details on Supabase configuration and database schema will be found in the
docs/
directory.
lifefence-backend/
├── .github/
│ └── workflows/ # Workflows and github actions
├── app/
│ ├── api/ # API routes
│ ├── models/ # Pydantic models and Tortoise ORM models
│ ├── utils/ # Business logic (geofencing, attendance tracking)
│ ├── config.py # Stores server configuration
│ └── main.py # FastAPI app entry point
├── Dockerfile # Dockerfile for deployment
├── .env.example # Example environment variables file
├── poetry.lock # Poetry lock
├── pyproject.toml # Poetry configuration
└── README.md # This file
For research and documentation purposes, refer to the materials available in the literature-review
folder. This includes:
- Literature surveys on geofencing technology
- Research papers and related articles
- Future prospects and system enhancements
We welcome contributions! Please follow these steps for making contributions:
- Fork the repository
- Create a new branch for your feature or bugfix
- Submit a pull request with a clear description of your changes
This project is licensed under the MIT License. See the LICENSE file for more details.