{"id":24196695,"url":"https://github.com/hacc2024/hex","last_synced_at":"2025-09-21T21:32:09.239Z","repository":{"id":258037830,"uuid":"873359080","full_name":"HACC2024/HEX","owner":"HACC2024","description":"UHSPACE Data Hub 2024","archived":false,"fork":false,"pushed_at":"2024-11-09T23:10:31.000Z","size":80102,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-10T00:18:06.594Z","etag":null,"topics":["aws-ec2","chatbot-framework","codeql-enabled","css","database-management","docker","firebase","flask","groq-api","nextjs","nginx-proxy","python","recaptcha-v2","recharts-js","ssl-certificates","typescript","user-management"],"latest_commit_sha":null,"homepage":"https://uhspace.org","language":"TypeScript","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/HACC2024.png","metadata":{"files":{"readme":"docs/README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"docs/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-16T03:14:00.000Z","updated_at":"2024-11-09T23:28:59.000Z","dependencies_parsed_at":"2024-10-26T02:55:49.636Z","dependency_job_id":"fcef0fad-3e62-4f3c-93d4-d2adc30edf0b","html_url":"https://github.com/HACC2024/HEX","commit_stats":null,"previous_names":["hacc2024/hex"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HACC2024%2FHEX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HACC2024%2FHEX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HACC2024%2FHEX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HACC2024%2FHEX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HACC2024","download_url":"https://codeload.github.com/HACC2024/HEX/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233798852,"owners_count":18732047,"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":["aws-ec2","chatbot-framework","codeql-enabled","css","database-management","docker","firebase","flask","groq-api","nextjs","nginx-proxy","python","recaptcha-v2","recharts-js","ssl-certificates","typescript","user-management"],"created_at":"2025-01-13T19:37:17.563Z","updated_at":"2025-09-21T21:31:59.230Z","avatar_url":"https://github.com/HACC2024.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003eUHSPACE Data Hub by HEX at UHM - Next.js with Firebase Hosting and AWS EC2\u003c/h1\u003e\n\n\u003ch2\u003eOverview\u003c/h2\u003e\n\u003cp\u003eThis project is a Next.js web application called \u003cstrong\u003eUHSPACE Data Hub\u003c/strong\u003e, which stands for \"Unlocking Hawaii's Solutions for Personalized Analytics and Collaborative Engagement\". This README will guide you through the development, build, and deployment process.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eFinal Deployed Website:\u003c/strong\u003e https://uhspace.org\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eTemporary Administrator Access for Judging\u003c/strong\u003e (Available Only on 11/11/2024):\u003c/p\u003e \n\u003cul\u003e\n  \u003cli\u003eGo to the footer of the homepage, on the bottom right, and click on the 'Admin Portal' logo.\n  \u003cli\u003e\u003cstrong\u003eEmail:\u003c/strong\u003e View Submitted Google Form\u003c/li\u003e \n  \u003cli\u003e\u003cstrong\u003ePassword:\u003c/strong\u003e View Submitted Google Form\u003c/li\u003e \n\u003c/ul\u003e \n\u003cp\u003e\u003cstrong\u003eImportant Notice:\u003c/strong\u003e This login is exclusively for judges to review the project on 11/11/2024. Access will be removed promptly on 11/12/2024 to ensure the security and integrity of our systems. Please be assured that this temporary login does not compromise any sensitive data or system functionality. Thank you for your understanding and cooperation during the evaluation period.\u003c/p\u003e\n\n\u003chr /\u003e\n\n\u003ch2\u003eTable of Contents\u003c/h2\u003e\n\u003col\u003e\n  \u003cli\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca href=\"#development\"\u003eDevelopment\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca href=\"#building-the-project\"\u003eBuilding the Project\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca href=\"#exporting-static-files\"\u003eExporting Static Files\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca href=\"#deploying-to-firebase-hosting\"\u003eDeploying to Firebase Hosting\u003c/a\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003chr /\u003e\n\n\u003ch2 id=\"prerequisites\"\u003ePrerequisites\u003c/h2\u003e\n\u003cp\u003eMake sure you have the following installed on your system:\u003c/p\u003e\n\u003cul\u003e\n  \u003cli\u003e\u003ca href=\"https://nodejs.org/en/\"\u003eNode.js\u003c/a\u003e (v16.x or later)\u003c/li\u003e\n  \u003cli\u003e\u003ca href=\"https://firebase.google.com/docs/cli\"\u003eFirebase CLI\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003eA Firebase project (You can create one at the \u003ca href=\"https://console.firebase.google.com/\"\u003eFirebase Console\u003c/a\u003e)\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003chr /\u003e\n\n\u003ch2 id=\"installation\"\u003e1. Installation\u003c/h2\u003e\n\u003cp\u003eTo set up the project, follow these steps:\u003c/p\u003e\n\n\u003ch3\u003eClone the repository\u003c/h3\u003e\n\u003cpre\u003e\n\u003ccode\u003e\ngit clone https://github.com/HACC2024/HEX.git\ncd HEX\n\u003c/code\u003e\n\u003c/pre\u003e\n\n\u003ch3\u003eInstall Dependencies\u003c/h3\u003e\n\u003cp\u003eRun the following command to install the required dependencies:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enpm install\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis will install all dependencies listed in \u003ccode\u003epackage.json\u003c/code\u003e.\u003c/p\u003e\n\n\u003chr /\u003e\n\n\u003ch2 id=\"development\"\u003e2. Development\u003c/h2\u003e\n\u003cp\u003eTo run the project in development mode:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enpm run dev\u003c/code\u003e\u003c/pre\u003e\n\n\u003cul\u003e\n  \u003cli\u003eThe app will start on \u003ca href=\"http://localhost:3000\" target=\"_blank\"\u003ehttp://localhost:3000\u003c/a\u003e.\u003c/li\u003e\n  \u003cli\u003eAny changes you make in the code will automatically trigger hot-reloading.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003chr /\u003e\n\n\u003ch2 id=\"building-the-project\"\u003e3. Building the Project\u003c/h2\u003e\n\u003cp\u003eTo create a production build, run:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enpm run build\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis command will generate an optimized production build of your Next.js app.\u003c/p\u003e\n\n\u003chr /\u003e\n\n\u003ch2 id=\"exporting-static-files\"\u003e4. Exporting Static Files\u003c/h2\u003e\n\u003cp\u003eNext.js provides a feature to export your project as static files. This is crucial for deploying the app to Firebase Hosting. With the recent updates in Next.js, you do not need to run \u003ccode\u003enpm run export\u003c/code\u003e. Instead, the build process itself (using \u003ccode\u003enpm run build\u003c/code\u003e) automatically prepares your application for static export based on your configuration in \u003ccode\u003enext.config.mjs\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eThis will export your static site to the \u003ccode\u003eout\u003c/code\u003e directory.\u003c/p\u003e\n\n\u003chr /\u003e\n\n\u003ch2 id=\"deploying-to-firebase-hosting\"\u003e5. Deploying to Firebase Hosting\u003c/h2\u003e\n\u003cp\u003eFollow these steps to deploy the project on Firebase Hosting:\u003c/p\u003e\n\n\u003ch3\u003e5.1. Initialize Firebase Hosting\u003c/h3\u003e\n\u003cp\u003eIf you haven't initialized Firebase Hosting for this project yet, run the following command:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efirebase init hosting\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDuring this step:\u003c/p\u003e\n\u003cul\u003e\n  \u003cli\u003eSelect your Firebase project.\u003c/li\u003e\n  \u003cli\u003eSet \u003ccode\u003eout\u003c/code\u003e as the public directory (the directory where static files are generated).\u003c/li\u003e\n  \u003cli\u003eChoose \u003cstrong\u003eNo\u003c/strong\u003e for \"Single-page app\" configuration.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ch3\u003e5.2. Deploy the Project\u003c/h3\u003e\n\u003cp\u003eOnce your static files are generated in the \u003ccode\u003eout\u003c/code\u003e directory and Firebase is initialized, deploy the project with:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efirebase deploy\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFirebase will deploy your application, and you will receive a URL where you can view the live project.\u003c/p\u003e\n\n\u003chr /\u003e\n\n\u003ch2\u003eAdditional Notes\u003c/h2\u003e\n\u003cul\u003e\n  \u003cli\u003e\u003cstrong\u003eFirebase SDK\u003c/strong\u003e: If you are using Firebase services (e.g., Authentication, Firestore), make sure to install and configure the Firebase SDK.\u003c/li\u003e\n  \u003cli\u003e\u003cstrong\u003eEnvironment Variables\u003c/strong\u003e: Ensure you are using \u003ccode\u003e.env\u003c/code\u003e files to manage sensitive information such as API keys, Firebase credentials, etc.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cpre\u003e\u003ccode\u003e\nExample .env file:\nNEXT_PUBLIC_FIREBASE_API_KEY=your_api_key\nNEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project_id.firebaseapp.com\nNEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eGitHub Workflow\u003c/strong\u003e: You can also set up automatic deployments to Firebase Hosting using GitHub Actions.\u003c/p\u003e\n\n\u003chr /\u003e\n\n\u003ch2\u003eLicense\u003c/h2\u003e\n\u003cp\u003eThis project is licensed under the \u003ca href=\"./LICENSE\"\u003eMIT License\u003c/a\u003e.\u003c/p\u003e\n\n\u003chr /\u003e\n\n\u003ch2\u003eContact\u003c/h2\u003e\n\u003cp\u003eFor any questions or issues, feel free to contact our team at \u003ca href=\"mailto:your-email@example.com\"\u003euhspacehub@gmail.com\u003c/a\u003e.\u003c/p\u003e\n\n\u003chr /\u003e\n\n## Learn More\n\nTo learn more about Next.js, take a look at the following resources:\n\n- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.\n- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.\n\n\u003ch2\u003eFlask-Backend API\u003c/h2\u003e\n\n\u003cp\u003eBackend Prod: https://uhspace.org\u003c/p\u003e\n\u003cp\u003eBackend Dev: http://127.0.0.1:5000\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eNote:\u003c/strong\u003e If the Chatbot is giving CORS issues, visit:\u003c/p\u003e\n\u003cul\u003e\n    \u003cli\u003e\u003ca href=\"http://api.uhspace.org\" target=\"_blank\"\u003ehttp://api.uhspace.org\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"http://hex-chatbots-2141489768.us-east-2.elb.amazonaws.com/\" target=\"_blank\"\u003ehttp://hex-chatbots-2141489768.us-east-2.elb.amazonaws.com/\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eThe pages should display: \u003cem\u003e\"Welcome to the Flask Chatbot API!\"\u003c/em\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e1) If not, check if the EC2 Instance is active:\u003c/strong\u003e\u003c/p\u003e\n\u003cul\u003e\n    \u003cli\u003eLog in to the AWS Console and connect to the instance through the console or via SSH.\u003c/li\u003e\n    \u003cli\u003eRun \u003ccode\u003ecurl http://18.224.7.0:5000\u003c/code\u003e, replacing \u003ccode\u003e18.224.7.0\u003c/code\u003e with the instance’s public IP. It should return the Flask Chatbot API welcome message.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003e\u003cstrong\u003e2) If the pages above do not render correctly, set up a new Load Balancer on the EC2 instance:\u003c/strong\u003e\u003c/p\u003e\n\u003cul\u003e\n    \u003cli\u003eSet up listeners on \u003cstrong\u003eHTTP Port 80\u003c/strong\u003e and \u003cstrong\u003eHTTPS Port 443\u003c/strong\u003e.\u003c/li\u003e\n    \u003cli\u003eCreate a Target Group for \u003cstrong\u003ePort 5000\u003c/strong\u003e.\u003c/li\u003e\n    \u003cli\u003eAssign the SSL/TLS Certificate for \u003cstrong\u003euhspace.org\u003c/strong\u003e.\u003c/li\u003e\n    \u003cli\u003eEdit the Nginx configuration with \u003ccode\u003esudo vim /etc/nginx/conf.d/uhspace.conf\u003c/code\u003e.\u003c/li\u003e\n    \u003cli\u003eUpdate the \u003ccode\u003elocation /api\u003c/code\u003e block with \u003ccode\u003eproxy_pass http://new-load-balancer-DNS-name\u003c/code\u003e.\u003c/li\u003e\n    \u003cli\u003eTest the configuration with \u003ccode\u003esudo nginx -t\u003c/code\u003e.\u003c/li\u003e\n    \u003cli\u003eIf there are no errors, restart Nginx with \u003ccode\u003esudo systemctl restart nginx\u003c/code\u003e.\u003c/li\u003e\n    \u003cli\u003eCheck the status of Nginx with \u003ccode\u003esudo systemctl status nginx\u003c/code\u003e. It should display an active status.\u003c/li\u003e\n\u003c/ul\u003e\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhacc2024%2Fhex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhacc2024%2Fhex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhacc2024%2Fhex/lists"}