-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7764c65
commit de6e990
Showing
34 changed files
with
840 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
DJANGO_SECRET_KEY | ||
DJANGO_DEBUG | ||
DJANGO_ALLOWED_HOSTS | ||
MONGO_DB_URI | ||
MONGO_DB_USERNAME | ||
MONGO_DB_PASSWORD | ||
REDIS_LOCATION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
/LMS-Backend/.env | ||
/venv/ | ||
/node_modules/ | ||
/.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ DJANGO_ALLOWED_HOSTS | |
MONGO_DB_URI | ||
MONGO_DB_USERNAME | ||
MONGO_DB_PASSWORD | ||
REDIS_LOCATION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,13 +9,12 @@ | |
openapi.Info( | ||
title="Learning Management System API", | ||
default_version='v1', | ||
description="API documentation for the Learning Management System", | ||
terms_of_service="http://127.0.0.1:8000/swagger/", | ||
contact=openapi.Contact(email="[email protected]"), | ||
description="Comprehensive API documentation for the Learning Management System", | ||
terms_of_service="https://moodify-emotion-music-app.vercel.app/terms-of-service", | ||
contact=openapi.Contact(email="[email protected]", name="Learning Management System", url="https://moodify-emotion-music-app.vercel.app/"), | ||
license=openapi.License(name="MIT License"), | ||
), | ||
public=True, | ||
permission_classes=(permissions.AllowAny,), | ||
) | ||
|
||
urlpatterns = [ | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
LMS-Frontend/app/src/app/auth/register/register.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
.register-container { | ||
height: 80vh; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
margin-top: 0; | ||
} | ||
|
||
.form-label { | ||
font-size: 1.1rem; | ||
font-weight: 500; | ||
margin-bottom: 0.5rem; | ||
color: #333; | ||
margin-right: 10px; | ||
} | ||
|
||
.form-control-lg { | ||
height: calc(2rem + 2px); | ||
padding: 0.75rem 1rem; | ||
border-radius: 8px; | ||
border: 1px solid #ccc; | ||
transition: border-color 0.3s ease; | ||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); | ||
margin-top: 5px; | ||
font: inherit; | ||
} | ||
|
||
.form-control-lg:focus { | ||
border-color: #007bff; | ||
box-shadow: 0 0 5px rgba(0, 123, 255, 0.5); | ||
} | ||
|
||
.register-card { | ||
max-width: 400px; | ||
width: 100%; | ||
border-radius: 12px; | ||
border: none; | ||
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1); | ||
padding: 20px; | ||
} | ||
|
||
.btn-primary { | ||
font-weight: 600; | ||
padding: 0.75rem 1rem; | ||
font-size: 1rem; | ||
transition: background-color 0.3s, transform 0.3s; | ||
border-radius: 8px; | ||
} | ||
|
||
.btn-primary:hover { | ||
background-color: #0056b3; | ||
transform: scale(1.05); | ||
} | ||
|
||
.alert-danger { | ||
font-size: 0.95rem; | ||
padding: 12px; | ||
border-radius: 8px; | ||
} |
61 changes: 61 additions & 0 deletions
61
LMS-Frontend/app/src/app/auth/register/register.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<div class="register-container d-flex justify-content-center align-items-center"> | ||
<div class="card p-5 shadow-lg register-card"> | ||
<h2 class="text-center text-primary mb-4">Register</h2> | ||
<form (ngSubmit)="register()"> | ||
<div class="form-group mb-3"> | ||
<label for="username" class="form-label">Username:</label> | ||
<input | ||
type="text" | ||
id="username" | ||
[(ngModel)]="username" | ||
name="username" | ||
class="form-control form-control-lg" | ||
placeholder="Enter your username" | ||
required | ||
/> | ||
</div> | ||
<div class="form-group mb-3"> | ||
<label for="email" class="form-label">Email:</label> | ||
<input | ||
type="email" | ||
id="email" | ||
[(ngModel)]="email" | ||
name="email" | ||
class="form-control form-control-lg" | ||
placeholder="Enter your email" | ||
required | ||
/> | ||
</div> | ||
<div class="form-group mb-3"> | ||
<label for="password1" class="form-label">Password:</label> | ||
<input | ||
type="password" | ||
id="password1" | ||
[(ngModel)]="password1" | ||
name="password1" | ||
class="form-control form-control-lg" | ||
placeholder="Enter your password" | ||
required | ||
/> | ||
</div> | ||
<div class="form-group mb-3"> | ||
<label for="password2" class="form-label">Confirm Password:</label> | ||
<input | ||
type="password" | ||
id="password2" | ||
[(ngModel)]="password2" | ||
name="password2" | ||
class="form-control form-control-lg" | ||
placeholder="Confirm your password" | ||
required | ||
/> | ||
</div> | ||
<button type="submit" class="btn btn-primary btn-lg w-100 mt-3">Register</button> | ||
|
||
<!-- Display error message if any --> | ||
<div *ngIf="errorMessage" class="alert alert-danger mt-4 text-center"> | ||
{{ errorMessage }} | ||
</div> | ||
</form> | ||
</div> | ||
</div> |
33 changes: 33 additions & 0 deletions
33
LMS-Frontend/app/src/app/auth/register/register.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { Component } from '@angular/core'; | ||
import { Router } from '@angular/router'; | ||
import { AuthService } from '../../services/auth.service'; | ||
import { FormsModule } from '@angular/forms'; | ||
import { CommonModule } from '@angular/common'; | ||
|
||
@Component({ | ||
selector: 'app-register', | ||
standalone: true, | ||
imports: [FormsModule, CommonModule], | ||
templateUrl: './register.component.html', | ||
styleUrls: ['./register.component.css'] | ||
}) | ||
export class RegisterComponent { | ||
username: string = ''; | ||
email: string = ''; | ||
password1: string = ''; | ||
password2: string = ''; | ||
errorMessage: string = ''; | ||
|
||
constructor(private authService: AuthService, private router: Router) {} | ||
|
||
register(): void { | ||
this.authService.register(this.username, this.email, this.password1, this.password2).subscribe( | ||
() => { | ||
this.router.navigate(['/login']); // Redirect to login page after successful registration | ||
}, | ||
(error) => { | ||
this.errorMessage = error.error?.detail || 'Registration failed'; | ||
} | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 24 additions & 14 deletions
38
LMS-Frontend/app/src/app/components/course-list/course-list.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.