Skip to content

sst-product-team/attendance-backend

Repository files navigation

Attendance Backend

Frontend Mobile App

If you're looking for the mobile app that complements this backend, check out our Mobile App. It provides a user-friendly interface for managing attendance and viewing reports.

Preview

Students attendance report page

Screenshot 2024-01-16 at 12 56 03 AM

Code contribution

Setup Frontend

install node v20.15.0

install yarn v1.22.22

run below command to integrate frontend with backend

sh build_frontend.sh

frontend repository will get cloned at attendance-web-client/

Setup Backend

Using python.

Make sure that you have +python3.8 installed.

pip install -r ./requirements.txt

For sure you will get some errors after running above step fix those and then continue.

python manage.py makemigrations
python manage.py makemigrations attendance
python manage.py migrate
python manage.py loaddata ./fixtures_dev_db.json
python manage.py runserver

After loading fixtures you can use following credencials to loggin username: [email protected] password: password

Lint & Formatting

We use flake8==6.1.0 as a linter and black==23.11.0 as a code formatter

Install

pip install flake8==6.1.0 black==23.11.0

Run black

black .

Run flake8

flake8 .

To build an image.

docker build -t attendance-backend .

To run the container and listen on localhost.

docker run --network=host attendance-backend

Now you can access the server at http://localhost:8000

if anything is missed visit docker-cheetsheet

To run test file

To run all test

python manage.py test

To run a specific testfile

python manage.py test attendance.test.models.test_classattendancewithgeolocationTest