Skip to content

Blue-Ocean-MCSPA/link-learning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ–₯️ LinkLearning

This project is a full-stack application that aims to simulate the business needs of a client-to-engineering-team relationship. The client requested a minimally viable product for a learning app within their education services, emphasizing functionality, modern design, and authentication/session management. Link Learning uses a Vercel-hosted PostgreSQL database and Next.js for the frontend.

Table Of Contents

πŸš€ Getting Started

To get a copy of the project up and running on your local machine for development and testing purposes, follow these steps below.

πŸ“‹ Prerequisites

You need to have Node.js and npm installed on your machine. If you don't have them installed, you can download them from here.

πŸ”§ Installing

  1. Fork and clone the repo.
  2. Navigate to the project directory.
  3. Run npm install to install the dependencies.
  4. Run npm build to build the project.
  5. Run npm start or npm run dev to start the server.

πŸ”§ API

GET

  • /api/users - Get a list of all users
  • /api/reviews - Get a list of all reviews
  • /api/reviews - Get a list of all reviews
  • /api/reviews - Get a list of all reviews
  • /api/reviews - Get a list of all reviews
  • /api/reviews - Get a list of all reviews

πŸ› οΈ Built With


Landing Page

The landing page for this project utilizes a minimalist approach with three colors selected from the VS Code Night Owl Light/Dark themes, as requested by the client. The dark mode toggle is located on the top right, alongside the login button. The login button routes the user to the login page.

Landing Page Light

Light mode

Landing Page Dark

Dark mode

Login Page

The login page allows the user to enter credentials as one of three roles - admin, instructor, or student. JWT and Bcrypt authentication is implemented in order to route the user to the appropriate view. The different functionalities located in each view is further elaborated in their respective sections below.

Login Page


πŸ‘¨β€πŸ« Instructor view

Description

The Instructor View is a component of our learning platform designed specifically for instructors. It provides tools and features to help instructors manage cohorts, track student progress, and facilitate effective teaching. It is designed to provide instructors with a comprehensive set of tools to manage their classes effectively,

  • Technology Stack: Built using Next.js version 14, leveraging the new App router feautre for improved routing and nav. The frontend is develped with React, used for its powerful state management and component based architecture to create a dynamic and interactive user experience. Styling is done with ailwind CSS, which allows for rapid UI development with its utility-first approach.

File Structure

  • app > Components > instructor: The files for the Instructor Dashboard are organized wihtin the 'Components' folder, which is located inside the 'app' folder. This structure helps in keeping the dashboard-realted components separate from other parts of the app, ensuring maintanilbility and scalibility. File Structure View

Key Features

  • Student Analytics: Instructors can view detailed analytics about student performance, including, grades, attendance, and assignment completion. Student View

  • Cohort Management:Instructors can manage different cohorts, view cohort details, and track overall cohort progress.

  • Assignment Overview: A dedicated section for managing assignments, where instructors can view all assignments, their due dates, and grades. Assignment View

  • Communication Tools: Built-in messaging features enable instructors to communicate with students directly, send announcements, and provide feedback. Messages View

Differences from Student Dashboard

  • Cohort Management: Instructors can manage multiple cohorts, whereas students only have access to their own cohort information.

  • Edit Capabilities: Instructors have the ability to edit student information, grades, and attendance records, which is not possible on the Student Dashboard.

Instructor View


MESSAGES

The messages component provides capabilities for creating, retrieving, updating, and deleting messages within threads without the need for authentication. Here, you'll find essential information to get started with our API endpoints.

Key Features:

GET: Retrieve messages from a specific thread or a list of all message threads. POST: Create a new message within a thread. PATCH: Update an existing message in a thread. DELETE: Remove a message from a thread.

All API requests should be made to the following base URL:

http://localhost:3000/msg

Endpoints

GET /messages Description: Retrieve a list of all message threads.

POST /messages Description: Create a new message within a specific thread.

PATCH /{messageId} Description: Update an existing message in a thread.

DELETE /{messageId} Description: Remove a message from a thread.

API Documentation

To connect to your Postgres database using the Vercel Postgres SDK:

  1. Install the SDK: npm install @vercel/postgress
  2. Import the 'sql' function from the SDK
import { sql } from "@vercel/postgres";
  1. Construct SQL queries using the 'sql' function
export async function GET(request) {
  const data = await sql`SELECT * FROM users`;
  return NextResponse.json({ data }, { status: 200 });
}
  1. Examples:
  • CREATE TABLE posts (likes INT); // Create a new table in the database
  • SELECT * FROM posts; // Get all posts in the database
  • SELECT * FROM posts WHERE likes > ${likes}; // Get all posts with more than 100 likes
  • INSERT INTO posts (likes) VALUES (${likes}); // Insert a new post into the database
  • UPDATE posts SET likes = 200; // Update all posts to have 200 likes
  • DELETE FROM posts; // Delete all posts in the database
  1. Preventing SQL injections The Vercel Postgres SDK autocamtically prevents SQL injections by using parameterized queries. Parameters are extracted and added to an array before being sent to the PostgreSQL server. This ensures your queries are sanitized and secure.

Dynamic Routing

In our API, you can utilize dynamic routing to handle requests based on specific IDs. This allows you to create flexible endpoint structure where requests are routed after the provided ID.

Usage

To implement dynamic routing with [id], follow these steps

  1. Create a Dynami Folder: Set up a folder in your API folder with the format [id] where [id]represents the placeholder for the ID parameter.
  2. Define Route Handlers: Within the dynamic folder, define route handlers for each HTTP method(GET, PATCH, DELETE) to handle requests targeting specific IDs.
  3. Handle Requests: Catpture the ID from the request URL or data and use it to perform CRUD operations.

Example

Consider the following folder structure in your API:

/app
    /api
        /[id]
            route.js

Inside the route.js file, you can access the ID parameter from the request URL and process the request.

Note

Ensure proper error handling and validation to handle cases where ID does not exist or the request fails due to other reasons### Admin Page πŸ—‚οΈ


πŸ—‚οΈ Admin view

Description

The Admin View is a component of our learning platform designed specifically for Admins of the platform. Has the capabilities of adding new intructors and students to the database. It has full CRUD opaerations connected to an API. It provides tools and features to help Admins manage Instructors, Students, and Cohorts, track student progress, and facilitate effective teaching.

Key Features

  • Add Instructors Tools: Administrators can add new instructors to the system, providing necessary information such as name, contact details, and expertise.

  • Add Students Tools: Admins can register new students into the system, including their personal details and enrollment information.

  • Monitor Student Progress: The dashboard allows administrators to track the progress of individual students, including course completion rates, grades, and any additional performance metrics.

  • Instructor Rating: Administrators can rate instructors based on their teaching performance using a scalable rating system, providing valuable feedback for improvement.

  • Student Analytics: Monitor student progress, view grades, and track attendance to assess performance effectively.

  • Edit Student Information: Instructors have the ability to edit student details, including grades, attendance records, and personal information.

  • Communication Tools: Stay connected with students through built-in messaging features, allowing instructors to send announcements, reminders, and personalized messages directly to students.

The Admin adding a new instructor to the web application. This also saved the new instructors information to the DataBase

Displays the list of students with the same CRUD features as the instructors