This system is a comprehensive solution for monitoring employee work time, designed for small and medium-sized businesses seeking affordable tools for managing employee hours. The main goals of the project include:
- Real-time work time monitoring for employees.
- Streamlining employee data management through the admin panel.
- Support for supervisors and employees with accessible statistics, data filtering, and editable work hours.
The project is currently under development, with the first version scheduled for completion by February 28, 2025.
- Delivering a fully functional system with three main modules:
- Admin Panel: manage employees and generate reports.
- User Panel: view work hours and statistics.
- Reader Mode: log employee entry and exit using QR codes.
- User Panel:
- Display historical data on work hours and overtime.
- Filter data by date, week, or month.
- Calculate salaries based on hours worked.
- Admin Panel:
- Add, edit, and delete employees.
- Generate work time reports.
- Manage hourly rates and oversee access areas.
- Reader Mode:
- Log entry and exit using cameras and QR codes.
- Achieve a 95% success rate in employee logins within the first month of operation.
The mobile app is available in the CLOCKEDIN-Frontend repository.
- Web Application:
- OAuth2 login.
- Record work start and end times.
- View work statistics and filter historical data.
- Backend (API):
- Store historical data and support filtering.
- OAuth2 authentication and login.
- Mechanism for tracking currently active employees.
- Mobile Application:
- OAuth2 login support.
- QR code verification feature.
- Reader Mode:
- Implement devices for logging entry and exit times.
- Leave and Absence Management: submit leave requests, sick leave, and other absences.
- Contract Authentication: digitally sign legal documents.
- Automated Payroll: generate salary transfers.
- Google Calendar Integration: synchronize events and schedules.
- Backend: Django & Python.
- Frontend: React & TypeScript.
- Mobile Application: Flutter.
- Database: MySQL.
- Authentication: OAuth2.
- Secure storage of historical data.
- Data filtering for reports and statistics.
- Real-time work session logging.
Create a .env file in the app root directory with the following content:
GOOGLE_CLIENT_ID=<google-client-id>
GOOGLE_CLIENT_SECRET=<google-client>
EMAIL_HOST_PASSWORD=<email-host-password>
python -m venv venv
source venv/bin/activatepip install -r requirements.txtpython manage.py makemigrations
python manage.py migratepython manage.py createsuperuserpython manage.py runserverdocker-compose up --buildThis guide provides steps to integrate Google OAuth2 using Google Developers Playground for development purposes.
-
Navigate to Google Developers Playground:
- Visit the Google Developers Playground.
-
Add OAuth Scopes and Authorize APIs:
- In the first step, add the following OAuth scopes (all in one line) and click "Authorize APIs":
https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile
- In the first step, add the following OAuth scopes (all in one line) and click "Authorize APIs":
-
Exchange Authorization Code for Tokens:
- In the second step, click "Exchange authorization code for tokens."
- Copy the
id_tokenfrom the response.
-
Send
id_tokento Your API Endpoint:- Send a
POSTrequest to your API endpoint (api/login/google/) with theid_tokenin the request body as JSON.{ "token": "<your_id_token_here>" }
- Send a
-
Receive and Use JWT Token:
- You will receive a JWT token in the response.
- Use this JWT token for authenticated requests by adding it to the
Authorizationheader as a Bearer token:Authorization: Bearer <your_jwt_token>
Frontend (Click "Login with Google")
⬇️
Google (User authorization, consent)
⬇️
Backend (Exchange code for token)
⬇️
Google (Return access token)
⬇️
Backend (Create user and token)
⬇️
Frontend (User logged in)
POST /auth/register/
Headers:
Content-Type: application/json
Body:
{
"email": "<email>",
"password1": "<password>",
"password2": "<password>"
}POST auth/google/
Headers:
Content-Type: application/json
Body:
{
"code": "<google-oauth-code>"
}Response:
{
"token": "<session-token>"
}GET /test/unsecured/
Headers:
Content-Type: application/json
Response:
{
"message": "This is an unsecured get endpoint!"
}GET /test/secured/
Headers:
Content-Type: application/json
Authorization: Token
Response:
{
"message": "This is a secured get endpoint!"
}