Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
275 commits
Select commit Hold shift + click to select a range
93c49d8
changes
mojitosharma Nov 22, 2023
b2468b8
Merge pull request #68 from Aishwary13/vishesh
Sharma-Devraj Nov 22, 2023
53733de
populate data updated
mojitosharma Nov 22, 2023
8a74942
mentor profile mentee contact added
mojitosharma Nov 22, 2023
fcbbdc5
Merge pull request #69 from Aishwary13/vishesh
Sharma-Devraj Nov 22, 2023
a17cd01
Merge pull request #70 from Aishwary13/vishesh
Aishwary13 Nov 23, 2023
33e87ed
setting up for test-deployment
Sharma-Devraj Nov 23, 2023
0e63e28
Attendace and form status
mojitosharma Nov 23, 2023
929e974
Form API error resolved and tested
mojitosharma Nov 23, 2023
320c40d
get_attendance error resolved
mojitosharma Nov 23, 2023
6d99733
Take Attendance added
Aishwary13 Nov 23, 2023
443a5d8
Merge pull request #71 from Aishwary13/vishesh
Aishwary13 Nov 23, 2023
03da61e
Attendance Done
Aishwary13 Nov 23, 2023
86b05e8
Edit meeting api error resolved
mojitosharma Nov 23, 2023
8d85e17
createMentorMenteePair
mojitosharma Nov 23, 2023
0f4d8bc
Merge pull request #72 from Aishwary13/vishesh
Aishwary13 Nov 23, 2023
b8fe780
Backend message error
Aishwary13 Nov 23, 2023
3c694a8
Thread on sendEmail
mojitosharma Nov 23, 2023
0e790b6
Merge pull request #73 from Aishwary13/vishesh
Aishwary13 Nov 23, 2023
36ab5ae
Merge pull request #74 from Aishwary13/vishesh
Sharma-Devraj Nov 23, 2023
baae426
Form and Responses done
vishesh20550 Nov 23, 2023
8132932
Merge branch 'vishesh' of https://github.com/Aishwary13/smp-portal in…
vishesh20550 Nov 23, 2023
d7ab971
Merge pull request #75 from Aishwary13/master
mojitosharma Nov 23, 2023
4add4e4
mail for feedback form
mojitosharma Nov 23, 2023
6976219
Edit Mentor for Metee Done
Aishwary13 Nov 23, 2023
d8665d2
Merge pull request #76 from Aishwary13/vishesh
Aishwary13 Nov 23, 2023
2182e50
Constent form mail error resloved
mojitosharma Nov 23, 2023
b7dbf61
mentee mail error resolved
mojitosharma Nov 23, 2023
7e9b553
Merge pull request #77 from Aishwary13/vishesh
mojitosharma Nov 23, 2023
cdafa2a
get_form_response error resolved
mojitosharma Nov 23, 2023
d993860
backend testing
Sharma-Devraj Nov 23, 2023
e979e1b
Merge branch 'devraj' into vishesh
Sharma-Devraj Nov 23, 2023
d71c9f4
Mentor Attendance added
Aishwary13 Nov 24, 2023
0d3dbd6
Merge pull request #80 from Aishwary13/master
mojitosharma Nov 24, 2023
537a4d9
Mentor Mentee Button added
vishesh20550 Nov 24, 2023
d9e3ca4
Merge branch 'vishesh' of https://github.com/Aishwary13/smp-portal in…
vishesh20550 Nov 24, 2023
04e953e
mentor mentee mapping
mojitosharma Nov 24, 2023
34db3c5
Form status error resolved
mojitosharma Nov 24, 2023
cfbca88
Merge pull request #81 from Aishwary13/vishesh
Aishwary13 Nov 24, 2023
e797a20
Suggested Changes
mojitosharma Nov 26, 2023
2055e43
total entries added
mojitosharma Nov 26, 2023
009edda
Merge pull request #82 from Aishwary13/vishesh
Aishwary13 Nov 26, 2023
3d7b959
Dummy data update
mojitosharma Nov 26, 2023
2c67805
Login page done, Attendance done.
Aishwary13 Nov 27, 2023
43fe7fe
Email-taken-automatically, Mento Button change.
Aishwary13 Dec 2, 2023
9357dd3
Merge pull request #85 from Aishwary13/master
mojitosharma Dec 6, 2023
e3834ae
Merge pull request #86 from Aishwary13/vishesh
mojitosharma Dec 6, 2023
76e6ca8
Test data updated
mojitosharma Dec 6, 2023
e5907cc
Merge branch 'vishesh' of https://github.com/Aishwary13/smp-portal in…
mojitosharma Dec 6, 2023
0812f04
Errors reolved
mojitosharma Dec 6, 2023
b40683c
Merge pull request #87 from Aishwary13/vishesh
mojitosharma Dec 6, 2023
2a1f686
Consent form changes done
mojitosharma Dec 6, 2023
7d9a75b
Meeting error resolved
mojitosharma Dec 6, 2023
2143312
Merge pull request #89 from Aishwary13/vishesh
mojitosharma Dec 6, 2023
9052abf
Dummy data updated
mojitosharma Dec 6, 2023
8ecf4f6
data
mojitosharma Dec 6, 2023
dfc7f82
Merge pull request #90 from Aishwary13/vishesh
mojitosharma Dec 6, 2023
cd96258
Filter added
vishesh20550 Jan 24, 2024
2e94ca1
Sort on FormResponses added
vishesh20550 Jan 26, 2024
e70d330
Sorting and UI improvements
vishesh20550 Jan 26, 2024
ae40e61
Name validation added for new user
vishesh20550 Jan 26, 2024
3efe540
Merge pull request #94 from Aishwary13/vishesh
Aishwary13 Jan 27, 2024
cce5ed8
scrollableAttendanceTable
Aishwary13 Jan 30, 2024
fdc0ba0
Minor changes
Aishwary13 Feb 3, 2024
bd2ad47
Merge pull request #96 from Aishwary13/master
vishesh20550 Feb 4, 2024
acfc0b1
Download CSV, Filter(in Forms) added
vishesh20550 Feb 4, 2024
b271ff0
FormResponses Department added
mojitosharma Feb 6, 2024
c14d558
Filter in all forms added
vishesh20550 Feb 6, 2024
ccb5681
Merge pull request #97 from Aishwary13/vishesh
vishesh20550 Feb 10, 2024
402905e
getFormResponses Updated
mojitosharma Feb 10, 2024
dbccdbf
Merge pull request #98 from Aishwary13/vishesh
mojitosharma Feb 11, 2024
7cf5106
Minor Changes + selecting mentors (API yet to be added)
Aishwary13 Feb 13, 2024
c4445b4
Meeting menteeBranches and menteeList added
mojitosharma Feb 15, 2024
f976b09
getMailSubjectAndBody and sendConsentForm added
mojitosharma Feb 15, 2024
b1c45d4
mail data file added
mojitosharma Feb 15, 2024
5eda2a0
mentorBranches in dummy data
mojitosharma Feb 15, 2024
f95f3c3
Merge pull request #99 from Aishwary13/vishesh
Aishwary13 Feb 15, 2024
6f2f923
get_form_Status updated
mojitosharma Feb 16, 2024
1656279
change
mojitosharma Feb 16, 2024
a735c47
Merge pull request #100 from Aishwary13/vishesh
Aishwary13 Feb 16, 2024
a46831a
mentor mentee mapping done
mojitosharma Feb 16, 2024
6a50c4d
mentee change
mojitosharma Feb 18, 2024
c65eb69
Mentor Removed
mojitosharma Feb 18, 2024
69f2fcb
Added comments formated code
mojitosharma Feb 18, 2024
8b51814
Merge pull request #101 from Aishwary13/vishesh
Aishwary13 Feb 18, 2024
03692f3
mmpair mail added
mojitosharma Feb 18, 2024
a3924f8
error resolved
mojitosharma Feb 18, 2024
ea57356
Merge branch 'master' into vishesh
mojitosharma Feb 18, 2024
610ce20
changes
mojitosharma Feb 18, 2024
780525e
Merge branch 'vishesh' of https://github.com/Aishwary13/smp-portal in…
mojitosharma Feb 18, 2024
89524a7
Merge pull request #103 from Aishwary13/vishesh
Aishwary13 Feb 18, 2024
e29bd50
enrollment form changes
mojitosharma Feb 19, 2024
c50374e
"mapping"
mojitosharma Feb 19, 2024
5074691
Merge pull request #104 from Aishwary13/vishesh
Aishwary13 Feb 19, 2024
ce0544e
mmpair also added mail to mentee
mojitosharma Feb 19, 2024
4ab0032
Merge pull request #105 from Aishwary13/vishesh
Aishwary13 Feb 22, 2024
f903549
SendMail, Individual Meetings
Aishwary13 Feb 22, 2024
331b330
MenteeLisgetmeeting updated
mojitosharma Mar 11, 2024
dc46225
Merge pull request #106 from Aishwary13/vishesh
Aishwary13 Mar 15, 2024
acdeea7
Sinlge Meeting Module done
Aishwary13 Mar 16, 2024
e0c9afe
Django format
mojitosharma Mar 18, 2024
d59c54b
Merge pull request #108 from Aishwary13/master
vishesh20550 Mar 18, 2024
069b117
Merge pull request #107 from Aishwary13/vishesh
sarthakdaksh Mar 18, 2024
c9a39e0
Single Dashboard, Code simplification
vishesh20550 Mar 18, 2024
83211c9
Unecessary Files deleted
vishesh20550 Mar 18, 2024
7e0912b
Merge pull request #109 from Aishwary13/vishesh
Aishwary13 Mar 18, 2024
1be79fa
Formated the code
mojitosharma Mar 18, 2024
68bcf27
Merge branch 'vishesh' of https://github.com/Aishwary13/smp-portal in…
mojitosharma Mar 18, 2024
4cb75d9
Updated Add meeting
mojitosharma Mar 19, 2024
38bc53e
Total Meeting count added
mojitosharma Mar 19, 2024
9c74c04
navbar + meetings
Aishwary13 Mar 19, 2024
962f05b
Merge pull request #110 from Aishwary13/master
vishesh20550 Mar 19, 2024
88fc95a
Merge pull request #111 from Aishwary13/vishesh
Aishwary13 Mar 19, 2024
70aba93
Errors Reolved
mojitosharma Mar 20, 2024
c6f657d
Merge branch 'vishesh' of https://github.com/Aishwary13/smp-portal in…
mojitosharma Mar 20, 2024
2b62f30
Mail content added
mojitosharma Mar 20, 2024
5506f3c
Meeting error resolved
mojitosharma Mar 20, 2024
3e5182c
Meetings updates
Aishwary13 Mar 20, 2024
99d1578
Merge pull request #112 from Aishwary13/vishesh
Aishwary13 Mar 21, 2024
d7ae514
Attendance error resolved
mojitosharma Mar 21, 2024
5a90069
Mnetee change mentor mail added
mojitosharma Mar 21, 2024
e9a9091
Download CSV formatting and Forms improvements
vishesh20550 Mar 21, 2024
37b4e85
Merge pull request #113 from Aishwary13/vishesh
Aishwary13 Mar 21, 2024
0baeb60
Merge pull request #114 from Aishwary13/master
vishesh20550 Mar 21, 2024
736337f
Merge branch 'vishesh' of https://github.com/Aishwary13/smp-portal in…
vishesh20550 Mar 21, 2024
c0121c2
Add mentor added
vishesh20550 Mar 22, 2024
8d42bb8
Error Resolved
mojitosharma Mar 22, 2024
3a30c3b
Add new mentor error resolved
mojitosharma Mar 22, 2024
e1ea576
Print statment removed
mojitosharma Mar 22, 2024
213a72b
Merge pull request #115 from Aishwary13/vishesh
Aishwary13 Mar 22, 2024
f4a2e54
resolve conflicts commit
Aishwary13 Mar 22, 2024
26a2d5d
Merge branch 'master' of https://github.com/Aishwary13/smp-portal
Aishwary13 Mar 22, 2024
f9a14aa
attendance views
mojitosharma Mar 22, 2024
0f4d186
Restructuring and error resolving.
vishesh20550 Mar 24, 2024
2d851c3
Form Response multiple responses Resolved
mojitosharma Mar 26, 2024
0977f16
Merge branch 'vishesh' of https://github.com/Aishwary13/smp-portal in…
mojitosharma Mar 26, 2024
8c6dd40
form responses error resolved
mojitosharma Mar 26, 2024
2caf541
excellenace award aaded
mojitosharma Mar 28, 2024
f3f852c
award
mojitosharma Mar 28, 2024
79b44cf
form error resolved
mojitosharma Mar 28, 2024
8a7c4b7
error resolved
mojitosharma Mar 28, 2024
f174cfc
mentee multiple form fill handled
mojitosharma Mar 28, 2024
05638c1
feebackfilled added
mojitosharma Mar 28, 2024
45e33e4
removed
mojitosharma Mar 28, 2024
6050d38
Some error resolving
vishesh20550 Mar 28, 2024
2b5b7c5
Merge branch 'vishesh' of https://github.com/Aishwary13/smp-portal in…
vishesh20550 Mar 28, 2024
fe50ece
url updated
mojitosharma Mar 28, 2024
42c400e
Merge branch 'vishesh' of https://github.com/Aishwary13/smp-portal in…
mojitosharma Mar 28, 2024
66df290
Code optimisation, Top Entries in forms added
vishesh20550 Mar 29, 2024
804f758
Styling, Download CSV imporved, Excellence Award initiated
vishesh20550 Mar 29, 2024
a18d5de
Merge pull request #116 from Aishwary13/vishesh
Aishwary13 Mar 29, 2024
8fc9082
changes done
mojitosharma Mar 29, 2024
422fa5c
Excellance status added
mojitosharma Mar 29, 2024
ca5f2ce
update_excellence_award added
mojitosharma Mar 29, 2024
b3329c3
changes
mojitosharma Mar 30, 2024
05ca104
Error resolved
mojitosharma Mar 30, 2024
3cb0a40
error resolved
mojitosharma Mar 30, 2024
4870186
error resolved
mojitosharma Mar 30, 2024
56366e4
error resolved
mojitosharma Mar 30, 2024
c1cc5f5
excellence award update
vishesh20550 Mar 30, 2024
03269c7
error resolved
mojitosharma Mar 30, 2024
e34b0c1
Merge branch 'vishesh' of https://github.com/Aishwary13/smp-portal in…
mojitosharma Mar 30, 2024
4ed4bea
error resolved
mojitosharma Mar 30, 2024
9f05929
error resolved
mojitosharma Mar 30, 2024
88c594e
error resolved
mojitosharma Mar 30, 2024
40c3207
EA update
vishesh20550 Mar 30, 2024
c047686
Merge pull request #117 from Aishwary13/vishesh
Aishwary13 Apr 1, 2024
672b4d8
error resolved
mojitosharma Apr 1, 2024
7f86403
Merge branch 'vishesh' of https://github.com/Aishwary13/smp-portal in…
mojitosharma Apr 1, 2024
394b912
Merge pull request #118 from Aishwary13/vishesh
Aishwary13 Apr 1, 2024
4d34257
select all + forms select diable
Aishwary13 Apr 1, 2024
61b7e49
Merge pull request #119 from Aishwary13/master
vishesh20550 Apr 4, 2024
5dc1e6b
UI changes, Download Images added
vishesh20550 Apr 5, 2024
aabcb0a
error resolved
mojitosharma Apr 5, 2024
e40460a
error resolved
mojitosharma Apr 5, 2024
074427b
error
mojitosharma Apr 5, 2024
1dd7b1a
error
mojitosharma Apr 5, 2024
7c1b82d
error
mojitosharma Apr 5, 2024
d29c1f4
Merge pull request #120 from Aishwary13/vishesh
Aishwary13 Apr 6, 2024
dd51428
Previous Meeting Changes done
Aishwary13 Apr 7, 2024
d195330
Merge pull request #121 from Aishwary13/master
Aishwary13 Apr 8, 2024
9ea684d
Debugging
vishesh20550 Apr 8, 2024
e8c9ae6
Mentor department added
mojitosharma Apr 8, 2024
107b5b5
Merge branch 'vishesh' of https://github.com/Aishwary13/smp-portal in…
mojitosharma Apr 8, 2024
08a22da
Mentor Removed Login Error Resolved
vishesh20550 Apr 14, 2024
b087e76
Merge branch 'vishesh' of https://github.com/Aishwary13/smp-portal in…
vishesh20550 Apr 14, 2024
6d51950
candiate error resolved
mojitosharma Apr 14, 2024
f3e15de
Merge branch 'vishesh' of https://github.com/Aishwary13/smp-portal in…
mojitosharma Apr 14, 2024
d119008
Added default image
mojitosharma Apr 14, 2024
79760b8
add mentee error resolved
mojitosharma Apr 14, 2024
ce38681
mentee save by default
mojitosharma Apr 14, 2024
c1a4c16
Not null added
mojitosharma Apr 15, 2024
bc81b65
Merge pull request #125 from Aishwary13/vishesh
Aishwary13 Apr 15, 2024
76a2bf4
Debugging and Issue resolving
vishesh20550 Apr 18, 2024
ec79e31
Merge pull request #128 from Aishwary13/vishesh
Aishwary13 Apr 24, 2024
ecbe727
Changes
mojitosharma Apr 24, 2024
f469a88
Merge branch 'vishesh' of https://github.com/Aishwary13/smp-portal in…
mojitosharma Apr 24, 2024
c1a2118
API changed
mojitosharma Apr 24, 2024
2355234
changes
mojitosharma Apr 24, 2024
4d08d63
setup updated
mojitosharma Apr 26, 2024
f46f309
Merge pull request #133 from Aishwary13/master
mojitosharma Apr 26, 2024
28ee1bc
Merge pull request #134 from Aishwary13/vishesh
Aishwary13 May 1, 2024
3d00b3e
Error resolved
mojitosharma May 2, 2024
d3ccee3
Merge pull request #135 from Aishwary13/vishesh
Aishwary13 May 2, 2024
64b0174
error resolved
mojitosharma May 2, 2024
3f7a11a
Merge pull request #136 from Aishwary13/vishesh
Aishwary13 May 2, 2024
8fc35d1
Add files via upload
sarthakdaksh Jun 3, 2024
5794589
Merge pull request #152 from Aishwary13/sarthak
Aishwary13 Jun 3, 2024
97943c4
Added README
Vikranth3140 Jun 5, 2024
228b8a3
Create LICENSE
Vikranth3140 Jun 5, 2024
fc95f40
Update README.md
Vikranth3140 Jun 5, 2024
386a843
Fixed venv
Vikranth3140 Jun 14, 2024
8436622
Added cache to .gitignore
Vikranth3140 Jun 14, 2024
08cc419
Merge branch 'master' of https://github.com/IIIT-Delhi/smp-portal
Vikranth3140 Jun 14, 2024
957d6ab
Added new view function `upload_mentor_mentee_list` to handle uploadi…
Vikranth3140 Jun 16, 2024
b7c1b94
Added new API endpoint for uploading mentor-mentee list
Vikranth3140 Jun 16, 2024
c8789b1
reverting changes done
Vikranth3140 Jun 16, 2024
cdfa78e
Merge pull request #156 from IIIT-Delhi/revert
Vikranth3140 Jun 16, 2024
5106427
revert
Vikranth3140 Jun 16, 2024
d38445b
Merge pull request #157 from IIIT-Delhi/revert
Vikranth3140 Jun 16, 2024
1cbf7f6
Minor fix
Vikranth3140 Jun 24, 2024
ef94ede
updated ui
Tharun-Ninja Jul 24, 2024
8e91eb9
login url fixed
Tharun-Ninja Jul 29, 2024
b8380ee
Changed the public ui frim React to IIITD
Vikranth3140 Jul 29, 2024
7cb7133
changed the requests from localhost to smp portal url
Jul 31, 2024
c7c92a3
Verification of various queries and added consent questions etc.
FakePickle Aug 14, 2024
6a93db3
Highlight mentees if no mentor is assigned to them, CSV Instruction A…
FakePickle Aug 20, 2024
fd0252d
Update the api call to localhost and initiate merge
FakePickle Aug 20, 2024
870fbe6
Merge branch 'master' of https://github.com/IIIT-Delhi/smp-portal
FakePickle Aug 20, 2024
a8277de
fix: Mtech mentees list not downloading
FakePickle Sep 4, 2024
209ba90
Created a doc folder.
jalote Oct 9, 2024
aee2237
Update README.md
jalote Oct 9, 2024
6283f58
Add files via upload
jalote Oct 9, 2024
4bb1977
Add files via upload
jalote Oct 21, 2024
7592550
feat: Implement Backup System for data management
FakePickle Jul 18, 2025
3b559ba
feat: Add production deployment workflow with environment configurati…
FakePickle Jul 18, 2025
22c38df
feat: Implement email scheduling system with department-wise batching…
FakePickle Jul 22, 2025
1bbe3a8
fix: Update API URLs to use localhost for development and modify emai…
FakePickle Jul 30, 2025
270c663
Merge pull request #177 from IIIT-Delhi/UI-Fix
FakePickle Jul 30, 2025
6ee61fe
fix: Retain remarks in textarea after saving instead of clearing
FakePickle Jul 31, 2025
a605a3b
Add UI Design System and core components for SMP Portal
FakePickle Aug 19, 2025
4d42b19
Refactor FormResponses component layout and styles; enhance responsiv…
FakePickle Aug 19, 2025
701d473
fix: Adjust mentor image size and enhance mobile navbar toggle functi…
FakePickle Aug 20, 2025
f0e90ef
feat: Add Dockerfile and docker-compose for containerized development…
FakePickle Aug 21, 2025
0b13ba4
Merge remote-tracking branch 'refs/remotes/origin/master'
FakePickle Aug 21, 2025
ccba6ef
fix: Update button labels for clarity in AuthButton component
FakePickle Aug 22, 2025
d622b19
feat: Implement initial setup for mentees, including profile photo up…
FakePickle Aug 22, 2025
e251a7c
feat: Add Historical Data management features
FakePickle Aug 23, 2025
9d10916
Refactor HistoricalData and EnhancedMenteeUpload components for impro…
FakePickle Aug 23, 2025
739eaed
feat: Enhance mentor and mentee data handling by including profile im…
FakePickle Aug 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
118 changes: 118 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: Deploy to Production

