GithubHelp home page GithubHelp logo

felixfaisal / formica Goto Github PK

View Code? Open in Web Editor NEW
20.0 2.0 24.0 2.18 MB

A discord bot that collects and analyzes form data

License: MIT License

Python 55.35% HTML 1.60% CSS 10.78% JavaScript 31.39% Dockerfile 0.79% Shell 0.10%
discord-bot reactjs django-rest-framework mysql docker docker-compose hacktoberfest open-source django hacktoberfest2021 hacktoberfest-accepted

formica's Introduction

formica banner

Project Description

Several communities have joined Discord, with over 6.7 million servers existing on discord, the need for proper form analytics has increased, while most communities use Google forms or other third-party forms to analyze and visualize data, I believe that we can leverage Discord API to allow users to fill forms without leaving discord while also providing useful analytics to the Admin who created the form. This helps admins and mods to view the data via the discord bot or web interface, whichever is convenient

Collection of form data is often not taken seriously, you are providing information to be collected by one organisation but you have no idea where all the data is going to be circulated, There needs to be transparency in regards to sharing of form data to the user. Formica allows sharing of collected form data among communities also notifying users and letting them know that the data submitted on a form is being shared to another community, So the user can chose to delete his data from the shared form data.

Web Interface

Discord Bot

Backend and Frontend Setup

# Add Client ID and Secret Key 
cd formica/backend/API
touch .env
nano .env
CLIENT_ID= <ClientID> 
CLIENT_SECRET= <ClientSecret> 

#Run using Docker
cd formica
docker-compose build 
docker-compose up

Discord Bot Setup

#Add Bot Secret key
cd formica/bot
touch .env 
nano .env 
TOKENT = <BotToken>

#Run the bot 
python formica_bot.py

Contribution Guidelines 🏗

Are we missing any of your favorite features, which you think you can add to it❓ We invite you to contribute to this project and improve it further

To start contributing, follow the below guidelines:

🌟. Star🌟 the project to bookmark and appreciate the work.

Take a look at the existing issues or create your own issues. Wait for the Issue to be assigned to you after which you can start working on it.

1. Fork this repository.

2. Clone your forked copy of the project.

git clone --depth 1 https://github.com/<your_user_name>/formica.git

3. Navigate to the project directory 📁 .

cd formica

4. Add a reference(remote) to the original repository.

git remote add upstream https://github.com/felixfaisal/formica.git

5. Check the remotes for this repository.

git remote -v

6. Always take a pull from the upstream repository to your master branch to keep it at par with the main project(updated repository) and install the requirements to run the code.

git pull upstream main
npm install

7. Create a new branch.

git checkout -b <your_branch_name>

8. Perform your desired changes to the code base.

9. Track your changes:heavy_check_mark: .

git add . 

10. Commit your changes .

git commit -m "Relevant message"

11. Check for your changes .

git status

12. Push the committed changes in your feature branch to your remote repo.

git push -u origin <your_branch_name>

13. To create a pull request, click on compare and pull requests. Please ensure you compare your feature branch to the desired branch of the repo you are suppose to make a PR to.

14. Add appropriate title and description to your pull request explaining your changes and efforts done.

15. Click on Create Pull Request.

16. Voila ❗ You have made a PR to the website 💥 . Sit back patiently and relax while the project maintainers review your PR. Please understand, at timesthe time taken to review a PR can vary from a few hours to a few days.

Project Demo

Formica is a project for Sprint 2 of the MLH Fellowship. Here's a demo video that was made for the submission. This might help you understand the project better. Demo Video

Contribution

Check out our Contributions Guidelines

Code of Conduct


Click to read

License

MIT License

Our Valuable Contributors✨


📌 Opensource Programs

This project received various contributions from the following open source programs for students


Let's Grow More Summer of Code


formica's People

Contributors

amansharma2910 avatar aminoxix avatar bravo68web avatar dev2919 avatar elleanne avatar felixfaisal avatar gunashekar02 avatar irving-caamal avatar ishitakapoor26 avatar n-maido avatar naveen8801 avatar payaldutta avatar schmelto avatar shaishav0507 avatar srisatya12 avatar umesh-01 avatar yuvrajhere avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

formica's Issues

New bug/issue found

The issue

Add a .env.example file for backend. I am unable to understand how to define various variables like REDIRECT_URL_DISCORD. please help me set it up.

[qa] : Add Linters and Formatter

  • Need a workflow that ensures every contributor should follow the PEP-8 style guide for python code.
  • We can use flake8 for linting and Black for formatting source code.
  • Also this workflow runs on every PR which ensures the code follows PEP-8 standard or not.

Secret_key is public

Secret key is pushed to GitHub publicly

Solution

  1. Copy all the code of the settings.py to another temporary file. Remove settings.py from all the commit history, then generate a new key.

  2. Create new settings.py file, paste the code from temporary file.

  3. Create an .env file paste new generated secret key and import the key to new settings.py.

  4. Add the .env file to .gitignore, which will stop the secret_key from getting pushed.

  5. Commit the changes.

Setup guide for windows operating system

Task

Describe the step by step explanation to run the project on Windows operating system.

Solution (optional)

  • How to setup Docker(specifically for Home edition and Pro edition)
  • npm commands
  • specify API Keys if needed.

Type of Change

  • New feature
  • Feature update/enhancement
  • Documentation

Create a basic form bot

Create a discord bot that:

  • Sends embedded messages
  • Responds to commands
  • Detects emoji reactions
  • Allows a user to fill in a form via DM
    • Sends 1 question at a time, waits for a response, then sends the next question

Fix Flake 8 linting

