Coder Social home page Coder Social logo

willthedeveloper / studyportal Goto Github PK

View Code? Open in Web Editor NEW
25.0 1.0 13.0 4.82 MB

Study Portal is a place where students can collaborate on work and access everything else they need as a student.

Home Page: https://studyportal.cloud

PHP 18.70% Blade 81.29% Dockerfile 0.01%
laravel students student-project epq studying tools codecov codescene collaborate digitalocean

studyportal's Introduction

Study Portal

GitHub tag (latest by date) GitHub Codecov GitHub issues GitHub pull requests GitHub commit activity

Official Discord server - https://discord.gg/ZEkX2NPWVs

Contact email about anything related to Study Portal: [email protected]

About Study Portal

The idea behind Study Portal is to have one platform where students are able to work together on work where other people are doing similar subjects and help each other out.

Project Roadmap

The full public roadmap is available to everyone. The link to it can be found here. Study Portal Public Roadmap

Development for this project can sometimes fall behind in regard to keeping up with the roadmap since essentially all the development is done by me and I have a full time job. I will try my best to keep up with the roadmap and keep it up to date. Occasionally people help but nothing significant.

Q/Year Status Version
Q3 2021 ✔ Start of project Alpha
Q4 2021 ✔ Not recorded Alpha
Q1 2022 ✔ Completed Beta
Q2 2022 ✔ Completed Beta
Q3 2022 ✔ Completed Beta
Q4 2022 ✔ Completed Beta
Q1 2023 ❔ Pending Pre-release
Q2 2023 ❔ Planning v1.0.0
Q3 2023 ❔ Planning v1.x.x
Q4 2023 ❔ Planning v1.x.x

My goal and original idea

Before we get into the nifty-gritty of the project and my plans for the future, I first wanted to give a little back-story to how the idea came about and the situation that I was in at the time that I had come up with the idea. I am going to assume that you know nothing about me, so I will make sure to leave some pointers. During my time at college, I had to do a work placement and I had actually decided to take part of a work placement where we are all told that it was going to be really difficult, well long story short, it started with 12 people and finished with 2, including myself. During that project, I got exposed to Laravel which is an entire different story and quite a steep learning curve since I had never worked with any frameworks before. You can read about my experience with laravel up to yet here.

Anyway, if we fast-forward 12 months, I am finishing my work placement with over 700 hours of industry experience in the bag. At the time of writing this I can't remember what triggered it, but I had this idea to create a platform that allowed students to work together in one way or another. Teams is cool, but I feel like it's tailored more towards a business environment compared to a student environment which is one of the problems I was aiming to solve by developing this application.

But, long explanation, cut short, my primary goals were as follows;

  • Create a platform that students could work together in some way to get work done more efficiently.
  • Enable collaboration across all levels of study, ranging from college to university.
  • Implement additional tools that other applications don't have to ensure that it tailors for students.
  • Have something that is open source, so it can be developed over a long time.

Study Portal features

  • Timetable - Place for students to create their own timetable and keep track of what lessons they have.
  • Assignments - This is where students can keep track of assignment work that they are doing.
  • Dashboard - Overview of all the stats that matter to students.
  • Community - Place where students can talk to each other with posts and support each other.
  • Kanban - Students being able to have their own personalised kanban to track progress of work or other stuff.
  • Calendar - One place where meetings and events can be created and tracked.
  • Blog - This is where students and the public will be able to see internal posts from Study Portal team get posted.
  • Shop - Somewhere where people can post any items or stationary that may be useful during education. Only ran by Study Portal at the minute.
  • Todo - An area where people can keep track of individual tasks that have email updates and reminders connected to them.
  • Notes - This is in the name of it, a large inventory and place for students to take notes which supports markdown.
  • Groups - This is managed by tutors where they can group students into classes or little teams and manage assignments and other resources for them.
  • Reports - The community area of the platform is protected by a report system where admins can take action where necessary of any posts that are harmful to others.
  • Institutions - Institutions are like colleges and universities that have subjects and students associated with them to keep everyone under their associated umbrella.
  • Placements - Falling under the community area is a placements area where students are able to apply for work placements that may be available to them.
  • Applications - This is where students can apply for placements, track the status of their application and employers are able to review their applications.
  • Subjects - This is the kind of category system that everything falls under, keeping the entire ecosystem tidy.
  • Tags - Kind of like subjects but on a more granular level on a per-user basis but this is entirely optional.
  • Resources - A place where students are able to share resources or keep them private amongst themselves, allowing for support amongst students to take place.
  • Tickets - These are support tickets that allow students to have a channel where they can get answers for any questions directly from the tutors of their choice.

