SIRA AUTH is a Node.js application that provides authentication and student information retrieval for the SIRA system of the University of Valle. It uses Express.js for handling HTTP requests and Axios for communicating with external services.
Important
This project is a work in progress. Some features may not be fully implemented yet.
- User authentication
- Student information retrieval
- Teacher information retrieval (in progress)
- Clone the repository:
git clone https://github.com/code3743/sira-auth.git- Navigate to the project directory:
cd sira-auth- Install dependencies:
npm install- Compile the TypeScript code:
npx tsc- Start the server:
node dist/app.js- The server will be running at:
http://localhost:3000
POST /auth/login – Authenticate a user with their credentials.
curl -X POST http://localhost:3000/api/auth \
-H "Content-Type: application/json" \
-d '{"user": "your_user", "password": "your_password"}'Response:
{
"token": "your_token_here",
"isStudent": true // or false if the user is a teacher
}GET /student/info – Returns student information. Requires authentication via token.
curl -X GET http://localhost:3000/api/student/info \
-H "Authorization: Bearer your_token"Response:
{
"program" : "CODE PROGRAM",
"name" : "STUDENT NAME",
"code" : "STUDENT CODE",
"email" : "STUDENT EMAIL",
"document" : "STUDENT DOCUMENT"
}GET /student/preview/:code – Returns student information preview by code. Does not require authentication.
curl -X GET http://localhost:3000/api/student/preview/STUDENT_CODEResponse:
{
"program" : "CODE PROGRAM",
"name" : "STUDENT NAME",
"code" : "STUDENT CODE",
"email" : null,
"document" : null
}GET /teacher/info – Returns teacher information. Requires authentication via token.
curl -X GET http://localhost:3000/api/teacher/info \
-H "Authorization: Bearer your_token"