Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open Links in new tab enhancement #21

Closed
wants to merge 42 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
ef5b9a8
Updated README.md
Ananyaiitbhilai Jun 7, 2021
fa7f77c
Update README.md
Ananyaiitbhilai Jun 8, 2021
6aa936a
project init
ashutosh321607 Jun 8, 2021
0cfec55
Create Django Backend
aastha1999 Jun 23, 2021
6c9285d
Add database structure
aastha1999 Jul 4, 2021
708ffa3
update dbmodel
aastha1999 Jul 5, 2021
d27288e
Update README.md
ashutosh321607 Nov 23, 2021
66b70ef
Merge pull request #2 from Ananyaiitbhilai/patch-1
ashutosh321607 Dec 22, 2021
1e6ea42
Merge pull request #3 from Ananyaiitbhilai/patch-2
ashutosh321607 Dec 22, 2021
95c8e66
Update README.md
ashutosh321607 Dec 22, 2021
95bd951
Created basic UI and added routes
battuAshita Dec 27, 2021
a9e4bd8
Merge pull request #7 from battuAshita/Foss-1
ashutosh321607 Dec 29, 2021
04f9e97
Created UI for Notes, PYQ page
battuAshita Jan 1, 2022
89f2411
Updated pages
battuAshita Jan 3, 2022
1b03f35
Merge pull request #9 from battuAshita/Foss-1
ashutosh321607 Jan 5, 2022
1f0b9bb
Code cleanup
battuAshita Jan 8, 2022
0e7370b
Removed commented code
battuAshita Jan 8, 2022
1ba90a9
Used const instead of let in SideBar.js
battuAshita Jan 8, 2022
19c3d64
Merge pull request #10 from battuAshita/Foss-1
ashutosh321607 Jan 8, 2022
1ae3d5e
add search box
ashutosh321607 Jan 8, 2022
d595fb4
full revamp
Jan 19, 2022
e8b4abc
Merge pull request #12 from Ananyaiitbhilai/master
ExpressHermes Jan 19, 2022
742ef82
Created responsive web design
battuAshita Jan 19, 2022
9eeccc8
Added active className to nav links
battuAshita Jan 20, 2022
53a1781
Added search feature to filter Notes, PYQs etc. by Course ID and Inst…
battuAshita Jan 20, 2022
9a10be0
Increased font-size for the search text
battuAshita Jan 20, 2022
5241b7b
Added README.md
battuAshita Jan 20, 2022
ee70d3b
Added README.md
battuAshita Jan 20, 2022
537339e
Made changes to README.md
battuAshita Jan 20, 2022
ad2a4cc
Changed '/home' route to '/'
battuAshita Jan 20, 2022
5a06995
Changed models.py
battuAshita Jan 20, 2022
9183d21
Added select dropdown for 'Batch' in form
battuAshita Jan 20, 2022
22f8136
Added NewForm.js for each page
battuAshita Jan 21, 2022
50a531e
Added filter by course name
battuAshita Jan 21, 2022
b19c5eb
Minor changes made
battuAshita Jan 21, 2022
6dcf836
Removed default dropdown value
battuAshita Jan 21, 2022
5eff598
Removed error in Feedback form
battuAshita Jan 21, 2022
d40529a
Removed error to filter by course name
battuAshita Jan 22, 2022
db8c861
Changed style of tables
battuAshita Jan 22, 2022
6dd8ed6
full deployment on heroku
Jan 22, 2022
61b79ef
Merge pull request #14 from Ananyaiitbhilai/master
ExpressHermes Jan 22, 2022
0ef3272
Open Links in new tab enhancement
TanishkM Oct 5, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
**/.env
node_modules
*.sqlite3
venv/
**/__pycache__/
.DS_Store
2 changes: 2 additions & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
release: python manage.py migrate
web: gunicorn ksp.wsgi --log-file -
38 changes: 20 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
# knowlege-sharing-platform
A Internal collage application to share study notes and reviews for professors and courses.
### Install the virtual env
`sudo apt install -y python3-venv activate`

## ❓ Problem Statement
Our Motive is to create a cross-platform application for student benefit. In the application student can share courses feedback, study notes, professor's feedback etc. So Before taking a courses other student can know more about professor and course.
Shared notes and important question can be useful guide for students to score good in that course.
### Create the virtual env.
`python3 -m venv <env name>`

### Activate your virtual environment
`source <env_name>/bin/activate`

## :sparkles: Features
- A Cross Platform Application so people can use them anywhere anytime.
- Tech Stack : Django anb React/Angular(TBD)
### Install the dependencies for backend
`pip install django djangorestframework django-cors-headers`

### Apply migrations
`python manage.py migrate`