The bug that you found

Currently, All the python code fails flake 8 tests, It would be great if that could be fixed

Solution (Optional)

Run flake8 tests locally and fix the issues

Type of Issue

  • Code breaking bug
  • Documentation issue
  • Other: Fix flake8 linting

Screenshot

Include any screenshots that can assist the person reviewing the PR.

Adding Contributors Section in readme

  • Documentation issue
    • Adding the Contributors section in the README.md to display all contributors of the project.
    • It can be next to the Project Admin section.

Do assign me under LGMSOC'21.

Update Readme

Task

Hey @felixfaisal
I would like to add license and project admin in the readme file.

Solution (optional)

How do you plan to accomplish this feature?

Type of Change

  • New feature
  • Feature update/enhancement
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation
  • Other: Please describe

Screenshot(s) (optional)

Include any screenshots that can assist the person in reviewing the PR

Formbot: m/c questions

Implement multiple choice questions, allowing the user to respond by reacting with an emoji

Integrate bot & backend

  • Make GET and POST requests to get the form details, questions, and responses, then send the updated responses to the backend

Create an Issue Template

Create an issue template for two types of issues

  • Bugs
  • Feature Request
    Feel free to be creative about it

Add code of conduct and contribution guidelines

Task

Hey @felixfaisal
I would like to add code of conduct and contribution guideline to the project.
Please assign it to me.
Thanks

Solution (optional)

How do you plan to accomplish this feature?

Type of Change

  • New feature
  • Feature update/enhancement
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation
  • Other: Please describe

Screenshot(s) (optional)

Include any screenshots that can assist the person in reviewing the PR

Create a GitHub workflow to publish images to DockerHub

Task

Create a GitHub Workflow to publish images to DockerHub

Solution (optional)

You can find resources on how to publish docker images online, For any assistance you can contact me

Type of Change

  • New feature
  • Feature update/enhancement
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation
  • Other: Please describe

Screenshot(s) (optional)

Include any screenshots that can assist the person in reviewing the PR

Documentation using docasaurus

Task

Create better documentation

Solution (optional)

Using Docusauras we can have better documentation that will allow contributors or developers to easily setup the system locally

Type of Change

  • New feature
  • Feature update/enhancement
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation
  • Other: Please describe

Screenshot(s) (optional)

Include any screenshots that can assist the person in reviewing the PR

add some more badges

Task

add some more badges to the top of readme.md file, since the badges will be colorful and more attractive at the top of README.md file than the text the users will like it and after linking the badges it will also help them to navigate to different sections/ webpages like PRs, issues, contributors, etc.

image

Solution (optional)

I will add some badges and also will add links related to them to the top so that the README.md file will look more interactive and awesome.

Type of Change

  • New feature
  • Feature update/enhancement
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation
  • Other: Please describe

Work under/as

  • LGMSOC
  • Contributor

Add a requirements.txt for Bot

Currently, The Bot folder uses three libraries
Discord.py
Python decouple/ Python dotenv
Requests
Test out any versions of it with the bot and add it to requirements.txt

Docker containers

Create dockers container for the Frontend, Backend, Discord Bot and MySQL
Interact with each other
Create volumes for development environment

Create Docker GitHub Action for Dev Environment

Task

Create a GitHub Workflow to test the docker containers working

Solution (optional)

To start the containers in dev environment use this command - docker-compose -f docker-compose-dev.yml up
Try to have this test in matrix OS that is Linux, Mac and Windows

Type of Change

  • New feature
  • Feature update/enhancement
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation
  • Other: Please describe

Adding contributors sections in readme

Task

I would like to add contributors sections in readme

Type of Change

  • New feature
  • Feature update/enhancement
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation
  • Other: Please describe

Screenshot(s) (optional)

2

Add option to select alert channel

Context:
When a user submits a form, the bot sends an alert message to a specified channel (based on the given channel id). Right now, that channel is hard coded.
Screen Shot 2021-04-12 at 1 43 56 PM

What you can do

  • On the website, in the create form section, add a drop down to allow the user to select which channel he/she wants to send these alerts to (similar to the dropdown to select a server)
  • Get the channel id and send to the backend
  • You don't need to modify anything in the bot

Update logo of the bot

Currently, the logo was made in a hurry
We would like to have a better logo for the repo as well for the bot's display picture
Feel free to be creative about it
It would be better to discuss the wireframes over here before we have any PRs made in regards to this

Integrate Frontend and Backend

As of now, The API's haven't been integrated with the frontend application
API's need to be added, and responses need to be used to construct user flows

Setup guide for Linux based OS

Task

Describe the step by step explanation to run the project on Linux based OS

Solution (optional)

  • How to setup Docker
  • npm commands
  • specify API key if needed.

Type of Change

  • Feature update/enhancement
  • Documentation

Dockerize bot

Add a dockerfile to the bot and test it out
Add it to services in docker-compose.yml

Use Docker Volumes instead of COPY

Task

Currently, the Docker Compose copies the code into the container, It might be good for production code but it's a real hassle for development.

Solution (optional)

We could either update the current docker-compose file with volumes instead of copy or create a new docker-compose file for dev environment.

Type of Change

  • New feature
  • Feature update/enhancement
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation
  • Other: Please describe

Refactor Django Code

All the API views and oauth views along with some helper functions are jammed into views.py
Move the helper functions to helper.py
Feel free to refactor as much as you can

Visualize data on the frontend

Assuming the form data received on the frontend has an epoch timestamp, we could visualize the data on the frontend by displaying the number of responses received per day as a line chart or a bar chart.

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.