on:
push:
branches: [ deployment ]
pull_request:
branches: [ deployment ]

env:
# Production API URL
REACT_APP_API_URL: http://localhost:8000

jobs:
# Job 1: Replace API URLs in the codebase
update-api-urls:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Replace API URLs in React components
run: |
# Replace localhost URLs with production URLs in all JavaScript files
find src -name "*.js" -type f -exec sed -i 's|http://localhost:8000|http://localhost:8000|g' {} \;

# Replace localhost URLs in any TypeScript files (if any)
find src -name "*.ts" -type f -exec sed -i 's|http://localhost:8000|http://localhost:8000|g' {} \;
find src -name "*.tsx" -type f -exec sed -i 's|http://localhost:8000|http://localhost:8000|g' {} \;

# Show the changes made
echo "API URLs updated in the following files:"
git diff --name-only || echo "No changes detected"

- name: Commit API URL changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git diff --staged --quiet || git commit -m "Update API URLs for production deployment"

- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: deployment

# Job 2: Build and validate the application
build-and-test:
runs-on: ubuntu-latest
needs: update-api-urls

steps:
- name: Checkout updated code
uses: actions/checkout@v4
with:
ref: deployment

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build React application
run: npm run build

- name: Run tests (if available)
run: npm test -- --coverage --watchAll=false || echo "No tests found"

- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: build-files
path: build/

# Job 3: Deploy to production server (placeholder)
deploy:
runs-on: ubuntu-latest
needs: build-and-test
if: github.ref == 'refs/heads/deployment'

steps:
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: build-files
path: build/

- name: Deploy to production
run: |
echo "Deploying to production server..."
echo "Build files are ready in the build/ directory"
# Add your actual deployment commands here
# For example:
# - Copy files to server
# - Restart services
# - Run database migrations
# - Clear caches

- name: Notify deployment success
run: |
echo "🎉 Deployment completed successfully!"
echo "Application is now live at: http://localhost:8000"

# Job 4: Backup current deployment (optional)
backup:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/deployment'

steps:
- name: Create deployment backup
run: |
echo "Creating backup of current deployment..."
# Add backup commands here
echo "Backup created with timestamp: $(date)"
237 changes: 237 additions & 0 deletions .github/workflows/production-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,237 @@
name: Production Deployment

on:
push:
branches: [ deployment ]
workflow_dispatch:
inputs:
deploy_type:
description: 'Type of deployment'
required: true
default: 'full'
type: choice
options:
- full
- frontend-only
- backend-only

env:
PRODUCTION_API_URL: http://localhost:8000
STAGING_API_URL: https://staging.smpportal.iiitd.edu.in

