GithubHelp home page GithubHelp logo

mmoomocow / digital-commendations Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.13 MB

A digital commendation system being developed for credits and to replace the one in use currently

Home Page: https://dcs.mgray.online

License: GNU Affero General Public License v3.0

Python 69.95% CSS 7.31% HTML 20.35% JavaScript 2.38%
django python python3 webapp

digital-commendations's Introduction

Digital Commendations

Code style: black DeepSource

A digital commendation system being developed for use at Bayfield High School

⚠️ PROJECT ARCHIVED ⚠️

This project has been archived for now as I have completed my assessments. At some point I might return to this and keep working on it.

Install Instructions

This project requires Python 3.10 or higher!

Cloning the repo

Clone the repository using git

git clone https://github.com/mmoomocow/digital-commendations.git

or download from the GitHub releases

Installing the virtual environment

Create a virtual environment using VENV.

python -m venv venv

Activate the virtual environment

with windows:

<venv path>\Scripts\activate.bat

Install the dependencies

pip install -r requirements.txt

If you are going to generate dummy data for the database, also install faker

pip install faker

Configuration

Create a .env file in the root directory of the project and add the following variables:

  • ALLOWED_HOSTS - A comma separated list of the allowed hosts

    • Example: *,localhost,www.example.com
  • Secret key - A secret key used to encrypt and decrypt data

    • Example: <random string>
  • DEBUG - A boolean value indicating if the application should be in debug mode

    • Example: True
  • SECURE_HSTS_SECONDS - The number of seconds that the browser should remember that the site is HTTPS only

    • Example: 31536000
  • PRODUCTION - A boolean value indicating if the application should run in production mode

    • Example: True
  • ADMINS - A comma separated list of admins who will receive emails for 500 errors

  • MANAGERS - A comma separated list of managers who will receive emails for 404 errors

  • DB_NAME - The name of the MySQL database schema to use

    • Example: commendations
  • DB_USER - The username to use to connect to the MySQL database

    • Example: root
  • DB_PASSWORD - The password to use to connect to the MySQL database

    • Example: password123
  • DB_HOST - The hostname of the MySQL database server

    • Example: localhost
  • DB_PORT - The port of the MySQL database server

    • Example: 3306
  • CONN_MAX_AGE - The number of seconds a database connection should be kept alive

    • Example: 60
  • KAMAR_AUTH_USERNAME - The username that the Kamar API will use to access the site

    • Example: Kamar
  • KAMAR_AUTH_PASSWORD - The password that the Kamar API will use to access the site

    • Example: password
  • MY_HOST - The hostname of the site. Used for redirect callbacks

    • Example: localhost:8000
  • MICROSOFT_AUTH_TENANT_DOMAIN - The domain of the Microsoft tenant

    • Example: example.com
  • MICROSOFT_AUTH_CLIENT_ID - The client ID of the Microsoft application

    • Example: 12345678-1234-1234-1234-123456789012
  • MICROSOFT_AUTH_CLIENT_SECRET - The client secret of the Microsoft application

    • Example: 1234567890123456789012345678901234567890

Migrate the database

python manage.py migrate

Generate dummy data (optional)

python manage.py populate_DB

Run the application

python manage.py runserver

Development

New Branches

Branches are used to track changes to the code. When a new branch is created, the name should be in the format of <name>-DCS-<cardID>. For example, Jdoe-DCS-123. The card ID is taken from the trello board.

Testing

To test the application, run the following command:

python manage.py test

As the project is developed, add new tests to the corresponding tests.py file.

digital-commendations's People

Contributors

actions-user avatar deepsource-autofix[bot] avatar deepsourcebot avatar dependabot[bot] avatar mmoomocow avatar

Watchers

 avatar

digital-commendations's Issues

DCS-031 - Custom error pages

Short description of the feature

Add custom error pages to display for common error codes

Describe the solution you would like

Why should this be implemented

DCS-069 - Mobile accessability issues on login page

Describe the bug

When viewing the login page on a mobile device (Or any device with a small screen) the 2 column layout breaks

