My Wiki!
**You've loaded an old revision of the document!** If you save it, you will create a new version with this data.
Media Files
# Local dev environment # Front-end ## .env file ``` #export API_HOST=https://api.dev.x-hr.ai --> use dev stack backend export API_HOST=http://localhost:8080 --> use local backend (devlocal repo, identitiy-management-service?? as proxy) ``` ## AI agent platform-frontend-app/src/shared/services/sse/SseServiceImpl.ts:54-56 ``` //const baseUrl = this.getBaseUrl() const baseUrl = "http://localhost:8080" --> Agent-service backend const url = `${baseUrl}${path} ``` # identitiy-management-service ## Database Setup I've successfully inserted the dummy user into the local database. Here's what was done: 1. **Created a demo company**: - ID: `e388a122-4a87-498f-925e-520bbf200ce3` - Name: "Demo Company" - Domain: "demo.com" 2. **Created the demo user**: - ID: `df109bb1-e781-4b45-b4e8-f7731aec674f` - Full Name: "Demo User" - Email: `demo@demo.com` - Password: `DemoDemo` (bcrypt hashed) - Status: `ACTIVE` - Group Type: `EMPLOYEE` - Email Verified: `true` - No password change required ## Login Credentials You can now login to the application using: - **Email**: `demo@demo.com` - **Password**: `DemoDemo` ## Database Connection Details - **Host**: localhost:5432 - **Database**: authdb - **Username**: admin - **Password**: secret The user is active and ready for testing the login functionality. The password has been properly hashed using bcrypt for security. ### Scripts: ``` #!/bin/bash # Database setup script for demo user # Usage: ./setup-demo-db.sh DB_HOST="localhost" DB_PORT="5432" DB_NAME="authdb" DB_USER="admin" DB_PASSWORD="secret" # Generate UUIDs COMPANY_UUID=$(python3 -c "import uuid; print(str(uuid.uuid4()))") USER_UUID=$(python3 -c "import uuid; print(str(uuid.uuid4()))") # Hash the password HASHED_PASSWORD=$(python3 -c "import bcrypt; print(bcrypt.hashpw(b'DemoDemo', bcrypt.gensalt()).decode('utf-8'))") echo "Generated Company UUID: $COMPANY_UUID" echo "Generated User UUID: $USER_UUID" echo "Hashed Password: $HASHED_PASSWORD" # Insert company echo "Inserting demo company..." PGPASSWORD=$DB_PASSWORD psql -h $DB_HOST -p $DB_PORT -U $DB_USER -d $DB_NAME -c " INSERT INTO \"public\".\"companies\" (\"id_company\", \"name\", \"domain_name\", \"supported_login_methods\", \"self_signup_allowed\", \"created_at\", \"updated_at\", \"employee_id_generation_config\", \"logo\") VALUES ('$COMPANY_UUID', 'Demo Company', 'demo.com', '{}', true, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'SYSTEM_GENERATION', NULL); " if [ $? -eq 0 ]; then echo "Company inserted successfully." else echo "Failed to insert company." exit 1 fi # Insert user echo "Inserting demo user..." PGPASSWORD=$DB_PASSWORD psql -h $DB_HOST -p $DB_PORT -U $DB_USER -d $DB_NAME -c " INSERT INTO \"public\".\"users\" (\"id_user\", \"full_name\", \"email\", \"status\", \"fk_company\", \"source\", \"password\", \"requires_password_change\", \"last_password_change_at\", \"email_verification_required\", \"email_verified\", \"created_at\", \"updated_at\", \"fk_employee\", \"group_type\", \"avatar\", \"onboarding_authorization_completed\") VALUES ('$USER_UUID', 'Demo User', 'demo@demo.com', 'ACTIVE', '$COMPANY_UUID', 'LOCAL', '$HASHED_PASSWORD', false, NULL, false, false, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, 'EMPLOYEE', NULL, false); " if [ $? -eq 0 ]; then echo "User inserted successfully." echo "Demo login credentials:" echo "Email: demo@demo.com" echo "Password: DemoDemo" else echo "Failed to insert user." exit 1 fi echo "Demo database setup completed!" ```
Save
Preview
Cancel
Edit summary
Note: By editing this page you agree to license your content under the following license:
Trace:
•
subversion
•
python_package_manager
•
0_meetings
Article
Discussion
Edit this page
Old revisions
Log In
Navigation
ai_eng
cloudsa
devices
devops
documents
linux
misc
old_wiki
playground
programming
projects
resources
todo
ui-ux
virtualization
wiki
windows
work_dai_labor
yacoub
00_watch_list
01_publication_watchlist
02_pjs_task_overview
apache_wiki
damcuoi
heuristics
learning_resources
navigation
sidebar
td_wiki
v_openinfra_watch
Search
Toolbox
What links here
Recent Changes
Media Manager
Site index
Printable version
Permanent link
Cite this article