0% found this document useful (0 votes)
6 views5 pages

System Design Guide for SkillSwap Project

The document outlines the system design and setup for the SkillSwap project, detailing the folder structure for a Node.js backend, including configurations, controllers, models, routes, and middleware. It also provides a comprehensive database design for collections such as Users, Skills, Sessions, Quizzes, and QuizResults, along with their fields and relationships. Additionally, it specifies the creation of a .env.example file for environment variables necessary for the project.

Uploaded by

xasansantos222
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views5 pages

System Design Guide for SkillSwap Project

The document outlines the system design and setup for the SkillSwap project, detailing the folder structure for a Node.js backend, including configurations, controllers, models, routes, and middleware. It also provides a comprehensive database design for collections such as Users, Skills, Sessions, Quizzes, and QuizResults, along with their fields and relationships. Additionally, it specifies the creation of a .env.example file for environment variables necessary for the project.

Uploaded by

xasansantos222
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Full Guide for System Design & Setup (SkillSwap Project)

👤 Assigned to: Sumayo Ahmed Hassan (Group Leader)


🆔 Student ID: C1220880

📅 Deadline: December 28–30, 2025

🎯 Marks: 3 marks (System Design & Setup)

📁 1. Complete Folder Structure

I was responsible for creating all folders and files that the backend system will use.
I created a clean and modular folder structure suitable for a [Link] backend project. The
structure is designed for scalability and maintainability:

SkillSwap/

├── config/ # DB connection & cloud setup
│ └── [Link] # MongoDB connection file
│ └── [Link] # Cloudinary config file (if needed)

├── controllers/ # Logic for each route
│ └── [Link]
│ └── [Link]
│ └── [Link]
│ └── [Link]

├── models/ # Schema for MongoDB collections
│ └── [Link]
│ └── [Link]
│ └── [Link]
│ └── [Link]

├── routes/ # API endpoints
│ └── [Link]
│ └── [Link]
│ └── [Link]
│ └── [Link]

├── middleware/ # Middlewares (auth, error handling)
│ └── [Link]
│ └── [Link]

├── uploads/ # For profile pics or documents
├── public/ # Static assets if needed
├── utils/ # Helper functions
│ └── [Link]

├── .[Link] # Env template
├── [Link] # App entry point
├── [Link] # Node dependencies
├── [Link] # Project documentation
└── .gitignore # Files not to push to GitHub

2. Full Database Design


1. Users Collection

Field Name Description


_id ObjectId Unique ID (MongoDB
default)
name String Full name of the user
email String User’s email (unique)
password String Hashed password
role String Either "expert" or "learner"
bio String Short biography
profileImage String URL to profile image
skillsOffered [ObjectId] Array of references to skills
user can teach
skillsWanted [ObjectId] Array of references to skills
user wants to learn

Relationships:

User participates in sessions as learner or expert

User takes quizzes via quizResults

2. Skills Collection
Field Name Description
_id ObjectId Unique ID
name String Skill name
category String Skill category (e.g., Coding,
Music)
description String Short description
createdBy ObjectId Reference to users
(creator/expert)

Relationships:

Skill appears in sessions

Skill can have multiple quizzes

3. Sessions Collection

Field Name Description


_id ObjectId Unique ID
learnerId ObjectId Reference to users (learner)
expertId ObjectId Reference to users (expert)
skillId ObjectId Reference to skills
schedule Date Scheduled session time
status String "pending" | "completed" |
"cancelled"
Feedback String Optional feedback from
learner

Relationships:

Session links a learner, expert, and a skill

4. Quizzes Collection
Field Name Description
_id ObjectId Unique ID
skillId ObjectId Reference to skills
createdBy ObjectId Reference to users
(creator/expert)
questions [Object] Array of questions
{ questionText, options,
correctAnswer }
Relationships:

Quiz belongs to a skill

Quiz is created by a user

5. QuizzesResults Collection
Field Name Description
_id ObjectId Unique ID
userId ObjectId Reference to users
quizId ObjectId Reference to quizzes
score Number Total score achieved
answersGiven [Object] Array of answers
{ questionId, selectedOption
}
Relationships:

Result belongs to a user and a quiz

Relationships Summary

users → sessions: A user can be learner or expert in multiple sessions.

skills → sessions: Each session is about one skill.

skills → quizzes: Each skill can have multiple quizzes.

users → quizResults: User takes quizzes.

quizzes → quizResults: Each quiz can have multiple results.

🔐 `.[Link]` File
Inside your project folder, create a file named `.[Link]` and add this content:

PORT=5000
NODE_ENV=development

MONGODB_URI=your_mongodb_connection_here
JWT_SECRET=your_jwt_secret_here

You might also like