Welcome to the official repository for the Skill-Sharing Community Platform project.
To get a local copy of the project on your computer, please follow the following steps:
-
Copy the Repository URL
Go to the main page of our GitHub repository. Click the green< > Codebutton and copy the HTTPS URL. -
Open Your Terminal
Open your command prompt, PowerShell, or any other terminal. -
Clone the Project
Navigate to the folder where you want to store the project and run the following command:git clone [paste-the-repository-url-here]
``
-
Navigate into the Project Folder
cd Skill_Sharing_app
You now have the project on your computer and are ready to start working!
To run the application, you will need two terminals running simultaneously: one for the MongoDB database and one for the Node.js server.
Open a new terminal window and run the following command to start the MongoDB database.
You must leave this terminal running in the background.
mongodOpen a second terminal window, navigate to the project's root directory, and run the following command to start the application server with nodemon.
npm run Once both servers are running, open your web browser and go to:
http://localhost:3000
This project follows the Model-View-Controller (MVC) model to keep the code organized.
- 📁 models: Contains all Mongoose schemas, which define the structure of our database documents.
- 📁 views: Contains all EJS (
.ejs) template files, which are rendered to the user's browser. - 📁 controllers: Contains the business logic of the application, handling requests and sending responses.
- 📁 routes: Defines the URL endpoints for the application and maps them to the appropriate controller functions.
- 📁 public: Contains all static assets, such as CSS stylesheets, client-side JavaScript, and images.
- 📁 config: For configuration files, like the database connection setup.
Our application uses two primary collections in MongoDB:
This collection stores information about each registered member.
username: (String, Required, Unique)email: (String, Required, Unique)password: (String, Required, Hashed)credits: (Number, Default: 1)
This collection stores information about each skill or service offered by a user.
title: (String, Required)description: (String, Required)category: (String, Required)user: (ObjectID, Ref: 'User') — A reference to the user who owns the skill.status: (String, Enum: ['available', 'in_progress', 'completed'])
- Express.js: A fast and minimalist web framework for Node.js that we use to build our server and handle routing.
- Mongoose: An Object Data Modeling (ODM) library for MongoDB and Node.js, which helps us manage relationships between data and provides schema validation.
- Dotenv: A zero-dependency module that loads environment variables from a
.envfile, allowing us to keep secrets out of our code.
All work must be done on a separate feature branch to keep our develop branch stable. Never work directly on main or develop. Complete the required work on your feature branch. Make small, frequent commits with clear and descriptive messages. Each commit should represent a single logical change. We follow this commit message format:
- feat: A new feature
- fix: A bug fix
- docs: Changes to documentation (like this README)
- style: Formatting changes, white-space, etc.
- refactor: Code changes that neither fix a bug nor add a feature
# Example for a new feature:
git checkout -b feature/user-profile-page
# Example for a bug fix:
git commit -m "fix: resolve issue where login button was unresponsive"Follow these steps every time you start a new task.
Before creating a new branch, always switch to the develop branch and pull the latest changes from GitHub.
git checkout develop
git pullCreate a new branch for your task. Remember to name it after your Trello card (e.g., feature/name-of-feature).
# Example for a documentation update:
git checkout -b docs/update-readmeNow you write your code in this new branch. Once you made some changes and are ready to save your code, you need to commit them.
First, add the files you've changed to the staging area. The . adds all modified files.
git add .Next, save your staged changes with a clear message that follows our convention.
# Example for a new feature:
git commit -m "feat: implement user registration endpoint"
# Example for a documentation fix:
git commit -m "docs: clarify setup instructions"After committing, you are ready to push your branch and create a Pull Request (PR).
To ensure code quality and clear communication, every task must follow this 5-step process, which links our Trello board directly to our Git history.
Step 1: Create a Branch
- Before writing any code, follow the instructions in the "How to Create a Branch" section above. Your branch name must match your Trello card.
Step 2: Code and Commit Your Work
- Complete the work for your task on your new branch.
- Make small, regular commits. Each commit should represent a single logical change.
- Write clear and descriptive commit messages (like
"feat: add validation to registration form").
Step 3: Push and Create a Pull Request (PR)
-
Once your feature is complete and tested, push your branch to GitHub:
git push origin feature/user-profile-page
-
Go to our GitHub repository. You will see a prompt to create a Pull Request (PR) from your new branch.
-
Create the PR, making sure the target is the
developbranch. Write a clear title and description.
Step 4: Link Your PR and Get it Reviewed
- Copy the link to your new Pull Request.
- Paste the link into the comments section of the corresponding Trello card.
- Request a review from at least one other team member(See the troubleshooting section in this document to learn how.). They will review your code for quality and correctness.
Step 5: Merge and Close
- Once your PR has been approved by a teammate, merge it into the
developbranch. - After the merge is complete, move the Trello card from "Doing" to the "Done" column.
- Problem: You run
git pullon a branch and see an error likeThere is no tracking information for the current branch. - Reason: This happens when your local branch doesn't know which branch to track on GitHub. It's a one-time setup for a new branch.
- Solution: Run the command that Git suggests. This command links your local branch to the remote one.
# Replace <branch-name> with the name of your current branch
git branch --set-upstream-to=origin/developAfter running this, you can use git pull as normal.
There are two ways to request code reviews on GitHub.
This is the most common and efficient way to request a review.
-
Locate the "Reviewers" Section After you've pushed your branch and clicked "Compare & pull request," you'll land on the form to open your PR. On the right-hand sidebar, you will see a section titled "Reviewers".
-
Click the Gear Icon ⚙️ Click the small gear icon next to the "Reviewers" title.
-
Select Your Teammates A dropdown will appear, listing all collaborators with access to the repository.
- Click the name(s) of the teammate(s) you want to review your code.
- Use the search box at the top if you have many collaborators.
-
Confirmation Once selected, their usernames will appear in the "Reviewers" section. When you click "Create pull request," GitHub automatically notifies them (including via email).
If you forget to add a reviewer at creation, you can add one later.
-
Navigate to Your Pull Request Go to the "Pull requests" tab in your repo and open the PR you want reviewed.
-
Find the Sidebar On the right-hand side, you’ll see the same sidebar from the PR creation page.
-
Add a Reviewer Click the gear icon ⚙️ in the "Reviewers" section, select teammates, and GitHub will notify them immediately.
- Problem: You run
mongodin the terminal and get a "command not recognized" error. - Reason: MongoDB is installed, but its location is not added to your system’s PATH variable.
- Solution:
- Locate your MongoDB bin directory (e.g.,
C:\Program Files\MongoDB\Server\7.0\bin). - Add it to your system’s environment variables.
- Locate your MongoDB bin directory (e.g.,
Authentication Pages (Login & Register)
The authentication system introduces two core pages: Login and Register, designed to give users a seamless experience when accessing the Skill-Sharing Community Platform. Both pages were implemented using EJS templates for server-side rendering and styled with Materialize CSS for responsiveness and modern design.
Login Page
Purpose: Provides users with access to the platform by entering valid credentials.
UI Design:
Responsive card layout (views/auth/login.ejs) with Materialize form components.
Integration of Material Icons for a polished look.
Custom styles defined in public/css/main.css for consistent branding.
Validation:
Client-side validation using public/js/validation.js.
Ensures required fields (email and password) are not empty and meet format requirements before submission.
Register Page
Purpose: Allows new users to create an account to participate in the community.
UI Design:
Responsive card layout (views/auth/register.ejs) styled with Materialize CSS.
Input fields for username, email, and password with clear hints and placeholder text.
Consistent design with the login page to ensure usability.
Validation:
Client-side validation checks email format, password length/strength, and ensures no fields are left empty.
Provides immediate user feedback for incorrect input before the form is submitted.
Shared UI Enhancements
Custom Stylesheet (public/css/main.css): Centralized styles for form layouts, input spacing, and button design.
Reusable Partials: Navbar and footer partials integrated for consistent layout across pages.
Accessibility & Responsiveness: Layout tested to ensure it adapts to different screen sizes, following a mobile-first approach.