The OSL Digital Logbook is a project developed to enable users to log their entries using a digital logbook. It is designed specifically for Open Source Lab (OSL) and can improvised to use for any entry system with minor changes in the code. The logbook allows users to scan a QR code and log their entry into the lab. Before logging in, users must first register using a domain-specific email and verify their registration using OTP. The project is built using Node.js and MongoDB
- QR code scanning for logging entries, providing a quick and efficient process.
- Domain-specific email registration and OTP verification for user authentication.
- Geolocation support
To install and use the OSL Digital Logbook, please follow these instructions:
Make sure node
and mongodb
are installed on your system.
- Clone the repository using the following command:
git clone https://github.com/Asymmentric/oslLogBook.git
- Install the required dependencies using the following command:
cd oslLogBook
npm install
- Create a file named
.env
and copy the following contents:
DB_LINK='<mongodb connection URL>'
DB_NAME='<database name>'
DB_LINK_DEV='<mongodb connection URL for dev env>'
DB_NAME_DEV='<database name>'
JWT_SECRET_TOKEN='<Secret JWT Token>'
SESSION_SECRET='<Your session secret>'
ACCOUNT_USER='<email to send OTP>'
ACCOUNT_PASSWORD='<email password>'
ACCOUNT_EMAIL_HOST='<email host smtp string>'
ACCOUNT_EMAIL_PORT='<email host port>'
ACCOUNT_EMAIL_SERVICE='<email service name>'
ACCOUNT_EMAIL_SEC_TYPE='<true or false>'
- Modify the Regular Expressions as per the requirements:
oslLogBook/server/util/pwdFunc.js
Line 25 in 7cf0e12
// replace the above line with this code snippet to accept all emails
const emailOK=(/^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+$/).test((email).toLowerCase())
oslLogBook/server/util/pwdFunc.js
Line 26 in 7cf0e12
// replace both lines `26` and `40` with this code snippet to accept all kind of USN/ Unique IDs
const usnOK=(/.*/ig).test(usn)
oslLogBook/server/util/pwdFunc.js
Line 39 in 7cf0e12
// replace both lines `25` and `39` with this code snippet to accept all emails
const emailOK=(/^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+$/).test((userId).toLowerCase())
oslLogBook/server/util/pwdFunc.js
Line 40 in 7cf0e12
// replace both lines `26` and `40` with this code snippet to accept all kind of USN/ Unique IDs
const usnOK=(/.*/ig).test(userId)
- Start the server using the following command:
npm start
- Navigate to
http://localhost:9090/oslLog/api/v1/scan/entry
in your web browser to use the logbook.
Contributions to the OSL Digital Logbook are always welcome! If you'd like to contribute, please follow these guidelines:
- Submit an issue or feature request before submitting a pull request.
- Have a look at good first issues
- Fork the repository and make your changes on a new branch.
- Submit a pull request with a detailed description of your changes.