If you want to see what is happening in more detail than follow this link: https://github.com/users/WillTheDeveloper/projects/5

More features will be added to this list soon. Progress has outpaced the documentation and roadmap a little.

How to install/run server

Prerequisites

  • We recommend using docker for hosting a local database.
  • Have PHP 8 or later installed and setup.
  • A database of some kind to develop on.
  • Your favourite IDE

Windows in-depth setup guide

  1. Download Docker
  2. Setup WSL2 kernel update
  3. Setup your IDE
  4. Download PHP and place it inside the root of your C: drive extracted.
  5. Enable the following PHP extensions inside the php.ini file (Further instructions can be found in the file itself):
    • bz2
    • curl
    • ftp
    • fileinfo
    • mbstring
    • mysqli
    • openssl
    • pdo_mysql
    • pdo_pgsql
    • pdo_sqlite
    • pgsql
    • shmop
  6. Install composer using the Windows installer found at the top of the page.
  7. Download the .msi installer for windows, using the LTS version of Node.
  8. Decide what you want to call your project. We will refer to it now as $project.
  9. Initialise a project by running composer create-project laravel/laravel $project in powershell.
  10. Enter the directory of your new project via powershell by running cd ./$project
  11. Install composer packages by running composer install
  12. Install NPM packages by running npm install
  13. Setup environment file by running cp .env.example .env
  14. Generate your application key: php artisan key:generate
  15. Open docker desktop and wait till it has initialised.
  16. Run this command in command line: docker pull postgres then run docker pull dpage/pgadmin4
  17. Inside docker, navigate to images tab on the left and find postgres in the list.
  18. Hover your mouse over postgres and press the run button located to the right of it.
  19. In the menu, dropdown the section which says optional settings and enter the following information:
    • container name - Give the container a name, this can just be postgres
    • ports - Give the container a port which you will use to access the container, this can just be 5432 which is the default.
    • In the environment variables section create the following:
      • POSTGRES_PASSWORD - Set this as the variable then in the value, create a no-space password which you will use to access the database.
  20. Press run to start the postgres server.
  21. If you are connecting your application to a database, add the URL and credentials to .env:
    • DB_HOST - Using docker, this would just be localhost.
    • DB_CONNECTION - In this example, we use postgres so pgsql would go here.
    • DB_PORT - This would be whatever you set as the port on docker when you created the container.
    • DB_DATABASE - Name of the database that we will be creating.
    • DB_USERNAME - For this example, this is simply postgres.
    • DB_PASSWORD - Whatever you set the docker container environment variable to.
  22. Run php artisan migrate to set up the database with any migrations that you might have.
  23. Compile assets by npm run dev
  24. Start the server: php artisan serve
  25. Visit your server on http://localhost:8000

You may get an error about a missing .env file which I do not source control since it has credentials in it.

Versioning

This repository follows semantic versioning: MAJOR . MINOR . PATCH.

The versioning has been introduced into the repository a bit late but has now been implemented and will be used from now on.

  • Alpha (Not part of versioning)
  • Beta (Currently in Beta)
  • Public Beta Testing
  • Initial release (31st April 2023)

Testing

Testing should be completed and successful before accepting any pull requests into the repository.

Tests can be run via the command line using the following command in the root directory of the project:

php artisan test

Tests can be located inside /tests/feature/ directory.

Notifications

Study Portal will have a lot of cross application notification integration that initially will be heavily based around JSON webhooks.

Below are a list of methods that you will be able to receive notifications:

  • Microsoft Teams - This has been requested upon some feedback that I received and made it clear that it would be quite a good idea and an alternative way to get into contact with students regarding any new assignments that they may have.
  • Email - This would be one of the main ways of notifying students of updates on the platform that would be targeted towards them.
  • Text message - I aim for this to be one of the other notifying channels that most of the students would use since I am assuming that most students would have phones that they can check when they get a notification.
  • Discord - This is the main notification channel for testing initially but could be used on a wider scope on a per-person basis but would require webhook relationships with users which is not a thing yet. Further investigation is required for this.
  • Twitter - This might not make it to the final release since I cannot see it being used.

