Skip to content

Commit

Permalink
Merge branch 'main' into tickets
Browse files Browse the repository at this point in the history
  • Loading branch information
nulzo committed Nov 30, 2023
2 parents 9d947c7 + 020504e commit d648561
Show file tree
Hide file tree
Showing 23 changed files with 1,555 additions and 761 deletions.
17 changes: 0 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,6 @@ lib-cov
# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# IDEs and editors
.project
.classpath
Expand All @@ -84,11 +72,6 @@ bower_components
!.vscode/launch.json
!.vscode/extensions.json

# misc
.sass-cache
connect.lock
typings

# Logs
logs
npm-debug.log*
Expand Down
153 changes: 130 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,51 @@
<p align="center">
<h1 align="center" >University of Nebraska Tutoring Portal</h1>
</p>

<p align="center">
This application is designed to facilitate communication between students and tutors by allowing students to create, manage, and track tickets for tutoring assistance. Tutors can view, modify, claim, and close these tickets, ensuring a smooth and efficient tutoring experience. Additionally, an admin panel is available for database management and data retrieval.
</p>

<div>

<h4 align="center"> Github </h4>
</br>
<p align="center">
<a href="https://github.com/nulzo/University-Nebraska-Tutor-Portal">
<img src="docs\source\uno-icon-color.png" alt="Logo" width="80" height="80">
</a>

<h3 align="center">University of Nebraska
CSLC Tutoring Portal</h3>

<p align="center">
This application is designed to facilitate communication between students and tutors by allowing students to create, manage, and track tickets for tutoring assistance. Tutors can view, modify, claim, and close these tickets, ensuring a smooth and efficient tutoring experience. Additionally, an admin panel is available for database management and data retrieval.
<br/>
<br/>
<a href="https://github.com/nulzo/University-Nebraska-Tutor-Portal"><strong>Explore the docs »</strong></a>
<br/>
<br/>
<a href="https://github.com/nulzo/University-Nebraska-Tutor-Portal">View Demo</a>
.
<a href="https://github.com/nulzo/University-Nebraska-Tutor-Portal/issues">Report Bug</a>
.
<a href="https://github.com/nulzo/University-Nebraska-Tutor-Portal/issues">Request Feature</a>
</p>
</p>

<div>

<h4 align="center"> Project </h4>

<div align="center">

