Giter Site home page Giter Site logo

pierrelouis2 / cpe_planning Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 0.0 10.35 MB

Hello everyone! This project is a messenger bot that will make your life easier. He send you a personalised schedule. Enjoy!

Home Page: https://www.facebook.com/profile.php?id=100090769200025

JavaScript 37.84% Jupyter Notebook 24.83% Python 15.36% HTML 0.59% EJS 12.58% Less 8.80%
bot chatbot messenger-bot messenger-chatbots planning

cpe_planning's Introduction

header image

Messenger chat bot for student timetable

With @jo-pouradier, we created a chat bot for Messenger to help students to get their timetable on messenger which is much eassier than a long and fastidious excel file. That's why we created CPE Planning | Facebook. It's a 24/7 chat bot running with Nodejs on our personnal home lab.

The first version was made by @waleedahmad with his Aww-Bot | Github.

Summary

Installation

/!\ It is really complicated to install a chat bot on messenger, be ready to spend a lot of time on it. /!
Fist you need a Facebook page connected with messenger to get a personnal token. Then you need to create a server with an https address (you can use ngrok, localtunnel, or a personnal domain). Then run a nodejs server (I first tried with a python flask server... no sucess) where the url /webhook verify your secret token. Finally your chat bot can be used by developpers and admins! For your app to be accessible to anyone, you need to submit it to Facebook for review, with a privacy policy (more in our Legal part).

Usage

The get_started button is the first thing you see when you open the chat bot. It's a simple button that register the user in the database while asking for his promotion, group and major if necessary. For the database, we are using a local sqlite file to store the user's data. And a json file to store the timetable. We are reccording the user's :

  • id (chat id from facebook)
  • promotion (3A or 4A)
  • group (A, B, C or D)
  • major (only for 4ETI students) On the website we are using the user's:
  • email (cpe)
  • first-name
  • last-name
  • password
  • personnal code (send via messenger)

On Messenger we send to the user a message with a button for each day of the week. When the user click on a button, we send him a message with the timetable of the day according to his promotion and major. The group is not taken into account for the moment it is way too complicated because of the pdf file and too many of unplanned format.

On the website, when the user is connected, he can see his timetable and his personnal code.

Legal

To make your app accessible to anyone, you need to submit it to Facebook for review, with a privacy policy. You can use PrivacyPolicies.com to create your privacy policy. It is free and easy to use. Below is our privacy policy and service requirement. Webgenarator : app.privacypolicies.com

  • Privacy policy webhosted : Here
    • or in Markdown localy : Here

Database

For the database we are using an sqlite database. This version works for all students. For the MSO we are using a joint table because of the number of MSO (about thirty). /!\ The database is not finished yet, we are still working on it. The database is composed of 3 tables:

  • user :
    • id_user
    • promo
    • filliere
    • groupe
    • majeur
  • TJ_User_MSO :
    • id_user
    • id_mso
  • MSO :
    • id_mso
    • name_mso
  • profile:
    • email
    • prenom
    • nom
    • password (stored in sha256 with salt)
    • psid (=id_user from user table)

Database MPD

Database structure V1 (not up to date)

Recover timetable data from pdf

TODO

  • Verification server side for register
  • handle spam
  • make a stat page
  • Fix Change info form
  • password recovery
  • Manage LV lessons
  • Manage database backup and restore (cron?)
  • Script to send planning automatically at 7h30am
  • Make a better code
  • Don't share the token on github !!!!!!!!!
  • Don't share the code to ETI students !!!!!!!!!
  • Regex expression for hours
  • Link the LV lessons website
  • autocomplete the re-registration form of the website
  • make a repport bug or feedback page/form
  • handle 3ETI groups 'X&Y'
  • change python script xls2csv to a js module
  • check for .isc possibilities
  • show error message for invalid form
  • remove psid from github
  • Interface admin pour gérer les comptes
  • change database schema
  • For the future : make a web interface for CPE admin to post the planning (manage timetable)
  • change url from messenger to cpeplanning
  • to link bot and website use sender PSID
  • create send psid button
  • create subscribe page
  • to link bot and website use sender PSID
  • create send psid button
  • create subscribe page
  • Make json file for all variables
  • Repair isKnown function
  • Manage CGP Table
  • Manage re-registration 4CGP (mso)
  • Manage 3A lessons
  • Create MSO TABLE
  • Manage groups (but not for 4A its useless and complicated)
  • Make more comments in the code so it's easier to understand when you come back to it after a long time
  • Use personnal domain to get png
  • Manage SQL errors (try catch)
  • Make a better readme
  • Use another file to store templates

cpe_planning's People

Contributors

jo-pouradier avatar pierrelouis2 avatar waleedahmad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.