jobs:
# Job 1: Detect changes and prepare deployment
prepare-deployment:
runs-on: ubuntu-latest
outputs:
frontend-changed: ${{ steps.changes.outputs.frontend }}
backend-changed: ${{ steps.changes.outputs.backend }}
deploy-type: ${{ steps.deploy-type.outputs.type }}

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Detect changes
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
frontend:
- 'src/**'
- 'public/**'
- 'package.json'
- 'package-lock.json'
backend:
- 'backend/**'
- 'requirements.txt'
- 'manage.py'

- name: Determine deployment type
id: deploy-type
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "type=${{ github.event.inputs.deploy_type }}" >> $GITHUB_OUTPUT
elif [[ "${{ steps.changes.outputs.frontend }}" == "true" && "${{ steps.changes.outputs.backend }}" == "true" ]]; then
echo "type=full" >> $GITHUB_OUTPUT
elif [[ "${{ steps.changes.outputs.frontend }}" == "true" ]]; then
echo "type=frontend-only" >> $GITHUB_OUTPUT
elif [[ "${{ steps.changes.outputs.backend }}" == "true" ]]; then
echo "type=backend-only" >> $GITHUB_OUTPUT
else
echo "type=full" >> $GITHUB_OUTPUT
fi

# Job 2: Deploy Frontend
deploy-frontend:
runs-on: ubuntu-latest
needs: prepare-deployment
if: needs.prepare-deployment.outputs.deploy-type == 'full' || needs.prepare-deployment.outputs.deploy-type == 'frontend-only'

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Replace API URLs for production
run: |
echo "Replacing localhost URLs with production URLs..."