## Code Contributors
### Run the backend server:
`python manage.py runserver`

The success of our vision to bring knowledge to every single hand depends on you. Even a small contribution helps. All forms of contributions are highly welcomed and valued.
Open a new terminal and do the following:

## 🧑‍🏫 Maintainers
### Navigate to the frontend folder
`cd ksp_frontend`

To keep the quality intact and drive the vision in the proper direction, we have maintainers.
### Install the dependencies for frontend
`npm install`

> Maintainers are your friends forever. They are vastly different from moderators.
#### Run the frontend server
`npm start`

Currently, we have 2 active maintainers and we are expanding quickly.
The task of maintainers is to review pull requests, suggest further quality additions and keep the work up to date with the current state of the world. <br/>


[check out the current maintainer](https://github.com/OpenLake/knowlege-sharing-platform/wiki/Maintainers)
We have to parallely run frontend and backend servers.
Empty file added api/__init__.py
Empty file.
26 changes: 26 additions & 0 deletions api/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from django.contrib import admin
from .models import Feedback, Note, PreviousYearQuestion


class NoteAdmin(admin.ModelAdmin):
list_display = ('title', 'name', 'course_id', 'course_instructor', 'batch', 'gdrive_link')


# Register your models here.
admin.site.register(Note, NoteAdmin)


class PreviousYearQuestionAdmin(admin.ModelAdmin):
list_display = ('title', 'name', 'course_id', 'course_instructor', 'batch', 'gdrive_link')


# Register your models here.
admin.site.register(PreviousYearQuestion, PreviousYearQuestionAdmin)


class FeedbackAdmin(admin.ModelAdmin):
list_display = ('title', 'name', 'course_id', 'course_instructor', 'batch', 'Feedback')


# Register your models here.
admin.site.register(Feedback, FeedbackAdmin)
6 changes: 6 additions & 0 deletions api/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class ApiConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'api'
65 changes: 65 additions & 0 deletions api/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Generated by Django 4.0.1 on 2022-01-11 07:32

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Course',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('course_id', models.CharField(max_length=10)),
],
),
migrations.CreateModel(
name='Instructor',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('course_instructor', models.CharField(max_length=100)),
],
),
migrations.CreateModel(
name='PreviousYearQuestion',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=120)),
('name', models.CharField(max_length=100)),
('batch', models.IntegerField(choices=[(2016, 2016), (2017, 2017), (2018, 2018), (2019, 2019), (2020, 2020), (2021, 2021), (2022, 2022)])),
('gdrive_link', models.URLField(max_length=500)),
('course_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.course')),
('course_instructor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.instructor')),
],
),
migrations.CreateModel(
name='Note',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=120)),
('name', models.CharField(max_length=100)),
('batch', models.IntegerField(choices=[(2016, 2016), (2017, 2017), (2018, 2018), (2019, 2019), (2020, 2020), (2021, 2021), (2022, 2022)])),
('gdrive_link', models.URLField(max_length=500)),
('course_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.course')),
('course_instructor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.instructor')),
],
),
migrations.CreateModel(
name='Feedback',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=120)),
('name', models.CharField(max_length=100)),
('batch', models.IntegerField(choices=[(2016, 2016), (2017, 2017), (2018, 2018), (2019, 2019), (2020, 2020), (2021, 2021), (2022, 2022)])),
('Feedback', models.CharField(max_length=1000)),
('course_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.course')),
('course_instructor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.instructor')),
],
),
]
49 changes: 49 additions & 0 deletions api/migrations/0002_alter_feedback_course_id_and_more.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Generated by Django 4.0.1 on 2022-01-20 19:22

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('api', '0001_initial'),
]

operations = [
migrations.AlterField(
model_name='feedback',
name='course_id',
field=models.CharField(max_length=10),
),
migrations.AlterField(
model_name='feedback',
name='course_instructor',
field=models.CharField(max_length=100),
),
migrations.AlterField(
model_name='note',
name='course_id',
field=models.CharField(max_length=10),
),
migrations.AlterField(
model_name='note',
name='course_instructor',
field=models.CharField(max_length=100),
),
migrations.AlterField(
model_name='previousyearquestion',
name='course_id',
field=models.CharField(max_length=10),
),
migrations.AlterField(
model_name='previousyearquestion',
name='course_instructor',
field=models.CharField(max_length=100),
),
migrations.DeleteModel(
name='Course',
),
migrations.DeleteModel(
name='Instructor',
),
]
Empty file added api/migrations/__init__.py
Empty file.
43 changes: 43 additions & 0 deletions api/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
from django.db import models
# from vote.models import VoteModel
import datetime

YEAR_CHOICES = []
for year in range(2016, (datetime.datetime.now().year + 1)):
YEAR_CHOICES.append((year, year))


