{"id":25935579,"url":"https://github.com/hicsail/opencat-pro","last_synced_at":"2025-03-04T01:38:36.017Z","repository":{"id":90971229,"uuid":"88950878","full_name":"hicsail/opencat-pro","owner":"hicsail","description":"Build Your Own Computer Adaptive Test (CAT). Fully customizable, extensible web-based CAT platform for anything you wish.","archived":false,"fork":false,"pushed_at":"2019-05-21T20:43:28.000Z","size":13929,"stargazers_count":14,"open_issues_count":2,"forks_count":6,"subscribers_count":28,"default_branch":"master","last_synced_at":"2024-04-24T10:53:03.824Z","etag":null,"topics":["ejs","framework","hapi-mongodb","javascript","mongodb","nodejs","open-source"],"latest_commit_sha":null,"homepage":"http://sail.codes/opencat-pro/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hicsail.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-04-21T06:41:19.000Z","updated_at":"2023-10-20T04:55:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"a3239d4c-9252-4b66-ac8e-9adf84ac8e6a","html_url":"https://github.com/hicsail/opencat-pro","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hicsail%2Fopencat-pro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hicsail%2Fopencat-pro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hicsail%2Fopencat-pro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hicsail%2Fopencat-pro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hicsail","download_url":"https://codeload.github.com/hicsail/opencat-pro/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241768377,"owners_count":20017117,"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":["ejs","framework","hapi-mongodb","javascript","mongodb","nodejs","open-source"],"created_at":"2025-03-04T01:38:35.345Z","updated_at":"2025-03-04T01:38:36.010Z","avatar_url":"https://github.com/hicsail.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BYO-CAT\nBYO-CAT stands for build your own CAT. A fully customizable, open source web-based platform to create and manage Computer Adaptive Tests, better known as CATs.\n\nOur user portal API is built on top of [framejs](https://github.com/jedireza/frame) and node, backed by a MongoDB database.\n\nThe platform uses [Accessible+](http://www.accessible-template.com/) to provide section 508 compliant user interface. Please [purchase](http://www.accessible-template.com/purchase.html) a license of the platform suitable to your needs if you wish to use BYO-CAT for development.\n\n### Installation\n\nInstallation is a breeze with docker:\n       \n1. Clone the repo from GitHub and cd into the directory.\n       \n2. We now use Docker for all deployments! Download and install, then run the docker app. Resources can be found at https://www.docker.com/.\n       \n3. Run the commands below which downloads and installs necessary dependencies. This also runs our setup script. (If you are on Windows, run `dos2unix setup.js` and `dos2unix docker-run.sh` prior to the command below within the frame-server directory). The `--restart always` flag ensures that the container is restarted automatically whenever Docker is restarted.\n\n\t```\n\t\tdocker build -t byocat .\n\n\t\tdocker run -dit -p 27017:27017 --restart always --name mongo-byocat mongo:3.4\n\n\t\tsudo docker run -it --restart always -p 8000:8000 --link mongo-byocat:mongo byocat\n\t```\n\nSmooth, right? :)\n\n Optionally, you can add logging for your container, simply use:\n    \n  ``` \n   docker logs -f \u003ccontainer-name\u003e \u003e byo.log \u0026 \n   ```       \n    \nwhere \u003ccontainer-name\u003e is the docker provided name for your container that can be found by doing docker ps, and using the name given to the container that was spun up for byocat.\n       \n4. The db setup can be verified using the following steps:\n       \n \t - Enter mongo shell by typing *mongo* on the command prompt\n\t - Check databases using show dbs\n\t - Switch to frame by *use frame*\n\t - Type *show collections* to see the tables\n              \n5. To get up and running on Windows, there are some prerequisites before above steps:\n \n \t- Firstly, you'll need to have either Windows Professional, Enterprise, or Education edition. This is because Docker for Windows require Hyper-V support, and as of yet this project has not run on Docker Toolbox. \n       \n \t- Next you'll need [dos2unix](https://sourceforge.net/projects/dos2unix/ \"dos2unix\"), a program that converts text files with DOS or MAC line breaks to Unix line breaks and vice versa.  \n\n6. We are almost done! Navigate your browser to *localhost:9000* and you should be able to see the BYO-CAT home page. Explore around!\nIn case we want to change the server url to something else, change the **webHostname** and **webPort** variables in setup.js file under frame-server.\n\n### Enable SSL\n\nWe recommend using Let's Encrypt to handle SSL connections. Below are sample instructions for CentOS 7 and Apache. The steps might be different depending on your distro and required configuration.\n\nInstall EPEL\n\n```$ sudo yum install epel-release```\n\nInstall Apache\n\n```\n$ sudo yum install httpd\n$ sudo systemctl start httpd\n$ sudo systemctl enable httpd\n```\n\nInstall mod_ssl\n\n```$ sudo yum install mod_ssl```\n\nInstall [certbot](https://certbot.eff.org/#centosrhel7-apache)\n\n```$ sudo yum install python-certbot-apache```\n\nRun certbot to generate certificate for Apache\n\n```$ sudo certbot --apache```\n\nCertificates are only valid for 90 days, so set crontab for [auto renewal](https://certbot.eff.org/docs/using.html#renewal)\n\n```$ sudo crontab -e```\n\nAdd the following line to run certbot every 12 hours:\n\n```0 */12 * * * certbot renew --quiet```\n\nForward traffic from Apache to Node.js\n\n```$ sudo vim /etc/httpd/conf.d/ssl.conf```\n\nAdd the following to the bottom of the file, just before `\u003c/VirtualHost\u003e`\n\n```\nProxyRequests Off\n\n\u003cProxy *\u003e\n    Order deny,allow\n    Allow from all\n\u003c/Proxy\u003e\n\n\u003cLocation /\u003e\n    ProxyPass http://localhost:9000/\n    ProxyPassReverse http://localhost:9000/\n\u003c/Location\u003e\n```\n\nWhen using Ubuntu, make sure the necessary Apache modules are installed\n\n```\n$ sudo a2enmod proxy\n$ sudo a2enmod proxy_http\n$ sudo a2enmod ssl\n```\n\n### Enable backups\n\nA sample script `backup.sh` has been provided to create automated backups for MongoDB. Set the required parameters to match your configuration, and add it to your crontab file.\n\n```\n$ chmod +x backup.sh\n$ crontab -e\n```\n\nAdd the following to run every night at midnight:\n\n```\n0 0 * * * /path/to/script/backup.sh\n```\n\n### Making your own CAT\n\n- This project allows you to add the following custom options:\n\t- questions\n\t- response options\n\t- response weights and scores\n\t- Parameters for the survey\n  \n  All these formats can be found in the profile/ folder as well as the config/config folder.\n\n- One time setup options are defined in setup.js. This file is run when you do a docker build. Within setup.js, you would want to add your customizations for the following code:\n    ```\n    const context = {\n       projectName: 'BYO-CAT',\n       rootEmail: 'root@root',\n       rootPassword: 'rootroot',\n       rootFirst: 'root',\n       rootLast: 'root',\n       rootBirthday: '2016-07-22T19:18:18.403Z',\n       rootGender: 'male',\n       systemEmail: 'sys@tem',\n       smtpHost: 'smtp.gmail.com',\n       smtpPort: 465,\n       smtpUsername: 'youremail@gmail.com',\n       smtpPassword: 'your password',\n       webHostname: 'localhost',\n       webPort: 8000,\n       mongoServer: 'mongo-byocat:27017',\n       mongoTestDatabase: 'frame-test-byocat',\n       mongoDatabase: 'frame-byocat'\n     };\n   You must add your own smtpUsername and smtpPassword otherwise the invite functionality throws an error because of invalid email credentials.\n\n- The config/config folder also holds many customizable variables.\n\n- The Algorithm logic and business rules for your CAT can be defined in algorithms.js and businessRules.js under profile/lib. These include custom logic for your CAT.\n\n- The routes combined wih helpmerMethods.js works like a controller layer between the Model and Views. Helpermethods is a general purpose collection of logic and methods that retrieve, process and massage data to and fro between the models and views.\n\n### Documentation\nThe documentation for various server components can be found inside frame-server/server/docs. We use [documentationjs](https://github.com/documentationjs) to generate documentation. \n\n### License\n\nThis is project is open source under the MIT License and undergoing continuous enhancements. Feel free to improve the platform's many functionalities. The best way to request changes is to Open an Issue describing your changes first.\nThe UI framework is based on [Accessible+](http://www.accessible-template.com/). A valid license is required to use this in production.\n\n### Optional for development purposes - Live reload with Docker!\nWe can also add live reload options so that you don't need to rebuild the image each time you make a change in your code. We can do so by mounting the working directory onto the container.\n\nAdd the following lines to the Dockerfile:\n\n```RUN if [ -L \"/usr/src/byo-cat2/frame-server/node_modules\" ]; then rm /usr/src/byo-cat2/frame-server/node_modules; echo \"npm-modules symlink is removed\" ; fi;```\n\n```RUN if [ -d \"/usr/src/byo-cat2/frame-server/node_modules\" ]; then rm -rf /usr/src/byo-cat2/frame-server/node_modules; echo \"npm-modules symlink is removed\" ; fi;\n```\nAdd the following to docker-run.sh\n\t\n```if [ -L \"/usr/src/byo-cat/frame-server/node_modules\" ]; then\n\t    ls /usr/src/byo-cat/frame-server/node_modules\n\t    rm /usr/src/byo-cat/frame-server/node_modules\n\t    echo \"npm-modules symlink is removed\"\nfi\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhicsail%2Fopencat-pro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhicsail%2Fopencat-pro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhicsail%2Fopencat-pro/lists"}