{"id":21046609,"url":"https://github.com/linux-vps/testbx","last_synced_at":"2025-03-13T22:23:52.554Z","repository":{"id":252808779,"uuid":"841526693","full_name":"linux-vps/testbx","owner":"linux-vps","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-25T18:18:22.000Z","size":254,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-20T17:49:56.441Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"EJS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linux-vps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-12T15:26:32.000Z","updated_at":"2024-09-04T13:28:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"0a946a04-bd97-408d-8716-fb64abf9c53d","html_url":"https://github.com/linux-vps/testbx","commit_stats":null,"previous_names":["linux-vps/testbitrix24","linux-vps/testbx"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-vps%2Ftestbx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-vps%2Ftestbx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-vps%2Ftestbx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-vps%2Ftestbx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linux-vps","download_url":"https://codeload.github.com/linux-vps/testbx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243490774,"owners_count":20299193,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T14:31:06.466Z","updated_at":"2025-03-13T22:23:52.534Z","avatar_url":"https://github.com/linux-vps.png","language":"EJS","funding_links":[],"categories":[],"sub_categories":[],"readme":"## __DEMO:__\n\n- http://eop.id.vn:5001/ \n- http://20.2.233.202:5001/ ( server on Azure)\n\n## Description\n\nSimple web app to display All name of users in Bitrix24 app (b24-7w9mjb.bitrix24.vn)\nUsing NodeJS, for client and server. Display HTML by simple EJS view engine.\n\n## Install \u0026 Upgrade\npaste this section bellow in your terminal.\n```\nbash \u003c(curl -Ls https://raw.githubusercontent.com/linux-vps/testbitrix24/main/install.sh)\n```\n\n### Directory Structure\n\n- **Public**: Using NodeJS with EJS view engine. \n  - `.env`: Environment configuration.\n  - `.gitignore` \n  - `directory-structure.txt`: directory structure.\n  - `index.js`\n  - `package-lock.json`\n  - `package.json`\n  - **assets**\n    - **img**\n    - **js**\n    - **styles**: Stylesheets ( `style.css`, `style.css.map`, `style.scss`).\n  - **config**: Configuration files ( `config.js`).\n  - **views**: View templates ( `index.ejs`).\n\n- **Server**: API server-side code.\n  - `.env`: Environment configuration.\n  - `.gitignore` \n  - `directory-structure.txt`: directory structure.\n  - `index.js`\n  - `package-lock.json`\n  - `package.json`\n  - **config**: Configuration files (`config.js`).\n  - **controllers**: handling API.\n    - `employeeController.js`: GET list of users.\n    - `refreshController.js`: GET refresh_token.\n  - **middleware**\n  - **routes**: API route definitions (`index.js`).\n\n## Installation\n\n### Step 1: Install NodeJS and NPM using nvm\n\nFirst, log in as the root user or a user with sudo privileges.\n\n```bash\nsudo su\n```\n\nInstall node version manager (nvm) by typing the following at the command line.\n\n```bash\ncurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash\n```\nActivate nvm by typing the following at the command line.\n\n```bash\n. ~/.nvm/nvm.sh\n```\n\nUse nvm to install the latest version of Node.js by typing the following at the command line.\n\n```bash\nnvm install node\n```\n\nTest that node and npm are installed and running correctly by typing the following at the terminal:\n\n```bash\nnode -v\nnpm -v\n```\n\n### Step 2: Install Git and clone repository from GitHub\nTo install git, run below commands in the terminal window:\n\n```bash\nsudo apt-get update -y\nsudo apt-get install git -y\n```\nor \n```bash\nsudo yum update -y\nsudo yum install git -y\n```\n\nJust to verify if system has git installed or not, please run below command in terminal:\n```bash\ngit --version\n```\n\nThis command will print the git version in the terminal.\n\nRun below command to clone the code repository from Github:\n\n```bash\ngit clone https://github.com/linux-vps/testbitrix24.git\n```\n\nNavigate to the testbitrix24 first.\n```bash\ncd testbitrix24\n```\n\n### Before starting: Prepare Environment variables.\n#### In each .env.example file in each directory\n- Change to your information variables with the following below:\n  - **public**:\n    - BACKEND_SERVER_URL=\u003cYour_Server_Url_Address\u003e\n    - PORT=\u003cPort_That_Run_The_Frontend_Project\u003e\n    example:\n      BACKEND_SERVER_URL=http://eop.id.vn:5000/api/ \n      PORT=5001\n  - **server**:\n    - REFRESH_TOKEN_URL=https://bx-oauth2.aasc.com.vn/bx/oauth2_token #(ADT EasyOauth2 api, this is the api for getting refresh_token)\n    - APP_ID=\u003cyour_app_id\u003e\n    - FIELD_USER_GET_URL=https://\u003cyour_sub_domain\u003e.bitrix24.vn/rest/user.get.json #(api Retrieves filtered list of users. read https://training.bitrix24.com/rest_help/users/user_get.php ) \n    - PORT=5000\n    example:\n      REFRESH_TOKEN_URL=https://bx-oauth2.aasc.com.vn/bx/oauth2_token\n      APP_ID=local.myappid123456\n      FIELD_USER_GET_URL=https://my.bitrix24.vn/rest/user.get.json\n      PORT=5000\n   -  **How to edit these file in terminal**\n        - Install nano:\n        ```bash\n        sudo apt install nano\n        nano --version\n        ```\n    #### Change all .env.example to .env\n    Return to the testbitrix24 folder and typing this.\n    ```bash\n    cd public\n    mv .env.example .env\n    cd ..\n    cd server\n    mv .env.example .env\n    cd ..\n    \n    ```\nNow just run it\n\nNavigate to the server directory, install dependencies, and start the server:\n```bash\ncd server\nnpm install\nnpm start\n```\nOpen a new terminal, navigate to the public directory, install dependencies, build the project, and start the front-end:\nthis can take long time and might show some warn, don't be worried about that. Keep waiting :D ...\n```bash\ncd public\nnpm install\nnpm run build\nnpm start\n```\n\n## We can keep the web alive with PM2\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinux-vps%2Ftestbx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinux-vps%2Ftestbx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinux-vps%2Ftestbx/lists"}