Skip to content
Open
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
fbbe467
Pending changes exported from your codespace
vihar2712 Jun 24, 2025
755012e
grades controller finished
vihar2712 Aug 5, 2025
a1878ad
Merged main branch into join-team-requests-and-invitations
vihar2712 Aug 11, 2025
cd798c6
team hierarchy still unresolved. authorization module included.
vihar2712 Aug 21, 2025
65bf36b
/api/v1 removed
vihar2712 Oct 1, 2025
61e8698
modified invitation model
vihar2712 Oct 1, 2025
8985131
modified student_teams controller - made use of serializer, sending c…
vihar2712 Oct 6, 2025
04e31e6
methods inside student_teams added
vihar2712 Oct 12, 2025
9f8d758
retract, accept, reject invitation working
vihar2712 Oct 13, 2025
f0ebf63
added authorization inside invitations controller
vihar2712 Oct 17, 2025
4c80523
modified invitations controller
vihar2712 Oct 27, 2025
61a437b
added invitations sent by participant route and method
vihar2712 Oct 29, 2025
ec90caa
added methods for performing crud operations on advertisement inside …
vihar2712 Nov 5, 2025
2952a55
single action_allowed? method implemented
vatsal-dp Nov 15, 2025
ffd3251
Review and validate the existing controller methods, ensuring they ar…
vatsal-dp Nov 15, 2025
36ea31b
common database
devyash2930 Nov 15, 2025
2cfda59
signup data
vatsal-dp Nov 15, 2025
dd2ace3
joining team requests implemented
smitraval24 Nov 15, 2025
c129b97
adding data for the requests and joins
smitraval24 Nov 15, 2025
e08e826
Implement email notifications for accepted join team requests and inv…
smitraval24 Nov 26, 2025
ee37683
adding test cases
smitraval24 Nov 26, 2025
44730b9
test case integrated
smitraval24 Nov 27, 2025
cdba488
axios
devyash2930 Dec 3, 2025
99b1aa2
fix change teams
vatsal-dp Dec 3, 2025
053260c
Model tests
devyash2930 Dec 5, 2025
03ddc9d
removed /api/v1 nomenclature from the system (#210)
vihar2712 Sep 25, 2025
8d29a89
Ndt2000 patch 1 (#215)
NDT2000 Oct 8, 2025
5bd77e7
Changed Rails Version (#211)
prithishsamanta Oct 8, 2025
cade60b
E2555: Backend for Participants page (#222)
SeojinSeojin Nov 16, 2025
354f97c
Added teams columns like shown on the website
SpencerKersey Nov 16, 2025
be5bbd6
Finish Grades controller (#229)
vihar2712 Nov 20, 2025
9d7c8f7
grades controller finished
vihar2712 Aug 5, 2025
4e8539b
team hierarchy still unresolved. authorization module included.
vihar2712 Aug 21, 2025
648d82f
/api/v1 removed
vihar2712 Oct 1, 2025
d8a4e9f
modified invitation model
vihar2712 Oct 1, 2025
811b875
modified student_teams controller - made use of serializer, sending c…
vihar2712 Oct 6, 2025
e54d0cf
methods inside student_teams added
vihar2712 Oct 12, 2025
a38a2bc
retract, accept, reject invitation working
vihar2712 Oct 13, 2025
e88006f
added authorization inside invitations controller
vihar2712 Oct 17, 2025
0943fa8
modified invitations controller
vihar2712 Oct 27, 2025
b0c3165
added invitations sent by participant route and method
vihar2712 Oct 29, 2025
58b5d2f
added methods for performing crud operations on advertisement inside …
vihar2712 Nov 5, 2025
f0c23d0
single action_allowed? method implemented
vatsal-dp Nov 15, 2025
3b18df2
Review and validate the existing controller methods, ensuring they ar…
vatsal-dp Nov 15, 2025
71f3a21
signup data
vatsal-dp Nov 15, 2025
5e02494
joining team requests implemented
smitraval24 Nov 15, 2025
ad0107a
Implement email notifications for accepted join team requests and inv…
smitraval24 Nov 26, 2025
283117d
test case integrated
smitraval24 Nov 27, 2025
d726264
axios
devyash2930 Dec 3, 2025
e998444
fix change teams
vatsal-dp Dec 3, 2025
a214139
Model tests
devyash2930 Dec 5, 2025
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
17 changes: 17 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"sqltools.connections": [
{
"mysqlOptions": {
"authProtocol": "default",
"enableSsl": "Disabled"
},
"previewLimit": 50,
"server": "0.0.0.0",
"port": 3307,
"driver": "MySQL",
"database": "reimplementation_development",
"username": "root",
"name": "devexpertiza"
}
]
}
48 changes: 24 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
FROM ruby:3.2.7

LABEL maintainer="Ankur Mundra <[email protected]>"
# Install dependencies
RUN apt-get update && \
apt-get install -y curl && \
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
apt-get install -y nodejs && \
apt-get install -y netcat-openbsd

# Set the working directory
WORKDIR /app

# Copy your application files from current location to WORKDIR
COPY . .

# Install Ruby dependencies
RUN gem update --system && gem install bundler:2.4.7
RUN bundle install

EXPOSE 3002

# Set the entry point
ENTRYPOINT ["/app/setup.sh"]
FROM ruby:3.2.7
LABEL maintainer="Ankur Mundra <[email protected]>"
# Install dependencies
RUN apt-get update && \
apt-get install -y curl && \
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
apt-get install -y nodejs && \
apt-get install -y netcat-openbsd
# Set the working directory
WORKDIR /app
# Copy your application files from current location to WORKDIR
COPY . .
# Install Ruby dependencies
RUN gem update --system && gem install bundler:2.4.7
RUN bundle install
EXPOSE 3002
# Set the entry point
ENTRYPOINT ["/app/setup.sh"]
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '3.2.7'

gem 'mysql2', '~> 0.5.5'
gem 'puma', '~> 5.0'
gem 'puma', '~> 6.0'
gem 'rails', '~> 8.0', '>= 8.0.1'
gem 'rswag-api'
gem 'rswag-ui'
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ GEM
date
stringio
public_suffix (5.0.3)
puma (5.6.6)
puma (6.6.1)
nio4r (~> 2.0)
racc (1.7.1)
rack (2.2.8)
Expand Down Expand Up @@ -390,7 +390,7 @@ DEPENDENCIES
jwt (~> 2.7, >= 2.7.1)
lingua
mysql2 (~> 0.5.5)
puma (~> 5.0)
puma (~> 6.0)
rack-cors
rails (~> 8.0, >= 8.0.1)
rspec-rails
Expand Down
202 changes: 101 additions & 101 deletions app/controllers/api/v1/bookmarks_controller.rb
Original file line number Diff line number Diff line change
@@ -1,101 +1,101 @@
class Api::V1::BookmarksController < ApplicationController
rescue_from ActiveRecord::RecordNotFound, with: :not_found

def action_allowed?
has_privileges_of?('Student')
end
# Index method returns the list of JSON objects of the bookmark
# GET on /bookmarks
def index
@bookmarks = Bookmark.order(:id)
render json: @bookmarks, status: :ok and return
end

# Show method returns the JSON object of bookmark with id = {:id}
# GET on /bookmarks/:id
def show
begin
@bookmark = Bookmark.find(params[:id])
render json: @bookmark, status: :ok and return
rescue ActiveRecord::RecordNotFound
render json: $ERROR_INFO.to_s, status: :not_found and return
end
end

# Create method creates a bookmark and returns the JSON object of the created bookmark
# POST on /bookmarks
def create
begin
# params[:user_id] = @current_user.id
@bookmark = Bookmark.new(bookmark_params)
@bookmark.user_id = @current_user.id
@bookmark.save!
render json: @bookmark, status: :created and return
rescue ActiveRecord::RecordInvalid
render json: $ERROR_INFO.to_s, status: :unprocessable_entity
end
end

# Update method updates the bookmark object with id - {:id} and returns the updated bookmark JSON object
# PUT on /bookmarks/:id
def update
@bookmark = Bookmark.find(params[:id])
if @bookmark.update(update_bookmark_params)
render json: @bookmark, status: :ok
else
render json: @bookmark.errors.full_messages, status: :unprocessable_entity
end
end

# Handle the case when an invalid bookmark id is being passed
def not_found
render json: { error: "Couldn't find Bookmark" }, status: :not_found
end

# Destroy method deletes the bookmark object with id- {:id}
# DELETE on /bookmarks/:id
def destroy
begin
@bookmark = Bookmark.find(params[:id])
@bookmark.delete
rescue ActiveRecord::RecordNotFound
render json: $ERROR_INFO.to_s, status: :not_found and return
end
end

# get_bookmark_rating_score method gets the bookmark rating of the bookmark object with id- {:id}
# GET on /bookmarks/:id/bookmarkratings
def get_bookmark_rating_score
begin
@bookmark = Bookmark.find(params[:id])
@bookmark_rating = BookmarkRating.where(bookmark_id: @bookmark.id, user_id: @current_user.id).first
render json: @bookmark_rating, status: :ok and return
rescue ActiveRecord::RecordNotFound
render json: $ERROR_INFO.to_s, status: :not_found and return
end
end

# save_bookmark_rating_score method creates or updates the bookmark rating of the bookmark object with id- {:id}
# POST on /bookmarks/:id/bookmarkratings
def save_bookmark_rating_score
@bookmark = Bookmark.find(params[:id])
@bookmark_rating = BookmarkRating.where(bookmark_id: @bookmark.id, user_id: @current_user.id).first
if @bookmark_rating.blank?
@bookmark_rating = BookmarkRating.create(bookmark_id: @bookmark.id, user_id: @current_user.id, rating: params[:rating])
else
@bookmark_rating.update({'rating': params[:rating].to_i})
end
render json: {"bookmark": @bookmark, "rating": @bookmark_rating}, status: :ok
end

private

def bookmark_params
params.require(:bookmark).permit(:url, :title, :description, :topic_id, :rating, :id)
end

def update_bookmark_params
params.require(:bookmark).permit(:url, :title, :description)
end

end
class Api::V1::BookmarksController < ApplicationController
rescue_from ActiveRecord::RecordNotFound, with: :not_found
def action_allowed?
current_user_has_student_privileges?
end
# Index method returns the list of JSON objects of the bookmark
# GET on /bookmarks
def index
@bookmarks = Bookmark.order(:id)
render json: @bookmarks, status: :ok and return
end
# Show method returns the JSON object of bookmark with id = {:id}
# GET on /bookmarks/:id
def show
begin
@bookmark = Bookmark.find(params[:id])
render json: @bookmark, status: :ok and return
rescue ActiveRecord::RecordNotFound
render json: $ERROR_INFO.to_s, status: :not_found and return
end
end
# Create method creates a bookmark and returns the JSON object of the created bookmark
# POST on /bookmarks
def create
begin
# params[:user_id] = @current_user.id
@bookmark = Bookmark.new(bookmark_params)
@bookmark.user_id = @current_user.id
@bookmark.save!
render json: @bookmark, status: :created and return
rescue ActiveRecord::RecordInvalid
render json: $ERROR_INFO.to_s, status: :unprocessable_entity
end
end
# Update method updates the bookmark object with id - {:id} and returns the updated bookmark JSON object
# PUT on /bookmarks/:id
def update
@bookmark = Bookmark.find(params[:id])
if @bookmark.update(update_bookmark_params)
render json: @bookmark, status: :ok
else
render json: @bookmark.errors.full_messages, status: :unprocessable_entity
end
end
# Handle the case when an invalid bookmark id is being passed
def not_found
render json: { error: "Couldn't find Bookmark" }, status: :not_found
end
# Destroy method deletes the bookmark object with id- {:id}
# DELETE on /bookmarks/:id
def destroy
begin
@bookmark = Bookmark.find(params[:id])
@bookmark.delete
rescue ActiveRecord::RecordNotFound
render json: $ERROR_INFO.to_s, status: :not_found and return
end
end
# get_bookmark_rating_score method gets the bookmark rating of the bookmark object with id- {:id}
# GET on /bookmarks/:id/bookmarkratings
def get_bookmark_rating_score
begin
@bookmark = Bookmark.find(params[:id])
@bookmark_rating = BookmarkRating.where(bookmark_id: @bookmark.id, user_id: @current_user.id).first
render json: @bookmark_rating, status: :ok and return
rescue ActiveRecord::RecordNotFound
render json: $ERROR_INFO.to_s, status: :not_found and return
end
end
# save_bookmark_rating_score method creates or updates the bookmark rating of the bookmark object with id- {:id}
# POST on /bookmarks/:id/bookmarkratings
def save_bookmark_rating_score
@bookmark = Bookmark.find(params[:id])
@bookmark_rating = BookmarkRating.where(bookmark_id: @bookmark.id, user_id: @current_user.id).first
if @bookmark_rating.blank?
@bookmark_rating = BookmarkRating.create(bookmark_id: @bookmark.id, user_id: @current_user.id, rating: params[:rating])
else
@bookmark_rating.update({'rating': params[:rating].to_i})
end
render json: {"bookmark": @bookmark, "rating": @bookmark_rating}, status: :ok
end
private
def bookmark_params
params.require(:bookmark).permit(:url, :title, :description, :topic_id, :rating, :id)
end
def update_bookmark_params
params.require(:bookmark).permit(:url, :title, :description)
end
end
Loading
Loading