CS Support is a platform designed to support computer science students by providing access to resources, facilitating discussions, and fostering collaboration within the community.
- Report an issue: Report the issue that has occured in your distinct environment in order to let the admin/manager acknowledged the problem.
- Tracking: Track the status of the issue/problem that has been reported to the bot.
- Cost Evaluation: Built in material cost evaluation that is used for fixing/maintenance the problem/issue.
- Notifications: Stay informed with updates on the reported issue.
-
Clone the repository:
git clone https://github.com/Codezilla-CMU/CSSupport.git
Don't forget to extract the .zip file.
- For the next step, you need to import the code to Google App Script, in order to deploy the code through the server for usage.
- Add CSSupport: Add CSSupport bot through the provided QR Code below: CSSupport QR Code
- Rich Menu: Browse the specific function in the rich menu.
- Report: Report the issue through the bot.
We welcome contributions from the community. If you'd like to contribute to this project, please follow these steps:
- Fork the repository on GitHub.
- Clone your forked repository to your local machine.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them with descriptive messages.
- Push your changes to your forked repository.
- Submit a pull request to the main repository, explaining your changes and why they should be merged.
Please follow our Contribution Guidelines for more details.
This project is licensed under the MIT License. See the LICENSE.md file for details.
To deploy this project
RUN/DEPLOY through Google App Script
Step 1: Open the Apps Script in Google Workspace and add Status
, Repair
, and Regfixer
to the Apps Script. These files establish connections between Line and MongoDB.
Status
is used to display the status of users and fixers.Repair
is used for user repair requests.Regfixer
is used for registering or adding repair technicians.
Step 2: Add Files - status.html
, regfixer.html
, repair.html
These files serve to retrieve user information from Line LIFE:
-
status.html
is used to link to the Status page on Line. -
regfixer.html
is used to link to the Repair page on Line. -
repair.html
is used to link to the Regfixer page on Line.
Step 3: Use "drive-to-web" to create an HTML link and paste it into Line LIFE for accessing websites through Line.
drive-to-web Link: https://api.drv.tw/[email protected]/gd/?a=admin#authed=1
*To access the websites through Line, use the following links:
*paste it into Line LIFE for accessing websites through Line, at the endpoint
Before you begin, make sure you have the following prerequisites in place:
-
MongoDB Atlas Account: Sign up for or log in to your MongoDB Atlas account at MongoDB Atlas.
-
MongoDB Cluster: Create a MongoDB cluster in your Atlas account if you haven't already.
-
Database & Collection: Set up a database name and collection within your MongoDB cluster to store your data.
Step 1: Access the MongoDB Atlas Dashboard
-
Log in to your MongoDB Atlas account.
-
In the Atlas dashboard, select the project and cluster where you want to enable the HTTP endpoint.
Step 2: Enable the HTTP Endpoint
-
In the cluster view, click on "Database Access" in the left sidebar.
-
Click the "Add New Database User" button to create a database user with the necessary permissions. Make sure to remember the username and password for this user.
-
Next, click on "Network Access" in the left sidebar and add your current IP address to the IP Whitelist. This allows your current IP to access the cluster.
-
Once the IP is added, go back to the cluster view and click on "Database Access" again. Edit the user you created earlier and assign the appropriate role, such as "Atlas Admin" or "Read and Write to Any Database."
Step 3: Configure the HTTP Endpoint
-
In the cluster view, click on "Connect" at the top of the screen.
-
Click on the "Connect with MongoDB Compass" button.
-
Follow the instructions to download and install MongoDB Compass, if you haven't already.
-
Open MongoDB Compass and click on "Fill in connection fields individually."
-
Enter the following details:
- Hostname: Found in the MongoDB Atlas cluster view.
- Port: 27017
- Authentication: Select "Username / Password" and enter the database user credentials you created in Step 2.
-
Click "Connect" to establish a connection to your MongoDB cluster.
Step 4: Access Data via HTTP
-
Once you have connected to your MongoDB cluster using MongoDB Compass, you can access your data via the HTTP endpoint.
-
To use the code in our project you must to add 9 of method POST HTTP endpoint with following route.
-
In each route have to enabled on Respond With Result.
-
In each route have function to link in. It also have to include below code.
-
In each function setting have to set Authentication to System.
-
/sheet2mongo/insert
exports = function(payload) { const mongodb = context.services.get('mongodb-atlas'); const col = JSON.parse(payload.body.text()).header; const collection = mongodb.db("Your Database Name").collection(col); query = JSON.parse(payload.body.text()).query; return collection.insertOne(query);}
-
/sheet2mongo/insertDate
exports = function(payload) { const mongodb = context.services.get('mongodb-atlas'); const col = JSON.parse(payload.body.text()).header; const collection = mongodb.db("Your Database Name").collection(col); query = JSON.parse(payload.body.text()).query; query.receiveDate = new Date(query.receiveDate); return collection.insertOne(query);}
-
/sheet2mongo/find
exports = function(payload) { const mongodb = context.services.get('mongodb-atlas'); const col = JSON.parse(payload.body.text()).header; const collection = mongodb.db("Your Database Name").collection(col); query = JSON.parse(payload.body.text()).query; return collection.find(query).toArray();}
-
/sheet2mongo/findDate
exports = function(payload) { const mongodb = context.services.get('mongodb-atlas'); const col = JSON.parse(payload.body.text()).header; const collection = mongodb.db("Your Database Name").collection(col); query = JSON.parse(payload.body.text()).query; return collection.find({ $and: [ { receiveDate: { $gte: new Date(query.sDate) } }, { receiveDate: { $lte: new Date(query.eDate) } } ] }).toArray();}
-
/sheet2mongo/updateSet
exports = function(payload) { const mongodb = context.services.get('mongodb-atlas'); const col = JSON.parse(payload.body.text()).header; const collection = mongodb.db("Your Database Name").collection(col); filter = JSON.parse(payload.body.text()).filter; query = JSON.parse(payload.body.text()).query; return collection.updateOne(filter,{$set:query}); }
-
/sheet2mongo/updatePush
exports = function(payload) { const mongodb = context.services.get('mongodb-atlas'); const col = JSON.parse(payload.body.text()).header; const collection = mongodb.db("Your Database Name").collection(col); filter = JSON.parse(payload.body.text()).filter; query = JSON.parse(payload.body.text()).query; return collection.updateOne(filter,{$push:query});}
-
/sheet2mongo/updatePull
exports = function(payload) { const mongodb = context.services.get('mongodb-atlas'); const col = JSON.parse(payload.body.text()).header; const collection = mongodb.db("Your Database Name").collection(col); filter = JSON.parse(payload.body.text()).filter; query = JSON.parse(payload.body.text()).query; return collection.updateOne(filter,{$pull:query});}
-
/sheet2mongo/updateDate
exports = function(payload) { const mongodb = context.services.get('mongodb-atlas'); const col = JSON.parse(payload.body.text()).header; const collection = mongodb.db("Your Database Name").collection(col); filter = JSON.parse(payload.body.text()).filter; query = JSON.parse(payload.body.text()).query; query.finishDate = new Date(query.finishDate); return collection.updateOne(filter,{$set:query});}
-
/sheet2mongo/remove
exports = function(payload) { const mongodb = context.services.get('mongodb-atlas'); const col = JSON.parse(payload.body.text()).header; const collection = mongodb.db("Your Database Name").collection(col); query = JSON.parse(payload.body.text()).query; return collection.deleteOne(query);}
- Programming Language: HTML, JavaScript, CSS
- Extensive skills/tools: Line OA,Line Developers,MongoDB, Google Sheets