diff --git a/deployment/ansible.yml b/deployment/ansible.yml index baac60b..f5fb07d 100644 --- a/deployment/ansible.yml +++ b/deployment/ansible.yml @@ -41,7 +41,7 @@ update: yes version: "{{ gitBranch }}" - name: Update npm - shell: cd {{release_path}}/src && npm i + shell: cd {{release_path}}/src && npm i && npm i redoc-cli - name: Delete Old Folder & create folder shell: rm -rf {{ current_path }} && cd {{ project_path }} && mkdir interface @@ -64,6 +64,11 @@ - name: move gcp credentials shell: mv {{ project_path }}/gcp.json {{ current_path }}/src/ + - name: generate api-doc + shell: cd {{current_path}}/src && redoc-cli build -o ./api-doc/index.html ./api-doc/api-doc.yaml + register: apiDocResponse + - debug: msg=" Api-doc {{ apiDocResponse }} " + - name: Delete release folder shell: rm -rf {{ release_path }} diff --git a/src/.env b/src/.env index ce461f7..beae68f 100644 --- a/src/.env +++ b/src/.env @@ -6,3 +6,4 @@ USER_SERVICE_BASE_URL='http://user:3001' MENTORING_SERVICE_BASE_URL='http://mentoring:3000' NOTIFICATION_SERVICE_BASE_URL='http://notification:3001' SCHEDULER_SERVICE_BASE_URL='http://scheduler:3001' +API_DOC_URL='/interface/api-doc' diff --git a/src/api-doc/api-doc.yaml b/src/api-doc/api-doc.yaml new file mode 100644 index 0000000..ede9e70 --- /dev/null +++ b/src/api-doc/api-doc.yaml @@ -0,0 +1,226 @@ +openapi: 3.0.0 +info: + title: Interface Service APIs + version: 1.0.0 +servers: + - url: https://localhost:3567 +tags: + - name: Orchestration + description: Orchestration APIs of Interface Service +paths: + /interface/v1/account/create: + post: + summary: Create User Account + tags: + - Orchestration + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + example: 'user' + email: + type: string + format: email + example: 'user@shikshalokam.org' + password: + type: string + example: 'passwordofuser' + otp: + type: string + example: '672854' + has_accepted_terms_and_conditions: + type: boolean + example: true + required: + - name + - email + - password + - otp + - has_accepted_terms_and_conditions + responses: + '200': + description: User Account Created Successfully + content: + application/json: + example: + access_token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' + refresh_token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' + user: + id: 8 + email: user@shikshalokam.org + email_verified: 'false' + name: user + status: ACTIVE + has_accepted_terms_and_conditions: true + preferred_language: + value: english + label: English + organization_id: 1 + roles: + - 2 + user_created_at: '2023-09-20T11:59:37.871Z' + user_updated_at: '2023-09-20T11:59:37.871Z' + user_roles: + - id: 2 + title: mentor + user_type: 0 + status: ACTIVE + profile_updated_at: '2023-09-20T12:00:46.533Z' + profile_created_at: '2023-09-20T12:00:46.533Z' + /interface/v1/account/update: + post: + summary: Update User Profile + tags: + - Orchestration + parameters: + - name: X-auth-token + in: header + description: Bearer JWT token for authentication + required: true + schema: + type: string + format: JWT + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + example: 'ShikshaLokam User' + location: + type: array + items: + type: string + example: + - 'AP' + - 'KL' + about: + type: string + example: 'This is test about of mentee' + gender: + type: string + example: 'male' + image: + type: string + example: 'https://cloudstorage.com/container/abc.png' + languages: + type: array + items: + type: string + example: + - 'english' + - 'hindi' + designation: + type: string + example: 'Lead Mentor' + area_of_expertise: + type: array + items: + type: string + example: + - 'technology' + - 'leadership' + education_qualification: + type: array + items: + type: string + example: + - 'MBA' + - 'B.Tech' + age: + type: integer + example: 35 + experience: + type: string + example: '10 years' + tags: + type: array + items: + type: string + example: + - 'Experienced' + - 'Technical' + configs: + type: object + properties: + notification: + type: boolean + example: true + visibility: + type: string + enum: + - public + - private + example: 'public' + required: + - name + responses: + '200': + description: User Profile Updated Successfully + content: + application/json: + example: + id: '8' + name: ShikshaLokam User + location: + - value: AP + label: Andhra Pradesh + - value: KL + label: Kerala + about: This is test about of mentee + has_accepted_terms_and_conditions: true + gender: + value: male + label: Male + image: 'https://cloudstorage.com/container/abc.png' + languages: + - value: english + label: English + user_created_at: '2023-09-20T11:59:37.871Z' + user_updated_at: '2023-09-20T11:59:37.871Z' + designation: Lead Mentor + area_of_expertise: + - value: technology + label: Technology + - value: leadership + label: Leadership + education_qualification: + - value: mba + label: MBA + - value: btech + label: B.Tech + rating: + average: 5 + count: 20 + age: 35 + experience: 10 years + stats: + sessions_attended: 50 + students_mentored: 30 + tags: + - experienced + - technical + configs: + notification: true + visibility: public + visibility: visible + organisation_ids: + - 1 + - 2 + external_session_visibility: limited + external_mentor_visibility: hidden + profile_created_at: '2023-09-20T12:00:46.533Z' + profile_updated_at: '2023-09-20T12:17:12.316Z' + +components: + securitySchemes: + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT diff --git a/src/api-doc/index.html b/src/api-doc/index.html new file mode 100644 index 0000000..7064cb3 --- /dev/null +++ b/src/api-doc/index.html @@ -0,0 +1,2182 @@ + + + +
+ +Download OpenAPI specification:Download
| name required | string |
| email required | string <email> |
| password required | string |
| otp required | string |
| has_accepted_terms_and_conditions required | boolean |
{- "name": "user",
- "email": "user@shikshalokam.org",
- "password": "passwordofuser",
- "otp": "672854",
- "has_accepted_terms_and_conditions": true
}{- "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
- "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
- "user": {
- "id": 8,
- "email": "user@shikshalokam.org",
- "email_verified": "false",
- "name": "user",
- "status": "ACTIVE",
- "has_accepted_terms_and_conditions": true,
- "preferred_language": {
- "value": "english",
- "label": "English"
}, - "organization_id": 1,
- "roles": [
- 2
], - "user_created_at": "2023-09-20T11:59:37.871Z",
- "user_updated_at": "2023-09-20T11:59:37.871Z",
- "user_roles": [
- {
- "id": 2,
- "title": "mentor",
- "user_type": 0,
- "status": "ACTIVE"
}
], - "profile_updated_at": "2023-09-20T12:00:46.533Z",
- "profile_created_at": "2023-09-20T12:00:46.533Z"
}
}| X-auth-token required | string <JWT> Bearer JWT token for authentication + |
| name required | string |
| location | Array of strings |
| about | string |
| gender | string |
| image | string |
| languages | Array of strings |
| designation | string |
| area_of_expertise | Array of strings |
| education_qualification | Array of strings |
| age | integer |
| experience | string |
| tags | Array of strings |
object |
{- "name": "ShikshaLokam User",
- "location": [
- "AP",
- "KL"
], - "about": "This is test about of mentee",
- "gender": "male",
- "languages": [
- "english",
- "hindi"
], - "designation": "Lead Mentor",
- "area_of_expertise": [
- "technology",
- "leadership"
], - "education_qualification": [
- "MBA",
- "B.Tech"
], - "age": 35,
- "experience": "10 years",
- "tags": [
- "Experienced",
- "Technical"
], - "configs": {
- "notification": true,
- "visibility": "public"
}
}{- "id": "8",
- "name": "ShikshaLokam User",
- "location": [
- {
- "value": "AP",
- "label": "Andhra Pradesh"
}, - {
- "value": "KL",
- "label": "Kerala"
}
], - "about": "This is test about of mentee",
- "has_accepted_terms_and_conditions": true,
- "gender": {
- "value": "male",
- "label": "Male"
}, - "languages": [
- {
- "value": "english",
- "label": "English"
}
], - "user_created_at": "2023-09-20T11:59:37.871Z",
- "user_updated_at": "2023-09-20T11:59:37.871Z",
- "designation": "Lead Mentor",
- "area_of_expertise": [
- {
- "value": "technology",
- "label": "Technology"
}, - {
- "value": "leadership",
- "label": "Leadership"
}
], - "education_qualification": [
- {
- "value": "mba",
- "label": "MBA"
}, - {
- "value": "btech",
- "label": "B.Tech"
}
], - "rating": {
- "average": 5,
- "count": 20
}, - "age": 35,
- "experience": "10 years",
- "stats": {
- "sessions_attended": 50,
- "students_mentored": 30
}, - "tags": [
- "experienced",
- "technical"
], - "configs": {
- "notification": true,
- "visibility": "public"
}, - "visibility": "visible",
- "organisation_ids": [
- 1,
- 2
], - "external_session_visibility": "limited",
- "external_mentor_visibility": "hidden",
- "profile_created_at": "2023-09-20T12:00:46.533Z",
- "profile_updated_at": "2023-09-20T12:17:12.316Z"
}