# Create a backup of original files
find src -name "*.js" -type f -exec cp {} {}.backup \;

# Replace API URLs in all relevant files
find src -name "*.js" -type f -exec sed -i 's|http://localhost:8000|${{ env.PRODUCTION_API_URL }}|g' {} \;
find src -name "*.jsx" -type f -exec sed -i 's|http://localhost:8000|${{ env.PRODUCTION_API_URL }}|g' {} \;
find src -name "*.ts" -type f -exec sed -i 's|http://localhost:8000|${{ env.PRODUCTION_API_URL }}|g' {} \;
find src -name "*.tsx" -type f -exec sed -i 's|http://localhost:8000|${{ env.PRODUCTION_API_URL }}|g' {} \;

# Show what files were changed
echo "Files modified:"
find src -name "*.js" -type f -exec sh -c 'if ! cmp -s "$1" "$1.backup"; then echo "Modified: $1"; fi' _ {} \;

# Clean up backup files
find src -name "*.backup" -type f -delete

- name: Build React application
run: |
echo "Building React application for production..."
npm run build

- name: Run tests
run: |
echo "Running tests..."
npm test -- --coverage --watchAll=false || echo "Tests completed"

- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: frontend-build
path: build/
retention-days: 30

- name: Deploy frontend
run: |
echo "🚀 Deploying frontend to production..."
echo "Build size: $(du -sh build/ | cut -f1)"
echo "Frontend deployment completed!"

