# Nuxt 3 Minimal Starter

Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.

## Setup

Make sure to install the dependencies:

```bash
# npm
npm install
```

## Development Server
Start the development server on `http://localhost:3000`:

```bash
# npm
npm run dev
```

## Production

Build the application for production:
```bash
# npm
npm run build
```

Locally preview production build:
```bash
# npm
npm run preview
```

Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.

## API Calls

Below is a consolidated list of API calls used in this project. Variables in braces are environment-configured base URLs from `useRuntimeConfig()`.

- Base variables
  - ADMIN_API: external admin API base URL
  - RAPI_BASE: external roster API base URL

Internal Nuxt server routes (under `/server/api`)
- GET /api/auth/getToken
  - Returns admin token
  - Used in: server/api/students/getStudentInfo.js, server/api/students/getStudentClasses.js, server/api/students/updateStudent.js
- GET /api/reseller/fetchResellerInfo?schoolId={schoolId}
  - Proxy to reseller profile
  - Used in: store/resellerStore.js
- GET /api/students/getStudentInfo?studentPin={studentPin}
  - Proxy to student info
  - Used in: store/studentStore.js
- GET /api/students/getStudentClasses?studentPid={studentPid}
  - Proxy to transcript/classes
- PUT /api/students/updateStudent
  - Updates student profile (body payload)
- POST /api/auth/drupalLogin?credentials=...
  - Drupal login proxy
- GET /api/courses/courseStatusFetch?courseId={courseId}&studentId={studentId}
  - Course roster status
- GET /api/courses/coursesTest?courseId={courseId}&studentId={studentId}
  - Test route for course roster status

External ADMIN_API endpoints
- POST {ADMIN_API}/prou_api/v1/reseller_student/user/token
  - Get admin token
  - Used in: composables/authGetToken.js, server/api/auth/getToken.js
- POST {ADMIN_API}/prou_api/v1/reseller_student/user/login
  - Login endpoint
  - Used in: composables/drupalLogin.js, server/api/auth/drupalLogin.js
- GET {ADMIN_API}/prou_api/v1/schools/reseller_profile/{schoolId}
  - Reseller profile
  - Used in: server/api/reseller/fetchResellerInfo.js, composables/resellerFetch.js (fetchResellerInfo)
- GET {ADMIN_API}/prou_api/v1/courses/courseProdSchool?resellerId={resellerId}
  - Courses offered by reseller
  - Used in: composables/resellerFetch.js (getResellerCourses)
- GET {ADMIN_API}/prou_api/v1/schools/schools
  - Reseller list
  - Used in: composables/resellerFetch.js (fetchResellerList)
- GET {ADMIN_API}/prou_api/v1/reseller_student/students/{schoolId}
  - Students for reseller
  - Used in: composables/studentFetch.js (fetchResellerStudents)
- GET {ADMIN_API}/prou_api/v1/reseller_student/student/{studentPin}
  - Single student details
  - Used in: composables/studentFetch.js (fetchResellerStudentInfo), server/api/students/getStudentInfo.js
- POST {ADMIN_API}/prou_api/v1/reseller_student/students/{schoolId}
  - Add new student
  - Used in: composables/studentFetch.js (addNewStudent)
- PUT {ADMIN_API}/prou_api/v1/reseller_student/students/{studentPid}
  - Update student
  - Used in: composables/studentFetch.js (updateStudent)
- GET {ADMIN_API}/prou_api/v1/reseller_student/transcript/{studentPid}
  - Student transcript
  - Used in: server/api/students/getStudentClasses.js
- GET {ADMIN_API}/prou_api/v1/prou_orders/order_details?reseller_name={schoolId}
  - Orders by reseller
  - Used in: composables/orderFetch.js (fetchResellerOrders)
- GET {ADMIN_API}/prou_api/v1/prou_orders/order_details?student_pin={studentPin}
  - Orders by student
  - Used in: composables/orderFetch.js (fetchStudentOrders)
- GET {ADMIN_API}/prou_api/v1/prou_orders/order_details/{orderNum}
  - Single order details
  - Used in: composables/orderFetch.js (fetchSingleOrder)
- POST {ADMIN_API}/prou_api/v1/prou_orders/order_details
  - Create new order
  - Used in: composables/orderFetch.js (createNewOrder)
- PUT {ADMIN_API}/prou_api/v1/prou_orders/order_details/{orderId}
  - Update order
  - Used in: composables/orderFetch.js (updateOrder)

External RAPI_BASE endpoints
- GET {RAPI_BASE}/api/roster/{courseId}/{studentId}
  - Course roster status lookup
  - Used in: server/api/courses/courseStatusFetch.js, server/api/courses/coursesTest.js, composables/courseStatusFetch.js
