### Backend Setup: Install Dependencies Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/tribeX-hris-auth-api/README.md Navigate to the backend directory, install Node.js dependencies, and copy the environment example file. ```bash cd tribeX-hris-auth-api npm install .env.example → .env ``` -------------------------------- ### Install and Run Frontend Development Server Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/README.md Navigate to the frontend directory, install dependencies, and start the development server. The app will be accessible at http://localhost:3000. ```bash cd frontend/blues-clues-hris-frontend-web npm install npm run dev ``` -------------------------------- ### Frontend Setup: Install Dependencies Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/tribeX-hris-auth-api/README.md Navigate to the frontend directory and install Node.js dependencies. ```bash cd frontend/manager-dashboard npm install ``` -------------------------------- ### Install Dependencies and Run Backend Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/README.md Install backend dependencies and start the development server. The API will be accessible at `http://localhost:5000`. ```bash cd tribeX-hris-auth-api npm install npm run start:dev ``` -------------------------------- ### Mobile Environment Setup Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/README.md Copy the example environment file for mobile development. For local backend testing on a physical phone, use your machine's Wi-Fi IPv4 address instead of localhost. Restart Expo with `npx expo start -c` after changes. ```bash cd blues-clues-hris-mobile cp .env.example .env ``` -------------------------------- ### Frontend Setup: Run Development Server Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/tribeX-hris-auth-api/README.md Start the Next.js development server. The frontend will be accessible at http://localhost:3000. ```bash npm run dev ``` -------------------------------- ### Backend Setup: Run Development Server Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/tribeX-hris-auth-api/README.md Start the NestJS development server. The backend will be accessible at http://localhost:5000. ```bash npm run start:dev ``` -------------------------------- ### Install and Run Mobile Development Server Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/README.md Navigate to the mobile app directory, install dependencies, and start the Expo development server. Scan the QR code with the Expo Go app on your phone. Ensure your phone is on the same Wi-Fi network. ```bash cd blues-clues-hris-mobile npm install npx expo start -c ``` -------------------------------- ### Mobile Setup and Login Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/README.md Sets up the API base URL using Expo constants and handles user login for mobile applications, storing the access token using AsyncStorage. Ensure API_BASE_URL is configured in app.config.js or app.json. ```typescript // App.tsx (React Native/Expo) import Constants from 'expo-constants'; const API_BASE_URL = Constants.expoConfig?.extra?.API_BASE_URL; const login = async (email: string, password: string) => { const response = await fetch(`${API_BASE_URL}/applicants/login`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ email, password }) }); const { access_token } = await response.json(); await AsyncStorage.setItem('access_token', access_token); }; ``` -------------------------------- ### Localhost Development Configuration Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/configuration.md Example environment variables for local development setup. Includes backend, frontend, and mobile service URLs, database, auth, and swagger settings. ```env Backend: http://localhost:5000 Frontend: http://localhost:3000 Mobile: http://:5000 Database: Supabase project Auth: Development JWT secret Swagger: Enabled ``` -------------------------------- ### Run Mobile App After Cloning Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/blues-clues-hris-mobile/README.md Commands to install dependencies, start the Expo app with a cleared cache, and connect to the backend. ```bash cd blues-clues-hris-mobile npm install npx expo start --clear ``` -------------------------------- ### API Login Route Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/tribeX-hris-auth-api/README.md An example of a specific API route for login. ```text api/tribeX/auth/v1/login ``` -------------------------------- ### Start Expo Project with Cache Clear Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/blues-clues-hris-mobile/README.md Launches the Expo development server and clears the cache. Essential for initial setup or after significant configuration changes. ```bash npx expo start -c ``` -------------------------------- ### Get Onboarding Staging Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/endpoints.md Get onboarding checklist and staging data for the authenticated user. ```APIDOC ## GET /users/me/onboarding-staging ### Description Get onboarding checklist and staging data. ### Method GET ### Endpoint /users/me/onboarding-staging ### Response #### Success Response (200) - OnboardingStaging #### Status Codes 200, 401 ``` -------------------------------- ### Development .env File Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/configuration.md An example .env file for setting up the development environment. Includes core, Supabase, JWT, Brevo email, frontend, and logging configurations. ```env # Core PORT=5000 NODE_ENV=development ENABLE_SWAGGER=true # Supabase SUPABASE_URL=https://xvofqboilmzlhrnkyyif.supabase.co SUPABASE_SERVICE_ROLE_KEY=your-service-role-key-here SUPABASE_ANON_KEY=your-anon-key-here # JWT JWT_SECRET=your-secret-key-min-32-chars-long-here-12345 JWT_EXPIRATION=1h REFRESH_TOKEN_EXPIRATION=7d # Brevo Email BREVO_API_KEY=your-brevo-api-key-here BREVO_BASE_URL=https://api.brevo.com BREVO_SENDER_EMAIL=your-verified-email@company.com BREVO_SENDER_NAME=Blues Clues HRIS BREVO_TIMEOUT_MS=15000 # Frontend APP_URL=http://localhost:3000 ALLOWED_ORIGINS=http://localhost:3000,http://localhost:3001 # Logging LOG_LEVEL=debug ``` -------------------------------- ### Production .env File Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/configuration.md An example .env file for setting up the production environment. Includes core configurations like port, node environment, and Swagger enablement. ```env # Core PORT=5000 NODE_ENV=production ENABLE_SWAGGER=false ``` -------------------------------- ### Create Department Response Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/api-reference/users.md Example response after successfully creating a new department. Includes department details and creation timestamp. ```json { "department_id": "dept_new001", "department_name": "Sales", "company_id": "cmp_456", "created_at": "2024-06-01T10:00:00Z" } ``` -------------------------------- ### Retrieve All Departments Response Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/api-reference/users.md Example response showing a list of all departments in the company. Requires HR and above roles. ```json [ { "department_id": "dept_001", "department_name": "Human Resources", "company_id": "cmp_456" }, { "department_id": "dept_002", "department_name": "Engineering", "company_id": "cmp_456" } ] ``` -------------------------------- ### Frontend .env.local Example (Production) Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/configuration.md Production configuration for the frontend, pointing to the live backend. ```env NEXT_PUBLIC_API_BASE_URL=https://yourdomain.com/api/v1 NEXT_PUBLIC_APP_URL=https://yourdomain.com ``` -------------------------------- ### Verify Docker Installation Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/DOCKER.md Confirm that Docker and Docker Compose are installed and accessible in your environment. ```powershell docker --version docker compose version ``` -------------------------------- ### Branching Examples Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/RULES_AND_GUIDELINES.md Provides concrete examples of valid feature and fix branch names according to the project's branching rules. ```text feature/t3-142-user-profile-header feature/email-mobile-dark-mode fix/sfia-category-substring-match ``` -------------------------------- ### Create Department Request Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/api-reference/users.md Example of a request body to create a new department. Requires the department name. ```json { "department_name": "Sales" } ``` -------------------------------- ### Branch Strategy Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/tribeX-hris-auth-api/README.md Example of a feature branch name following the convention 'feature/-'. ```bash feature/t3-142-user-profile-header ``` -------------------------------- ### Upsert Work Schedule Response Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/api-reference/timekeeping.md Example JSON response after creating or updating a work schedule. ```json { "schedule_id": "sch_123", "user_id": "usr_123", "schedule_type": "FIXED", "work_days": ["MON", "TUE", "WED", "THU", "FRI"], "start_time": "09:00", "end_time": "17:00", "effective_date": "2024-06-01", "created_at": "2024-06-01T10:00:00Z" } ``` -------------------------------- ### Bulk Schedule Update Request Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/api-reference/timekeeping.md Example JSON payload for updating schedules for multiple employees. ```json { "schedules": [ { "user_id": "usr_123", "schedule_type": "FIXED", "work_days": ["MON", "TUE", "WED", "THU", "FRI"], "start_time": "09:00", "end_time": "17:00" }, { "user_id": "usr_124", "schedule_type": "FLEXIBLE", "work_days": ["MON", "TUE", "WED", "THU"], "start_time": "08:00", "end_time": "16:00" } ], "effective_date": "2024-06-15" } ``` -------------------------------- ### Leave Management API Request/Response Examples Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/MERGE_STATUS_REPORT.md Provides example JSON for fetching leave balances and submitting a new leave request. ```json // GET /leave/balances response [ { "type": "Vacation", "remaining": 10, "total": 15 }, { "type": "Sick", "remaining": 5, "total": 10 } ] // POST /leave/requests body { "leave_type": "Vacation Leave", "start_date": "2026-06-01", "end_date": "2026-06-05", "reason": "Vacation" } ``` -------------------------------- ### Backend Production Server Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/tribeX-hris-auth-api/README.md Starts the production server for the tribeX-hris-auth-api. ```bash npm run start:prod ``` -------------------------------- ### Example Conventional Commits Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/README.md Examples of commit messages following the conventional commit format used in this repository. ```bash feat: make all role dashboards accessible fix: logout flow — call logoutApi from Sidebar chore: remove .claude folder from tracking ``` -------------------------------- ### Upsert Work Schedule Request Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/api-reference/timekeeping.md Example JSON payload for creating a fixed work schedule for an employee. ```json { "user_id": "usr_123", "schedule_type": "FIXED", "work_days": ["MON", "TUE", "WED", "THU", "FRI"], "start_time": "09:00", "end_time": "17:00", "break_duration_minutes": 60, "effective_date": "2024-06-01" } ``` -------------------------------- ### Invalid Application Status Transition Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/errors.md This example shows an invalid status transition for an application. Status changes must follow predefined workflows. ```text Cannot transition from REJECTED to UNDER_REVIEW Cannot transition from HIRED to REJECTED ``` -------------------------------- ### Install Dependencies with Legacy Peer Deps Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/blues-clues-hris-mobile/README.md Use this command to install project dependencies, ensuring compatibility with older peer dependency versions. ```bash npm install --legacy-peer-deps ``` -------------------------------- ### Upload SFIA Resume Request Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/api-reference/applicants.md Example JSON payload for uploading an SFIA resume, including job posting ID and an array of SFIA skill objects with years of experience. ```json { "job_posting_id": "job_123", "sfia_skills": [ { "skill_code": "PROG", "skill_name": "Programming", "level": "4", "years_experience": 5 }, { "skill_code": "ARCH", "skill_name": "Systems Architecture", "level": "3", "years_experience": 3 } ] } ``` -------------------------------- ### Get Tenant Configuration Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/api-reference/users.md Retrieve company-level settings and configuration. ```APIDOC ## GET /tenant-config ### Description Retrieve company-level settings. ### Method GET ### Endpoint /tenant-config ### Response #### Success Response (200) - **company_id** (string) - Description - **timezone** (string) - Description - **date_format** (string) - Description - **currency** (string) - Description - **org_structure** (object) - Description #### Response Example ```json { "company_id": "cmp_456", "timezone": "UTC", "date_format": "MM/DD/YYYY", "currency": "USD", "org_structure": { "departments": true, "teams": true } } ``` ### Status Codes - **200** - Success - **401** - Unauthenticated ``` -------------------------------- ### Delete User Response Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/api-reference/users.md Example response after successfully soft-deleting a user. It confirms the deletion and provides the user's ID. ```json { "message": "User deleted successfully", "user_id": "usr_123" } ``` -------------------------------- ### Conventional Commits Examples Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/tribeX-hris-auth-api/README.md Examples of commit messages following the Conventional Commits specification for different types of changes. ```bash feat: add login history tracking fix: resolve JWT token expiration issue refactor: simplify auth middleware chore: update dependencies ``` -------------------------------- ### Set Password Request Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/api-reference/authentication.md Example JSON payload for setting or resetting a user's password. Ensure the token is valid and the password meets the minimum length requirement. ```json { "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "password": "newSecurePassword123" } ``` -------------------------------- ### Rename Department Response Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/api-reference/users.md Example response after successfully renaming a department. Returns the updated department ID and name. ```json { "department_id": "dept_001", "department_name": "Sales & Marketing" } ``` -------------------------------- ### 404 Not Found Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/errors.md Illustrates a 'Not Found' error, indicating that the requested resource does not exist or has been deleted. ```json { "statusCode": 404, "message": "Not Found", "error": "User not found" } ``` -------------------------------- ### Login Request Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/api-reference/authentication.md Provides an example of a login request payload. Use email, username, or employee ID for the identifier. The rememberMe flag can extend the refresh token's lifetime. ```json { "identifier": "afdmandrei.systemadmin", "password": "securepassword123", "rememberMe": true } ``` -------------------------------- ### Schedule Interview Response Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/api-reference/jobs.md Example response after successfully scheduling an interview. ```json { "interview_id": "int_123", "application_id": "app_123", "interview_stage": "Technical Interview", "scheduled_date": "2024-06-10T14:00:00Z", "status": "SCHEDULED", "created_at": "2024-06-05T10:00:00Z" } ``` -------------------------------- ### Starting a New Feature Branch Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/README.md Commands to start a new feature branch from the main branch. Ensure you pull the latest changes from main before branching. ```bash git checkout main git pull origin main git checkout -b feature/t3-142-user-profile-header ``` -------------------------------- ### GET /users/tenant-config Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/endpoints.md Retrieves the tenant configuration settings for the company. Requires authentication. ```APIDOC ## GET /users/tenant-config ### Description Get company settings. ### Method GET ### Endpoint /users/tenant-config ### Authentication Requires authentication (JwtAuthGuard). ### Response #### Success Response (200) - TenantConfig: The tenant configuration object. ### Status Codes - 200 OK - 401 Unauthorized ``` -------------------------------- ### Update User Profile Request Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/api-reference/users.md Example of a request body to update a user's profile information. This includes fields like first name, last name, and department ID. ```json { "first_name": "Alice", "last_name": "Johnson", "department_id": "dept_002" } ``` -------------------------------- ### Get Tenant Configuration API Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/api-reference/users.md Retrieves the company-level settings and configuration for the tenant. ```typescript GET /tenant-config ``` ```json { "company_id": "cmp_456", "timezone": "UTC", "date_format": "MM/DD/YYYY", "currency": "USD", "org_structure": { "departments": true, "teams": true } } ``` -------------------------------- ### 400 Bad Request Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/errors.md Illustrates a 'Bad Request' error, typically due to validation failures or malformed requests. This example shows a specific validation error related to password length. ```json { "statusCode": 400, "message": "Bad Request", "error": "password must be longer than or equal to 6 characters" } ``` -------------------------------- ### Set Password Response Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/api-reference/authentication.md Success response when a user's password has been updated. ```json { "message": "Password updated successfully" } ``` -------------------------------- ### Application Status Update Response Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/api-reference/jobs.md Example response after successfully updating an application's status. ```json { "application_id": "app_123", "status": "SHORTLISTED", "updated_at": "2024-06-05T10:00:00Z" } ``` -------------------------------- ### GET /users/tenant-modules Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/endpoints.md Retrieves a list of enabled HR modules for the company. Requires authentication. ```APIDOC ## GET /users/tenant-modules ### Description Get enabled HR modules for company. ### Method GET ### Endpoint /users/tenant-modules ### Authentication Requires authentication (JwtAuthGuard). ### Response #### Success Response (200) - Module[]: An array of module objects. ### Status Codes - 200 OK - 401 Unauthorized ``` -------------------------------- ### Make Authenticated Request Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/api-reference/authentication.md Example of making a GET request to a protected endpoint ('/users/me') by including the JWT access token in the Authorization header. The access token is retrieved from localStorage. ```typescript const response = await fetch('http://localhost:5000/api/v1/users/me', { method: 'GET', headers: { 'Authorization': `Bearer ${localStorage.getItem('access_token')}` } }); const user = await response.json(); console.log(user.first_name); // Andrei ``` -------------------------------- ### Frontend .env.local Example (Development - Localhost Backend) Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/configuration.md Configuration for the frontend when using a local development backend. ```env NEXT_PUBLIC_API_BASE_URL=http://localhost:5000/api/v1 NEXT_PUBLIC_APP_URL=http://localhost:3000 ``` -------------------------------- ### Run Development Server Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/frontend/blues-clues-hris-frontend-web/README.md Commands to start the development server for the Next.js project. Open http://localhost:3000 in your browser. ```bash npm run dev # or yarn dev # or pnpm dev # or bun dev ``` -------------------------------- ### Get Current User Response Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/api-reference/authentication.md Shows the user profile information returned when retrieving the current user's details via the JWT token. Includes user ID, company ID, email, username, role, and employee details. ```json { "sub_userid": "usr_123", "company_id": "cmp_456", "email": "user@example.com", "username": "afdmandrei.systemadmin", "role_id": "role_789", "role_name": "System Admin", "employee_id": "EMP001", "first_name": "Andrei", "last_name": "AFD" } ``` -------------------------------- ### Copy Backend Environment File Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/DOCKER.md Copies the example environment file to a new file for backend configuration. ```powershell Copy-Item tribeX-hris-auth-api/.env.example tribeX-hris-auth-api/.env ``` -------------------------------- ### Edit Attendance Response Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/api-reference/timekeeping.md Example JSON response after successfully editing an attendance record. ```json { "log_id": "atl_126", "user_id": "usr_123", "date": "2024-06-05", "time_in": "2024-06-05T08:30:00Z", "time_out": "2024-06-05T17:00:00Z", "hours_worked": 8.5, "edited_by": "usr_hr001", "edited_at": "2024-06-05T10:00:00Z" } ``` -------------------------------- ### Copy Frontend Environment File Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/DOCKER.md Copies the example local environment file to a new file for frontend configuration. ```powershell Copy-Item frontend/blues-clues-hris-frontend-web/.env.local.example frontend/blues-clues-hris-frontend-web/.env.local ``` -------------------------------- ### Review Absence Request Response Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/api-reference/timekeeping.md Example JSON response after reviewing an absence request. ```json { "log_id": "atl_125", "status": "APPROVED", "reviewed_by": "usr_hr001", "reviewed_at": "2024-06-05T10:00:00Z", "notes": "Medical certificate provided" } ``` -------------------------------- ### Frontend Login Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/README.md Handles user login by sending credentials to the API and storing the access token in local storage. Ensure the API base URL is correctly configured in environment variables. ```typescript // pages/login.tsx const handleLogin = async (email: string, password: string) => { const response = await fetch( `${process.env.NEXT_PUBLIC_API_BASE_URL}/login`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ identifier: email, password }), credentials: 'include' // Important: for cookies } ); const { access_token } = await response.json(); localStorage.setItem('access_token', access_token); // Redirect to dashboard }; ``` -------------------------------- ### Review Absence Request Request Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/api-reference/timekeeping.md Example JSON payload for approving an absence request with notes. ```json { "action": "APPROVE", "notes": "Medical certificate provided" } ``` -------------------------------- ### Build and Run Docker Containers Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/DOCKER.md Builds the Docker images and starts the backend and frontend services using Docker Compose. ```powershell docker compose up --build ``` -------------------------------- ### Mobile .env Example (Development - Local Backend) Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/configuration.md Configuration for the mobile app when using a local development backend. Ensure to replace the IP address with your machine's current WiFi IPv4 address. ```env EXPO_PUBLIC_API_BASE_URL=http://192.168.1.100:5000/api/v1 ``` -------------------------------- ### Frontend .env.local Example (Development - Railway Backend) Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/configuration.md Configuration for the frontend when using a backend deployed on Railway. ```env NEXT_PUBLIC_API_BASE_URL=https://blues-clues-hris-backend-frontend-mobile-production.up.railway.app/api/v1 NEXT_PUBLIC_APP_URL=http://localhost:3000 ``` -------------------------------- ### Get Onboarding Staging Data Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/endpoints.md Retrieves the onboarding checklist and staging data for the authenticated user. ```http GET /users/me/onboarding-staging ``` -------------------------------- ### Serve Frontend Production Build Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/tribeX-hris-auth-api/README.md Serves the production build for the manager-dashboard frontend. ```bash npm run start ``` -------------------------------- ### Edit Attendance Request Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/api-reference/timekeeping.md Example JSON payload for editing an employee's attendance record with new time-in and time-out values. ```json { "time_in": "2024-06-05T08:30:00Z", "time_out": "2024-06-05T17:00:00Z", "notes": "Employee was stuck in traffic, approved by manager" } ``` -------------------------------- ### Complete Applicant Registration and Login Flow Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/api-reference/applicants.md Demonstrates the full process of registering a new applicant, followed by logging them in to obtain an access token. Ensure email verification is handled separately. ```typescript // 1. Register const registerResponse = await fetch('http://localhost:5000/api/v1/applicants/register?company=cmp_123', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ first_name: 'Alice', last_name: 'Johnson', email: 'alice@example.com', password: 'password123' }) }); // 2. Check email (user verifies via link in email) // In real scenario, user clicks link with token // 3. Login const loginResponse = await fetch('http://localhost:5000/api/v1/applicants/login', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ email: 'alice@example.com', password: 'password123' }), credentials: 'include' }); const { access_token } = await loginResponse.json(); localStorage.setItem('applicant_token', access_token); ``` -------------------------------- ### Rename Department Request Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/api-reference/users.md Example of a request body to rename an existing department. Requires the department ID in the path and the new name in the body. ```json { "department_name": "Sales & Marketing" } ``` -------------------------------- ### Development Frontend URL Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/configuration.md Set the frontend URL for development environments. This is used in email links and password reset functionalities. ```env # Development APP_URL=http://localhost:3000 ``` -------------------------------- ### Update Applicant Profile Request Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/api-reference/applicants.md Example JSON payload for updating an applicant's profile, specifying fields like phone, address, and city. ```json { "phone": "+1-555-0199", "address": "123 Main St", "city": "San Francisco" } ``` -------------------------------- ### Employee Onboarding Flow Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/README.md Outlines the steps for HR to create a user, send an invitation, and for the employee to complete their onboarding process, including document uploads and profile completion. ```text 1. HR creates user: POST /users { email, first_name, last_name, role_id } 2. Invitation email sent automatically (requires BREVO_API_KEY configured) 3. Employee clicks set-password link: POST /set-password { token, password } 4. Employee logs in: POST /login { identifier, password } 5. Employee views onboarding staging: GET /users/me/onboarding-staging 6. Complete onboarding checklist items 7. Upload required documents: POST /users/me/documents { file, document_type } 8. Update emergency contacts: PATCH /users/me/emergency-contacts 9. Complete profile: PATCH /users/me { phone, address, etc. } 10. Onboarding marked complete ``` -------------------------------- ### Backend Environment Variables Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/README.md Configure the backend environment variables by creating a `.env` file. Ensure sensitive keys are not committed to version control. The `SUPABASE_SERVICE_ROLE_KEY` is server-only. `BREVO_SENDER_EMAIL` must be verified in Brevo. ```env PORT=5000 SUPABASE_URL=https://your-project.supabase.co SUPABASE_SERVICE_ROLE_KEY=your-service-role-key SUPABASE_ANON_KEY=your-anon-key JWT_SECRET=replace-with-a-long-random-secret-at-least-32-characters # Brevo (transactional email) — get API key from https://app.brevo.com/settings/keys/api BREVO_API_KEY=your-brevo-api-key BREVO_BASE_URL=https://api.brevo.com BREVO_SENDER_EMAIL=your-verified-sender@example.com BREVO_SENDER_NAME=Blues Clues HRIS BREVO_TIMEOUT_MS=15000 APP_URL=http://localhost:3000 ``` -------------------------------- ### Manual API Login Request Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/README.md Use this curl command to log in to the API. Ensure you replace '' with your actual password. ```bash POST http://localhost:5000/api/tribeX/auth/v1/login Content-Type: application/json { "identifier": "afdmandrei.systemadmin", "password": "" } ``` -------------------------------- ### Get My Documents Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/endpoints.md Retrieve the authenticated user's documents. ```APIDOC ## GET /users/me/documents ### Description Get authenticated user's documents. ### Method GET ### Endpoint /users/me/documents ### Response #### Success Response (200) - EmployeeDocument[] #### Status Codes 200, 401 ``` -------------------------------- ### Mobile .env Example (Development - Railway Backend) Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/configuration.md Configuration for the mobile app when using a backend deployed on Railway. ```env EXPO_PUBLIC_API_BASE_URL=https://blues-clues-hris-backend-frontend-mobile-production.up.railway.app/api/v1 ``` -------------------------------- ### Get Performance Reviews Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/endpoints.md Retrieve all performance reviews for a specific employee. ```APIDOC ## GET /performance/reviews/:userId ### Description Get an employee's performance reviews. ### Method GET ### Endpoint /performance/reviews/:userId ### Parameters #### Path Parameters - **userId** (string) - Required - The ID of the employee whose reviews are to be retrieved. ### Response #### Success Response (200) - **PerformanceReview[]** (array) - An array of performance reviews. #### Error Responses - 401: Unauthorized ``` -------------------------------- ### OnboardingStaging and ChecklistItem Interfaces Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/types.md Defines the structure for employee onboarding staging data and individual checklist items. ```typescript interface OnboardingStaging { user_id: string; first_name: string; last_name: string; email: string; employee_id?: string; department: string; position: string; manager_id?: string; manager_name?: string; start_date: string; status: 'PENDING' | 'IN_PROGRESS' | 'COMPLETED'; checklist_items?: ChecklistItem[]; } interface ChecklistItem { item_id: string; description: string; assigned_to?: string; // User ID responsible due_date?: string; completed?: boolean; completed_at?: string; } ``` -------------------------------- ### Get Performance Reviews Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/endpoints.md Retrieve all performance reviews for a specific employee. ```HTTP GET /performance/reviews/:userId ``` -------------------------------- ### Get Employee Schedule Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/endpoints.md Retrieve the work schedule for a specific employee. ```HTTP GET /timekeeping/schedules/:userId ``` -------------------------------- ### Upload Resume and SFIA Skills for Applicant Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/api-reference/applicants.md Shows how to upload a resume file and map SFIA skills for an applicant using their JWT. Requires a valid applicant token for authorization. ```typescript // 1. Upload resume file const formData = new FormData(); formData.append('file', resumeFile); // File from input const resumeResponse = await fetch('http://localhost:5000/api/v1/applicants/me/resume', { method: 'POST', headers: { 'Authorization': `Bearer ${localStorage.getItem('applicant_token')}` }, body: formData }); // 2. Upload SFIA resume mapping const sfiaResponse = await fetch('http://localhost:5000/api/v1/applicants/sfia-upload', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${localStorage.getItem('applicant_token')}` }, body: JSON.stringify({ job_posting_id: 'job_123', sfia_skills: [ { skill_code: 'PROG', skill_name: 'Programming', level: '4' } ] }) }); ``` -------------------------------- ### Get My Attendance Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/api-reference/timekeeping.md Retrieves the attendance history for the currently authenticated user. ```APIDOC ## GET /me ### Description Get authenticated user's attendance history. ### Method GET ### Endpoint /me ### Parameters #### Query Parameters - **from** (string) - Required/Optional - Start date (YYYY-MM-DD) - **to** (string) - Required/Optional - End date (YYYY-MM-DD) - **limit** (number) - Required/Optional - Max records to return ### Response #### Success Response (200) - Same as `/attendance/:userId` #### Response Example ```json [ { "log_id": "atl_126", "date": "2024-06-05", "time_in": "2024-06-05T08:30:00Z", "time_out": "2024-06-05T17:00:00Z", "hours_worked": 8.5, "status": "PRESENT" }, { "log_id": "atl_127", "date": "2024-06-06", "reason": "SICK_LEAVE", "status": "APPROVED", "event_type": "ABSENCE" } ] ``` ### Status Codes #### Success Response (200) - **Success** #### Error Response - **401** - Unauthenticated ``` -------------------------------- ### Get My Documents Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/api-reference/users.md Retrieve a list of all documents uploaded by the authenticated user. ```APIDOC ## GET /me/documents ### Description Retrieve authenticated user's uploaded documents. ### Method GET ### Endpoint /me/documents ### Response #### Success Response (200) - **document_id** (string) - Description - **document_type** (string) - Description - **file_name** (string) - Description - **file_url** (string) - Description - **status** (string) - Description - **approved_at** (string) - Description - **uploaded_at** (string) - Description #### Response Example ```json [ { "document_id": "doc_123", "document_type": "RESUME", "file_name": "resume.pdf", "file_url": "https://storage.example.com/...", "status": "APPROVED", "approved_at": "2024-06-01T11:00:00Z", "uploaded_at": "2024-06-01T10:00:00Z" } ] ``` ### Status Codes - **200** - Success - **401** - Unauthenticated ``` -------------------------------- ### Production Frontend URL Example Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/configuration.md Set the frontend URL for production environments. This is used in email links and password reset functionalities. ```env # Production APP_URL=https://yourdomain.com ``` -------------------------------- ### Get My Leave Requests Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/endpoints.md Retrieve all leave requests submitted by the authenticated user. ```APIDOC ## GET /leave/me/requests ### Description Get the authenticated user's leave requests. ### Method GET ### Endpoint /leave/me/requests ### Response #### Success Response (200) - **LeaveRequest[]** (array) - An array of leave requests. #### Error Responses - 401: Unauthorized ``` -------------------------------- ### Get My Leave Requests Source: https://github.com/dreiiiiim/blues-clues-hris-backend-frontend-mobile/blob/main/_autodocs/endpoints.md Retrieve all leave requests submitted by the authenticated user. ```HTTP GET /leave/me/requests ```