# Job 3: Deploy Backend
deploy-backend:
runs-on: ubuntu-latest
needs: prepare-deployment
if: needs.prepare-deployment.outputs.deploy-type == 'full' || needs.prepare-deployment.outputs.deploy-type == 'backend-only'

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.13'

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Update Django settings for production
run: |
echo "Updating Django settings for production..."

# Create production settings if they don't exist
if [ ! -f "backend/core/settings_production.py" ]; then
cp backend/core/settings.py backend/core/settings_production.py
echo "Created production settings file"
fi

# Update CORS settings for production
cat >> backend/core/settings_production.py << EOF

# Production settings
DEBUG = False
ALLOWED_HOSTS = ['smpportal.iiitd.edu.in', 'www.smpportal.iiitd.edu.in']

# CORS settings for production
CORS_ALLOWED_ORIGINS = [
"http://localhost:8000",
"https://www.smpportal.iiitd.edu.in",
]

# Security settings
SECURE_SSL_REDIRECT = True
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
EOF

- name: Run Django tests
run: |
cd backend
python manage.py test || echo "Backend tests completed"

- name: Check Django configuration
run: |
cd backend
python manage.py check --deploy || echo "Django check completed"

- name: Collect static files
run: |
cd backend
python manage.py collectstatic --noinput || echo "Static files collected"