[![GitHub Integration](https://img.shields.io/github/actions/workflow/status/nulzo/University-Nebraska-Tutor-Portal/.github%2Fworkflows%2Fsecurity.yml)](https://github.com/nulzo/University-Nebraska-Tutor-Portal) [![GitHub Issues](https://img.shields.io/github/issues/nulzo/University-Nebraska-Tutor-Portal)](https://github.com/nulzo/University-Nebraska-Tutor-Portal) [![Version](https://img.shields.io/badge/Version-Alpha%200.0.1-E963DD)](https://github.com/nulzo/University-Nebraska-Tutor-Portal)

</div>

<h4 align="center"> Backend </h4>

<div align="center">

[![Code style: black](https://img.shields.io/badge/style-black-000000.svg?logo=python&logoColor=white)](https://github.com/psf/black) [![Python](https://img.shields.io/badge/Python-3.11-1487C1.svg?style=flat&logo=python&logoColor=white)](https://www.python.org) [![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/) [![Django](https://img.shields.io/badge/Django-4.2.3-13900D?logo=django&logoColor=white)](https://github.com/nulzo/University-Nebraska-Tutor-Portal)

</div>

<h4 align="center"> Frontend </h4>

<div align="center">

[![React](https://img.shields.io/badge/React-18.2.0-0FABC0?logo=react&logoColor=white)](https://github.com/nulzo/University-Nebraska-Tutor-Portal) [![Typescript](https://img.shields.io/badge/Typescript-5.2.2-3178C6?logo=typescript&logoColor=white)](https://github.com/nulzo/University-Nebraska-Tutor-Portal) [![npm version](https://img.shields.io/badge/npm-9.6.7-1487C1.svg?style=flat&logo=nodedotjs&logoColor=white)]() ![Static Badge](https://img.shields.io/badge/ESlint-linting-ffffff)

</div>

<h4 align="center"> Project </h4>

<div align="center">

[![Coverage](https://img.shields.io/codecov/c/github/nulzo/University-Nebraska-Tutor-Portal/main)](https://github.com/nulzo/University-Nebraska-Tutor-Portal) [![Up](https://img.shields.io/website/http/www.website.com/path/to/page.html.svg)](https://github.com/nulzo/University-Nebraska-Tutor-Portal) [![commits](https://img.shields.io/github/commit-activity/w/nulzo/University-Nebraska-Tutor-Portal?logo=github)]()
[![Coverage](https://img.shields.io/codecov/c/github/nulzo/University-Nebraska-Tutor-Portal/main)](https://github.com/nulzo/University-Nebraska-Tutor-Portal) ![Stargazers](https://img.shields.io/github/stars/nulzo/University-Nebraska-Tutor-Portal?style=social) [![commits](https://img.shields.io/github/commit-activity/w/nulzo/University-Nebraska-Tutor-Portal?logo=github)]()

</div>

Expand All @@ -46,21 +55,119 @@

[![nulzo Github](https://img.shields.io/badge/Github-nulzo-14A9C1.svg?style=flat&logo=github)](https://github.com/nulzo)

![Contributors](https://img.shields.io/github/contributors/nulzo/University-Nebraska-Tutor-Portal?color=dark-green)

</div>
</div>

## Features
## Table Of Contents

- [Table Of Contents](#table-of-contents)
- [About The Project](#about-the-project)
- [Built With](#built-with)
- [Getting Started](#getting-started)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Usage](#usage)
- [Roadmap](#roadmap)
- [License](#license)
- [Authors](#authors)
- [Acknowledgements](#acknowledgements)

## About The Project

There are many great README templates available on GitHub, however, I didn't find one that really suit my needs so I created this enhanced one. I want to create a README template so amazing that it'll be the last one you ever need.

Here's why:

* Your time should be focused on creating something amazing. A project that solves a problem and helps others
* You shouldn't be doing the same tasks over and over like creating a README from scratch
* You should element DRY principles to the rest of your life :smile:

Of course, no one template will serve all projects since your needs may be different. So I'll be adding more in the near future. You may also suggest changes by forking this repo and creating a pull request or opening an issue.

A list of commonly used resources that I find helpful are listed in the acknowledgements.

## Built With

- **Backend:** [Django REST framework](https://www.django-rest-framework.org/)
- **Frontend:** [React](https://reactjs.org/) and [TypeScript](https://www.typescriptlang.org/)
- **Proxy Server:** [Nginx](https://nginx.org/)
- **CSS Framework:** [Tailwind CSS](https://tailwindcss.com/)

## Getting Started

This is an example of how you may give instructions on setting up your project locally.
To get a local copy up and running follow these simple example steps.

### Prerequisites

You will need the following packages and libraries in order to successfully run the application:

1. #### npm

```sh
npm install npm@latest -g
```

2. #### Poetry

```sh
curl -sSL https://install.python-poetry.org | python3 -
```

3. #### Docker

```sh
sudo apt-get update
sudo apt-get install docker.io
```

4. #### Python

- Python is often pre-installed on many systems, or you can install here: [Python Images](https://www.python.org/downloads/)

5. #### TypeScript

```sh
npm install -g typescript
```

### Installation

1. Clone the repo

```sh
git clone https://github.com/nulzo/University-Nebraska-Tutor-Portal
```

2. Run Docker Compose
```sh
docker compose up --build -d
```

## Usage

## REST API Endpoints
Use this space to show useful examples of how a project can be used. Additional screenshots, code examples and demos work well in this space. You may also link to more resources.

_For more examples, please refer to the [Documentation](https://example.com)_

## Roadmap

See the [open issues](https://github.com/nulzo/University-Nebraska-Tutor-Portal/issues) for a list of proposed features (and known issues).


## License

Distributed under the MIT License. See [LICENSE](https://github.com/nulzo/University-Nebraska-Tutor-Portal/blob/main/LICENSE.md) for more information.

## Authors

* **Nolan Gregory** - *Lead Developer* - [Nolan Gregory](https://github.com/nulzo) - *Created the application*

## Acknowledgements

## Websockets
* [ShaanCoding](https://github.com/ShaanCoding/)
* [Othneil Drew](https://github.com/othneildrew/Best-README-Template)
* [ImgShields](https://shields.io/)

## Contact
33 changes: 33 additions & 0 deletions backend/api/endpoints/authenticate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
from rest_framework import status
from rest_framework.renderers import (
BrowsableAPIRenderer,
HTMLFormRenderer,
JSONRenderer,
)
from rest_framework.request import Request
from rest_framework.response import Response
from rest_framework.views import APIView

from api.models.user import User
from api.serializers import UserSerializer

# We don't need to check for duplicate class names and function names.
# pylint: disable=E0102,E1101,R0914


class APIAuthenticateList(APIView):
serializer_class = UserSerializer
renderer_classes = (BrowsableAPIRenderer, JSONRenderer, HTMLFormRenderer)

def get(self, request: Request) -> Response:
users = User.generic.all()
serializer = UserSerializer(users, many=True)
return Response(serializer.data)

def post(self, request: Request) -> Response:
user, created = User.generic.get_or_create(request.data)
print(user)
serializer = UserSerializer(data=request.data)
if serializer.is_valid() and created:
return Response(serializer.data, status=status.HTTP_201_CREATED)
return Response(serializer.data)
7 changes: 5 additions & 2 deletions backend/api/endpoints/course.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ def get(self, request: Request) -> Response:

if querystring:
if department := querystring.get("department"):
courses = courses.filter(course_department=self.sanitize(department))
courses = courses.filter(
course_department=self.sanitize(department))

if name := querystring.get("name"):
courses = courses.filter(course_name=name)
Expand All @@ -46,7 +47,8 @@ def get(self, request: Request) -> Response:
courses = courses.filter(course_id=course_id)

if course_id_contains := querystring.get("course-id-contains"):
courses = courses.filter(course_id__contains=course_id_contains)
courses = courses.filter(
course_id__contains=course_id_contains)

if greater_than_code := querystring.get("higher-than"):
courses = courses.filter(course_id__gt=greater_than_code)
Expand All @@ -62,6 +64,7 @@ def get(self, request: Request) -> Response:

def post(self, request: Request) -> Response:
serializer = CourseSerializer(data=request.data)
s = 10
if serializer.is_valid():
serializer.save()
return Response(serializer.data, status=status.HTTP_201_CREATED)
Expand Down
2 changes: 1 addition & 1 deletion backend/api/scripts/load_semester.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def read_csv(self):
if len(row["instructor"]) <= 1:
continue
# Get the professor ID (Some professors have two last names, so we need to check for that)
professor_id = (
professor_id: str = (
row["instructor"][2]
if (1 < len(row["instructor"]) <= 3)
else row["instructor"][3]
Expand Down
7 changes: 5 additions & 2 deletions backend/base/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from django.contrib import admin
from django.urls import path

from api.endpoints import course, issue, professor, section, ticket, user
from api.endpoints import course, issue, professor, section, ticket, user, authenticate

urlpatterns = [
# API Config URLS
Expand Down Expand Up @@ -63,13 +63,16 @@
# Hours URLS
# path("api/hours/"),
# path("api/hours/<str:hour_pk"),
# Authentication
path("api/authenticate/", view=authenticate.APIAuthenticateList.as_view()),
# Message URLS
# path("api/messages/", view=routing.APIMessageView.as_view()),
# path("api/messages/<str:message_id>", view=routing.MessageViewSet.as_view()),
# Announcement URLS
# path("api/announcements/")
# path("api/announcements/<str:annonucement_id>")
# Course URLS
path("api/courses/", view=course.APICourseList.as_view(), name="Course List View"),
path("api/courses/", view=course.APICourseList.as_view(),
name="Course List View"),
# path("api/courses/<str:course_pk>", view=routing.MessageViewSet.as_view()),
]
Loading

0 comments on commit d648561

Please sign in to comment.