# ProU.net Instructor Central - Nuxt 3

This is the Nuxt 3 version of the ProU.net Instructor Central application. It is a work in progress.

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

## Setup

1. Clone this repository
2. Enter the instructor-central-nuxt3 directory and run `npm install`
3. Run `npm run dev` to start the development server
4. Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

## Notes
1. The site is build with Nuxt 3 based on original ProU WebDNA driven site.
2. All CSS is in the `assets` directory in two configuration files:
   a. 'assets/css/default.css' - contains CSS for general use items, buttons, forms, etc.
   b. 'assets/css/instructor.css' - the original CSS file from the WebDNA site used to style items specific to the Instructor Central site.
3. Images and files used in the site referenced in the pages are generally in the 'public' directory; this does not include the SVG images, which are incorporated into the page layout directly. 

## API Calls

Below is a list of API calls referenced in the codebase. Environment-driven base URL and headers are used extensively via Nuxt runtime config:
- Base URL: `runtimeConfig.public.ADMIN_API` (referred to as {ADMIN_API})
- Basic Auth: `runtimeConfig.public.BASIC_AUTH` (used as an Authorization header in some requests)

External API endpoints (relative to {ADMIN_API}):
1. [x] POST {ADMIN_API}/prou_api/v1/reseller_student/user/token
  - Purpose: Retrieve admin token
  - Source: composables/authGetToken.js (authGetToken), store/authStore.js (fetchAdminToken)
  - Headers: Content-Type: application/json
2. [x] GET {ADMIN_API}/prou_api/v1/profiles/user/{userUuid}
  - Purpose: Retrieve base user info by UUID
  - Source: composables/authGetToken.js (getUserBase)
  - Headers: Authorization: Basic {BASIC_AUTH}, Content-Type: application/json
3. [x] POST {ADMIN_API}/prou_api/v1/reseller_student/user/login
  - Purpose: Instructor login
  - Source: store/authStore.js (getLoginAuth)
  - Body: { username, password }
  - Headers: Content-Type: application/json, Authorization (Basic) via config
4. [x] GET {ADMIN_API}/prou_api/v1/prou_products/instructors
  - Purpose: Get list of instructors
  - Source: composables/instructorFetch.js (fetchInstructorList)
  - Headers: Content-Type: application/json, Authorization (Basic) via config
5. [x] GET {ADMIN_API}/prou_api/v1/prou_pr~~~~oducts/instructors/{instructorId}
  - Purpose: Get instructor profile/info by ID
  - Source: composables/instructorFetch.js (fetchInstructorInfo)
  - Headers: Content-Type: application/json, Authorization (Basic) via config
6. [x] POST {ADMIN_API}/{path}
  - Purpose: Generic admin fetch helper
  - Source: composables/adminFetchBase.js (adminFetchBase)
  - Headers: Content-Type: application/json, Authorization: Basic {BASIC_AUTH}

Local (Nitro) API endpoints referenced:
- GET /api/logOut
  - Purpose: Log out and clear session/cookies
  - Source: components/common/NavHeaderR.vue (logout)

Commented or planned local API references (not actively used in code):
- GET /api/loginValidate (middleware/auth2.js, pages/index.vue comments)
- POST /api/getAdminToken (composables/authGetToken.js, store/authStore.js comments)