Suggestions are welcome for other notification channels but would need some sort of justification.

Issue tracking

I am still yet to create the templates for issues

If you come across any issues on the website that is causing you problems, please take a moment to either email me if you do not have a GitHub account and choose not to create one or feel free to create an issue on this repository which will be reviewed and looked into resolving. You may be asked for further details on it or how to recreate the issue so please make sure to check your GitHub notifications a few days after you submit the issue. You can email me at: [email protected].

You can do this in the issues tab. If you are not sure of where this is then here is a link - https://github.com/WillTheDeveloper/StudyPortal/issues

Feature suggestions

  • If you have the skills to build it yourself then you should create a pull request with it. If you need some information or anything that is database related then contact me directly.
  • If you would just like to suggest something then, create a discussions page, and we can look into implementing it.

Contribute to Study Portal

You can contribute to this repository by forking it, making the changes that you want and then placing a pull request with all the details of what you have changed/added/deleted. Any questions, please visit my profile and email me.

What does it look like at the moment?

PLEASE NOTE THAT THIS IS STILL IN BETA AND IS NOT THE FINAL PRODUCT.....YET

User dashboard

image

User Timetable

Not fully populated

image

User Assignments

Empty

image

User calandar

image

User Kanban

image

User Todo lists

image

User Notes section

image

Tutor Group management

image

Admin User Management

image

Admin Report Overview

image

Institution management area

image

Community home page

image

Community communities area

image

Community placements page

image

Student applications management page

image

User's resources page

image

Tutor's incoming tickets page

image

User profile management page

image

studyportal's People

Contributors

amardikamahdi avatar deepsourcebot avatar dependabot[bot] avatar gruce avatar kkumar-gcc avatar mauro-balades avatar restyled-commits avatar willthedeveloper avatar

Stargazers

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

Watchers

 avatar

studyportal's Issues

Community pages error due to incorrect SQL query

So, the following pages cannot be currently accessed:

  • Trending
  • Popular
  • Communities

All give "404" errors.

This is because, Laravel is trying to query "Trending" or the associated page for the community user page which is a different route entirely.

public function profile($id)
    {
        return view('communityuser', [
            'user' => User::query()->where('users.id', $id)->findOrFail($id)
        ]);
    }

This is the page that should display the user profile.

But that should not be being executed as this route is being hit from the routes to the controller:

Which is left blank for testing purposes

public function popular()
    {
        return view('popular');
    }

    public function communities()
    {
        return view('communities');
    }

    public function trending()
    {
        return view('trending');
    }

When trying to open one of the three pages outlined in the beginning, I noticed this incorrect query being executed which brought me to this conclusion. Laravel is trying to find a user with the ID of "trending" or one of the three outlined above which is incorrect.

select * from `users` where `users`.`id` = 'trending' and `users`.`id` = 'trending' limit 1

Not sure why this is happening, I will outline the web routes for these below.

Route::get('/community/post/{id}', [Community::class, 'post'])
    ->middleware('auth')
    ->name('community.post');

Route::get('/community/{id}', [Community::class, 'profile'])
    ->middleware('auth')
    ->name('community.profile');

Route::get('/community/popular', [Community::class, 'popular'])
    ->middleware('auth')
    ->name('community.popular');

Route::get('/community/communities', [Community::class, 'communities'])
    ->middleware('auth')
    ->name('community.communities');

Route::get('/community/trending', [Community::class, 'trending'])
    ->middleware('auth')
    ->name('community.trending');

DEVELOPMENT NOTICE: In effect 25th March to 18th April

Development notice

Me (@WillTheDeveloper) will be going on holiday between the 25th March and 18th April, therefore my availability during this time will be lower than usual.

The time difference between the UK and where I am going is that I will be 3 hours behind. Meaning when it is 8AM in the UK, it will be 5AM for me.

I will have my phone and internet access for most of the time and will receive all notifications that come through.

