A REST API for unlock project.
- Configured MongoDB Server (can use MongoDB Atlas Cloud)
-
Set
NODE_ENVtodevelopmentorproduction(default isproduction)export NODE_ENV="production | development"
-
Set
MONGODB_CONNECTIONexport MONGODB_CONNECTION="<connection_url>"
(
<connection_url>can be grabbed from MongoDB server)
npm startnpm run dev-
Prepare CSV file (as per the format given below)
id, school, program, branch, year, semester, name, consent_status
NOTE:
idcolumn should not contain any duplicates and column name should be exactly same as mentioned. -
Store the CSV file at
/data/students.csv(name should be the same) -
Run the
developmentserver (Steps are mentioned above) -
make a API call
POST /v1/students/importWARNING: Data will be overwritten if already exists!
-
Make sure student data is available in database (you can do so by a simple
GETrequest)GET /v1/students -
Make API call
POST /v1/generateQRCodesThis will generate and store all QR codes at
/qrcodes/<school>/<student_id>.pnge.g. For a student with an ID of
17103487who is enrolled inSETschool, the QR code will be stored at/qrcodes/SET/17103487.png.
-
Make sure student data is available in database (you can do so by a simple
GETrequest)GET /v1/students/:id -
Make API call
POST /v1/generateQRCodes/:idWARNING: This will over-ride the existing QRCodes!
- Feat: Generate QRCode from CSV file
- Add authentication to the API calls.
- Email Integration - QR Code should be sent by email directly (Also give option for HTML template).
- Make API reference