class Note(models.Model):
title = models.CharField(max_length=120)
name = models.CharField(max_length=100)
course_id = models.CharField(max_length=10)
batch = models.IntegerField(choices=YEAR_CHOICES)
course_instructor = models.CharField(max_length=100)
gdrive_link = models.URLField(max_length=500)

def _str_(self):
return self.title


class PreviousYearQuestion(models.Model):
title = models.CharField(max_length=120)
name = models.CharField(max_length=100)
course_id = models.CharField(max_length=10)
batch = models.IntegerField(choices=YEAR_CHOICES)
course_instructor = models.CharField(max_length=100)
gdrive_link = models.URLField(max_length=500)

def _str_(self):
return self.title


class Feedback(models.Model):
title = models.CharField(max_length=120)
name = models.CharField(max_length=100)
course_id = models.CharField(max_length=10)
batch = models.IntegerField(choices=YEAR_CHOICES)
course_instructor = models.CharField(max_length=100)
Feedback = models.CharField(max_length=1000)

def _str_(self):
return self.title
19 changes: 19 additions & 0 deletions api/serializers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from rest_framework import serializers
from .models import Note, PreviousYearQuestion, Feedback

class NoteSerializer( serializers.ModelSerializer):
class Meta:
model = Note
fields = ('pk', 'title','name', 'course_id','course_instructor','batch','gdrive_link')


class PreviousYearQuestionSerializer( serializers.ModelSerializer):
class Meta:
model = PreviousYearQuestion
fields = ('pk', 'title','name', 'course_id','course_instructor','batch','gdrive_link')


class FeedbackSerializer( serializers.ModelSerializer):
class Meta:
model = Feedback
fields = ('pk', 'title','name', 'course_id','course_instructor','batch','Feedback')
3 changes: 3 additions & 0 deletions api/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
72 changes: 72 additions & 0 deletions api/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
from rest_framework.response import Response
from rest_framework.decorators import api_view
from rest_framework import status
from rest_framework import viewsets
from .models import Note, PreviousYearQuestion, Feedback
from .serializers import *
from django.shortcuts import render

class NoteView(viewsets.ModelViewSet):
serializer_class = NoteSerializer
queryset = Note.objects.all()

@api_view(['GET', 'POST'])
def Note_list(request):
if request.method == 'GET':
data = Note.objects.all()

serializer = NoteSerializer(data, context={'request': request}, many=True)

return Response(serializer.data)

elif request.method == 'POST':
serializer = NoteSerializer(data=request.data)
if serializer.is_valid():
serializer.save()
return Response(status=status.HTTP_201_CREATED)

return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)


class PreviousYearQuestionView(viewsets.ModelViewSet):
serializer_class = PreviousYearQuestionSerializer
queryset = PreviousYearQuestion.objects.all()

@api_view(['GET', 'POST'])
def PreviousYearQuestion_list(request):
if request.method == 'GET':
data = PreviousYearQuestion.objects.all()

serializer = PreviousYearQuestionSerializer(data, context={'request': request}, many=True)

return Response(serializer.data)

elif request.method == 'POST':
serializer = PreviousYearQuestionSerializer(data=request.data)
if serializer.is_valid():
serializer.save()
return Response(status=status.HTTP_201_CREATED)

return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)


class FeedbackView(viewsets.ModelViewSet):
serializer_class = Feedback
queryset = Feedback.objects.all()

@api_view(['GET', 'POST'])
def Feedback_list(request):
if request.method == 'GET':
data = Feedback.objects.all()

serializer = FeedbackSerializer(data, context={'request': request}, many=True)

return Response(serializer.data)

elif request.method == 'POST':
serializer = FeedbackSerializer(data=request.data)
if serializer.is_valid():
serializer.save()
return Response(status=status.HTTP_201_CREATED)

return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
15 changes: 15 additions & 0 deletions build/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"files": {
"main.css": "/static/css/main.41f6da04.css",
"main.js": "/static/js/main.4462ab59.js",
"static/js/787.be296255.chunk.js": "/static/js/787.be296255.chunk.js",
"index.html": "/index.html",
"main.41f6da04.css.map": "/static/css/main.41f6da04.css.map",
"main.4462ab59.js.map": "/static/js/main.4462ab59.js.map",
"787.be296255.chunk.js.map": "/static/js/787.be296255.chunk.js.map"
},
"entrypoints": [
"static/css/main.41f6da04.css",
"static/js/main.4462ab59.js"
]
}
Binary file added build/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions build/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>Knowledge Sharing Platform</title><script defer="defer" src="/static/js/main.4462ab59.js"></script><link href="/static/css/main.41f6da04.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
Binary file added build/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions build/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
Loading