Skip to content

Commit

Permalink
Merge pull request #32 from relaxxpls/master
Browse files Browse the repository at this point in the history
[v1.1.0] Add timetable builder
  • Loading branch information
relaxxpls authored Oct 28, 2021
2 parents 77af88b + affa800 commit 2967185
Show file tree
Hide file tree
Showing 27 changed files with 3,838 additions and 3,983 deletions.
48 changes: 24 additions & 24 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,36 @@ events {
}

http {
# types to include
include /etc/nginx/mime.types;
# default type
default_type application/octet-stream;
# types to include
include /etc/nginx/mime.types;
# default type
default_type application/octet-stream;

server {
# listen on port 80
listen 80;
server {
# listen on port 80
listen 80;

# for DO, use YOUR_DROPLET_IP
server_name localhost;
# for DO, use YOUR_DROPLET_IP
server_name localhost;

# logs file
access_log /var/log/nginx/access.log compression;
# logs file
access_log /var/log/nginx/access.log compression;


root /usr/share/nginx/html;
# file to server as index
index index.html index.htm;
root /usr/share/nginx/html;
# file to server as index
index index.html index.htm;

gzip on;
gzip_min_length 1000;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip on;
gzip_min_length 1000;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;

location / {
# First attempt to serve request as file, then
# as directory, then fall back to redirecting to index.html
try_files $uri $uri/ /index.html;
}
location / {
# First attempt to serve request as file, then
# as directory, then fall back to redirecting to index.html
try_files $uri $uri/ /index.html;
}

}
}
}
48 changes: 24 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,47 +17,47 @@
"lint:css": "stylelint src/**/*.{js,jsx} --fix"
},
"dependencies": {
"@reduxjs/toolkit": "^1.6.0",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"antd": "^4.16.7",
"axios": "^0.21.1",
"date-fns": "^2.23.0",
"@reduxjs/toolkit": "^1.6.2",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.1.2",
"@testing-library/user-event": "^13.5.0",
"antd": "^4.16.13",
"axios": "^0.23.0",
"date-fns": "^2.25.0",
"dompurify": "^2.3.3",
"js-cookie": "^2.2.1",
"js-cookie": "^3.0.1",
"lodash": "^4.17.21",
"nanoid": "^3.1.25",
"nanoid": "^3.1.30",
"polished": "^4.1.3",
"prop-types": "^15.7.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-dropzone": "^11.3.4",
"react-helmet-async": "^1.0.9",
"react-markdown": "^7.0.0",
"react-pdf": "^5.3.2",
"react-dropzone": "^11.4.2",
"react-helmet-async": "^1.1.2",
"react-markdown": "^7.0.1",
"react-pdf": "^5.4.0",
"react-quill": "2.0.0-beta.4",
"react-redux": "^7.2.4",
"react-router-dom": "^5.2.0",
"react-redux": "^7.2.5",
"react-router-dom": "^5.3.0",
"react-scripts": "4.0.3",
"react-toastify": "^7.0.4",
"react-toastify": "^8.0.3",
"react-transition-group": "^4.4.2",
"redux-persist": "^6.0.0",
"remark-gfm": "^2.0.0",
"styled-components": "^5.3.0",
"styled-icons": "^10.33.0",
"web-vitals": "^1.0.1"
"remark-gfm": "^3.0.0",
"styled-components": "^5.3.1",
"styled-icons": "^10.45.0",
"web-vitals": "^2.1.2"
},
"devDependencies": {
"eslint-config-airbnb": "^18.2.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-promise": "^5.1.0",
"prettier": "^2.3.2",
"prettier": "^2.4.1",
"redux-logger": "^3.0.6",
"sass": "^1.35.2",
"sass": "^1.43.2",
"stylelint": "^13.13.1",
"stylelint-config-prettier": "^8.0.2",
"stylelint-config-prettier": "^9.0.3",
"stylelint-config-standard": "^22.0.0",
"stylelint-config-styled-components": "^0.1.1",
"stylelint-order": "^4.1.0",
Expand Down
5 changes: 4 additions & 1 deletion src/api/SSO.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
export const SSO = {
HOST: 'https://gymkhana.iitb.ac.in/sso/oauth/authorize/',
CLIENT_ID: '6zMDj3RzgMctmdpvlPdouZKcj1ABlSkAB6snbYy5',
BASE_REDIRECT_URI: 'http://localhost:3000/login',
BASE_REDIRECT_URI:
process.env.NODE_ENV === 'development'
? 'http://localhost:3000/login'
: 'http://10.105.177.70/login',
SCOPE: 'basic profile picture ldap program',
RESPONSE_TYPE: 'code',
}
Expand Down
21 changes: 20 additions & 1 deletion src/api/api-config.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import { toastError } from 'components/toast'
import { camelizeKeys, snakeizeKeys } from 'helpers/transformKeys'

export const APIInstance = axios.create({
baseURL: 'http://localhost:8000/api',
baseURL:
process.env.NODE_ENV === 'development'
? 'http://localhost:8000/api'
: 'http://10.105.177.70/api',

timeout: 30000,
xsrfCookieName: 'csrftoken',
xsrfHeaderName: 'X-CSRFToken',
Expand Down Expand Up @@ -71,6 +75,17 @@ export const API = {
},

feed: async () => APIInstance.get('/accounts/profile/feed'),

timetable: {
read: async ({ season, year }) =>
APIInstance.get(
`/accounts/profile/semester/${season}-${year}/timetable`
),
add: async ({ id }) =>
APIInstance.put(`/accounts/profile/timetable/${id}`),
remove: async ({ id }) =>
APIInstance.delete(`/accounts/profile/timetable/${id}`),
},
},

// * Courses endpoints
Expand Down Expand Up @@ -136,6 +151,10 @@ export const API = {
detail: async ({ slug }) => APIInstance.get(`/departments/${slug}`),
},

semesters: {
list: async () => APIInstance.get('/semesters'),
},

// * Developer stats endpoints
GitHub: {
getContributors: async () => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/CourseFinder/CourseContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ const CourseFinderContainer = () => {
page: filter.p,
department: filter.department,
is_half_semester: filter.halfsem,
credit_min: filter.credit_min,
credit_max: filter.credit_max,
credits_min: filter.credits_min,
credits_max: filter.credits_max,
semester: filter.semester,
}

Expand Down
6 changes: 3 additions & 3 deletions src/components/CourseFinder/item/CourseItemMain.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import styled, { css } from 'styled-components/macro'
import { API } from 'api'
import { ButtonIcon } from 'components/shared'
import { toastError } from 'components/toast'
import { coursePageUrl } from 'paths'
import { coursePageUrl } from 'helpers/format'
import { selectDepartments } from 'store/courseSlice'
import { selectFavouriteStatus, updateFavourite } from 'store/userSlice'
import { device, fontSize } from 'styles/responsive'
Expand All @@ -17,7 +17,7 @@ import ParseDescription from '../ParseDescription'

const CourseItemMain = ({ courseData }) => {
const dispatch = useDispatch()
const { code, credit, department, title, description } = courseData
const { code, credits, department, title, description } = courseData

const [loading, setLoading] = useState(false)

Expand Down Expand Up @@ -54,7 +54,7 @@ const CourseItemMain = ({ courseData }) => {
</DepartmentContainer>

<RightIcons>
<CreditContainer small={credit > 9}>{credit}</CreditContainer>
<CreditContainer small={credits > 9}>{credits}</CreditContainer>

<ButtonIcon
tooltip="Add to favorites"
Expand Down
Loading

0 comments on commit 2967185

Please sign in to comment.