When viewing an individual commendation on a device with a small screen it also looks strange and unusable

DCS-082 Data analysis

Based on feedback from Mr Beagley, some examples of what could be included are:

  • Commendations awarded per teacher
  • Commendation types awarded
  • Commendations received by student

DCS-083 Highlighting of new commendations

Based on feedback from Mr Milne

When there is the "You have been awarded 5 commendations since you last logged in" message there is no way to quickly identify the new commendations. Highlighting them would make it quick and easy to see

DCS-062 - Github format action creating branches

Describe the bug

The formatting action with github actions is creating random branches when trying to commit changes.

To Reproduce

Steps to reproduce the behavior:

  1. Open pull request
  2. formatting action will be run
  3. new branch may be created

Expected behavior

No new branches. If applicable changes should be committed to the PR branch or not pushes at all

##Screenshots
image
image

Additional context
Add any other context about the problem here.

DCS-058 - no trailing slash results in 404

Describe the bug

If there is no trailing slash then you are shown the 404 page. Many links do not have a trailing slash

To Reproduce

Steps to reproduce the behavior:

  1. From any page click on the contact link in the navbar
  2. You will be taken to /contact
  3. 404

Expected behavior

No 404 and contact page displayed correctly

##Screenshots
image
image

DCS-038 - SMS notifications

Short description of the feature

Add SMS notifications when students receive commendations

Describe the solution you would like

Using modica

import requests
uri = 'https://api.modicagroup.com/rest/gateway/messages'
json_payload ='{"content": "Hello world!", "destination": "+64123456789"}'
response = requests.post(uri, auth=('username', 'password'), data=json_payload)

print 'HTTP %s' % response.status_code
print response.text

Why should this be implemented

Informs students when the receive commendations

DCS-032 - Responsive media querries

Short description of the feature

Add media queries to CSS to create a responsive design

Describe the solution you would like

Media queries modifying the layout

Why should this be implemented

Better experience on devices with smaller screens

ToDo

DCS-035 - Better heading styles

Short description of the feature

Headings need to restyled to make more sense

Describe the solution you would like

Changes to H* tags with better font sizes etc

Why should this be implemented

DCS-051 - quick reasons for awards

Short description of the feature

Could adding pre-made selectable reasons for awarding commendations be good?
e.g. "Scoring highly on test", "Being respectful" etc

Describe the solution you would like

Selectable reasons, probably radio buttons or a dropdown

Why should this be implemented

Saves time for teachers, lots will need to award the same thing multiple times

DCS-081 Commendation Locations

Based on feedback from Mr Milne!

Having 'locations' for example in the classroom, extra-curricular etc would allow parents and caregivers to see where the student is doing well. For example is the student getting a good balance between classroom and extracurricular commendations?

Could also be communicated with a progress bar, that splits as a percentage of in class & out of class

DCS-077 - no way to access portal

Describe the bug

After login there is no link to navigate back to the portal

To Reproduce

Steps to reproduce the behavior:

  1. login, you will be redirected to the respective portal (student, teacher etc)
  2. Then navigate to another page
  3. Then try to go to the portal without going back (You can't)

Expected behavior

A clear way to access the portal with navigation

##Screenshots
image

DCS-053 - Separation of requirements

Short description of the feature

Separate production requirements from developer requirements

Describe the solution you would like

Split requirements into requirements.txt and requirements_dev.txt

Why should this be implemented

Smoother developer experience, reduces number of packages in production environments reducing bug risk and install time

DCS-059 - Microsoft auth login

Short description of the feature

Login with Microsoft authentication.

Describe the solution you would like

Option to use microsoft Oauth to login to site

Why should this be implemented

Could entirely remove need for student and teacher password management, as all students and teachers have a school linked microsoft account

DCS-057 - API check requests dont work

Describe the bug

Real check requests to the API endpoint using basicauth fail

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

##Screenshots
If applicable, add screenshots to help explain your problem.

##Device and enviroment

  • Device: [e.g. i-phone, desktop computer]
  • OS: [e.g. iOS/windows]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

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.