The easiest way to contact me would either be discord(WillDotChill#2156) or email. Or just send me a message via this channel if required.

Issues will be able to be responded to very quickly. While any big pull requests that I can't validate while I am there will have to wait till I either get back or some sort of testing to validate it works has been taken.

Deleting posts should delete associated data

At the moment, posts only delete the post but with no associated data. The view for viewing the posts is still WIP hence why this is something I am pointing out.

Fixes for this can be located in the Community controller as shown below.

image

Subscription routes outdated

Since I sorted the routes for making subscriptions to a user, the tests for the pages will no longer be correct and need updating.

Github auth needs a password when creating the user

I have setup Github auth to work with the login system.

All the other details regarding the user are able to be retrieved from Github except for passwords for obvious reasons.

I did move the Third party authentication to its own controller.

I have added the following fields to the users table, copied from the migration:

$table->integer('github_id')->nullable(true)->default(null);
$table->string('github_token')->nullable(true)->default(null);
$table->string('github_refresh_token')->nullable(true)->default(null);

Maybe I will just generate a password automatically then let the user change it accordingly.

This is the new controller that handles the callback from github once they have authenticated themselves on it:

public function githubCallback()
    {
        $githubUser = Socialite::driver('github')->user();

        $user = \App\Models\User::query()->where('users.github_id', $githubUser->id)->first();

        if ($user) {
            $user->update([
                'github_token' => $githubUser->token,
                'github_refresh_token' => $githubUser->refreshToken,
            ]);
        } else {
            $user = \App\Models\User::query()->create([
                'name' => $githubUser->name,
                'email' => $githubUser->email,
                'github_id' => $githubUser->id,
                'github_token' => $githubUser->token,
                'github_refresh_token' => $githubUser->refreshToken,
            ]);
        }

        Auth::login($user);

        return redirect('/dashboard');
    }

The password is also hashed and I am worried about making a security vulnerability. Further investigation is required.

Can't get Kanban to show items in correct place.

Trying to figure out why the items wont show in there proper groups or why they won't show at all when you select the specific group that they should be in.

  • Create the table
  • Create the card
  • Display the data in each field
  • Show all the groups
  • Get them to show in correct places

image

[BUG]: Cant join a community

What happened?

When i try to join a community it takes me to 403 page saying i dont have permission to do that.

Browser

Firefox

When did it occur?

16/12/2022 - 12:40

Add common sections to components.

Here is one idea. You could change common sections of study portal and convert them to a component.

Why?

  • This will make every HTML element update for every page instead of updating every page one by one.
    • e.g. You update a button in the navbar to another color.

What components?

  • Buttons
  • Navbar
  • Post container

and more stuff

Can only add one student at a time to a group

The current select for adding students to a group is a multiple select box.

The method that attaches the students to the group allows for a array of students.

Maybe use dd() to diagnose.

Boolean issue with assignment per student for tutors

When looking at students and who has handed in their assignments, it does not update when the record is updated in the database.

One piece of data is stored as a boolean which will be updated when a student looks at the assignment.

While the other piece of data is a datetime data type which gets updated when the student submits.

The default for the bool is zero and the default for datetime is null.

Bool being returned in collection on blade

Originated from: 2b515a4

I am trying to get "/community/communities" to return all the different subjects that are found in the database.

When I reference the table inside the foreach statement which the collection is generated in the controller, it looks for a bool when the data being stored is not a boolean type and should just be a string of text.

This is the controller:

public function communities()
    {
        return view('communities', [
            'subject' => Subject::all()
        ]);
    }

This is the migration for subjects:

public function up()
    {
        Schema::create('subjects', function (Blueprint $table) {
            $table->id();
            $table->string('subject')->unique();
            $table->timestamps();
        });
    }

This is the GET request in the routes file in case your wondering:

Route::get('/community/communities', [Community::class, 'communities'])
    ->middleware('auth')
    ->name('community.communities');

This is the start of the foreach statement in the blade file:

@forelse($posts as $post)

While this issue is a thing, I have commented out a lot of the blade file to avoid experiencing any errors.

Tutors can be added to groups

Tutors are able to get added to groups. Which is a problem because whoever created it can add themselves which doesn't actually do anything.

A solution for this would be to update the controller for groups so that the SQL will only get students and not tutors by using the where statement to only select users that are not students. I did previously try this but experienced issues, can follow up.

Maybe this could be a feature but it should at least not allow for tutors to add themselves, this can be confusing.

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.