- name: Deploy backend
run: |
echo "🚀 Deploying backend to production..."
echo "Backend deployment completed!"

# Job 4: Integration tests
integration-tests:
runs-on: ubuntu-latest
needs: [deploy-frontend, deploy-backend]
if: always() && (needs.deploy-frontend.result == 'success' || needs.deploy-backend.result == 'success')

steps:
- name: Run integration tests
run: |
echo "Running integration tests..."
echo "Testing API endpoints..."

# Test basic API connectivity
curl -f http://localhost:8000/api/health/ || echo "Health check completed"

echo "Integration tests completed!"

# Job 5: Notify deployment status
notify:
runs-on: ubuntu-latest
needs: [deploy-frontend, deploy-backend, integration-tests]
if: always()

steps:
- name: Deployment Summary
run: |
echo "📋 Deployment Summary:"
echo "===================="
echo "Frontend Status: ${{ needs.deploy-frontend.result }}"
echo "Backend Status: ${{ needs.deploy-backend.result }}"
echo "Integration Tests: ${{ needs.integration-tests.result }}"
echo "===================="

if [[ "${{ needs.deploy-frontend.result }}" == "success" || "${{ needs.deploy-backend.result }}" == "success" ]]; then
echo "🎉 Deployment completed successfully!"
echo "Application is live at: http://localhost:8000"
else
echo "❌ Deployment failed. Please check the logs."
fi
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# dependencies
/node_modules
/sdos
./sdos
/.pnp
.pnp.js

Expand All @@ -22,3 +22,8 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
backend/env
sdos/

# Pycache from all the sub directories
**/__pycache__/
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 IIIT-Delhi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading