fras is a Face Recognition based Attendance System. It is a simple web application built using Python flask and VueJS. The face recognition task is accomplished using face_recognition.
- git client should be installed on your machine.
- The backend code is written using Python 3.6 or higher
- SQLite is used for database. You can use other RDBMS if you like.
- NodeJS stable LTS version. (Can be installed by following these steps: https://nodejs.org/en/download/). We use node for setting up VueJS client app (https://cli.vuejs.org/guide/installation.html).
- We use Visual Studio Code for developing and debugging code. Install Microsoft's Python and VueJS Vetur extensions.
-
Create a python virtual environment for this project. See this for how to do it: https://docs.python.org/3/library/venv.html. E.g., you can run the following:
python3 -m venv ~/.pyenv/FRAS
to create the virtual environment in~/.pyenv/FRAS
folder. -
Open a shell and
cd
into a directory that you want to work in. -
Clone this git repository:
git clone https://github.com/bsodhi/fras.git
. -
Run
cd fras
and thensource ~/.pyenv/FRAS/bin/activate
to activate the python virtual environment. -
ONLY if you are using MySQL: On Ubuntu, you will do
sudo apt-get install libmysqlclient-dev
to install MySQL client development library. It will be needed when we install the python connector via pip in following steps. -
Run
pip install -r api_service/requirements.txt
.NOTE: Some modules may fail to install due to unavailability of certain native libraries or headers on your OS. You can Google the error text to find a solution.
-
Install necessary dependencies for VueJS app:
cd client_app
npm install
After setting up the workspace as per the steps listed above you can deploy and run the application. Following are the steps:
cd fras/client_app
- Compile the VueJS app:
npm run build
- Start the MySQL server (ONLY if you are using MySQL instead of SQLite). You may also have to set proper values for the database connection information, and other settings if using other than SQLite.
cd fras/api_service
source ~/.pyenv/FRAS/bin/activate
to activate the python virtual environment.- Run
python
to start a python session, and issue the following commands to setup the database:from models import *
setup_demo_db()
- Ctrl-D to exit the python session.
- Run
python fras_app.py
to start the web application. - Open
http://localhost:4567/fras/app/index.html
- Login using ID
admin
and passwordadmin
(Or whatever you set via thesetup_demo_db()
)