Thank you for your interest in contributing to SkillNet! SkillNet is a cutting-edge platform designed to host secure and efficient online exams. Our backend is built with Node.js and utilizes modern technologies to deliver a seamless testing experience for educators and candidates.
SkillNet re-imagines online examinations by:
-
Empowering Educators: Offering robust tools for creating, scheduling, and managing exams.
-
Enhancing Candidate Experience: Delivering a user-friendly and secure testing environment.
-
Ensuring Exam Integrity: Incorporating advanced proctoring solutions and real-time analytics for fair assessments.
-
Exam creation and scheduling tools
-
Secure, real-time exam monitoring and proctoring
-
Comprehensive performance analytics
-
Customizable exam templates
-
Integrated communication channels
We welcome contributions in various forms, including bug fixes, feature implementations, and documentation improvements.
- Navigate to the (https://github.com/skill-mind/skillnet-exam-server.git).
- Click the Fork button to create your copy of the repository.
- Clone your forked repository to your local machine:
git clone https://github.com/<your-username>/skill-mind/skillnet-exam-server.git
cd sskillnet-exam-serverPrerequisites:
- Node.js (v16.x or above)
- npm
- git
Install Dependencies:
npm installCreate a branch for your feature or bug fix:
git checkout -b feature/<Issue title>- Implement your changes.
- Test your changes thoroughly.
- Commit your work with a descriptive message:
git add .
git commit -m "Issue Title"- Push your branch to your forked repository:
git push origin <Issue Title>- Click on Pull Requests and select New Pull Request.
- Provide a clear and concise title and description for your PR.
- Link any relevant issues.
Code of Conduct
- Please adhere to our Code of Conduct to maintain a respectful and inclusive community.
- Write clean and modular code following the repository's coding standards.
- Ensure all changes are tested before submission.
- Document new features and updates thoroughly.
A comprehensive API for managing online exams, certifications, and skill assessments.
- User authentication and authorization with JWT
- Wallet address integration for blockchain-based authentication
- Exam creation and management with multiple question types
- Exam registration and payment tracking
- Exam taking and automated scoring
- Result tracking and certificate generation
- Admin dashboard for managing users and exams
- API documentation with Swagger UI
- Backend: Node.js, Express.js
- Database: PostgreSQL with Sequelize ORM
- Authentication: JWT, Wallet address verification
- Documentation: Swagger/OpenAPI
- Containerization: Docker
- Node.js (v14 or higher)
- npm or yarn
- Docker and Docker Compose
- PostgreSQL (if not using Docker)
-
Clone the repository:
git clone https://github.com/yourusername/skillnet-exam-server.git
-
Navigate to the project directory:
cd skillnet-exam-server -
Install dependencies:
npm install
-
Copy the .env.example file to .env and configure your environment variables.
NODE_ENV=development PORT=5001 # Database DB_HOST=localhost DB_PORT=5433 DB_NAME=skillnet_exam DB_USER=skillnet_exam DB_PASSWORD=skillnet_exam # JWT JWT_SECRET=your_jwt_secret_key_here JWT_EXPIRES_IN=30d
The project includes a Docker Compose file to easily set up the PostgreSQL database:
docker-compose up -dIf docker-compse doesn't work, you can make use of docker compose command instead
docker compose up -dThis will start a PostgreSQL container with the following configuration:
- Container name: skillnet-db
- Database name: skillnet_exam
- Username: skillnet_exam
- Password: skillnet_exam
- Port: 5433 (mapped to 5432 inside the container)
For development (with nodemon for auto-restart):
npm run devFor production:
npm startThe server will be running at http://localhost:5001
API documentation is available at http://localhost:5001/api-docs when the server is running. This interactive documentation is generated using Swagger UI and allows you to:
- View all available endpoints
- See request and response schemas
- Test endpoints directly from the browser
- Authenticate with JWT tokens
skillnet-exam-server/
├── src/ # Source code
│ ├── config/ # Configuration files
│ ├── controllers/ # Route controllers
│ ├── docs/ # Swagger documentation
│ ├── middleware/ # Express middleware
│ ├── models/ # Sequelize models
│ ├── routes/ # Express routes
│ ├── utils/ # Utility functions
│ └── server.js # Express app entry point
├── .env # Environment variables
├── .gitignore # Git ignore file
├── api.rest # REST Client file for testing endpoints
├── docker-compose.yml # Docker Compose configuration
├── package.json # npm dependencies
└── README.md # Project documentation
- POST /api/auth/register - Register a new user
- POST /api/auth/login - Login a user
- GET /api/auth/profile - Get authenticated user profile
- GET /api/users/profile - Get user profile
- PUT /api/users/profile - Update user profile
- GET /api/users/wallet/:address - Get user by wallet address
- GET /api/users - Get all users (admin only)
- GET /api/exams - Get all exams
- GET /api/exams/:id - Get exam by ID
- POST /api/exams - Create a new exam (admin only)
- PUT /api/exams/:id - Update an exam (admin only)
- DELETE /api/exams/:id - Delete an exam (admin only)
- GET /api/exams/category/:category - Get exams by category
- POST /api/registrations - Register for an exam
- PUT /api/registrations/:id/payment - Update payment status
- GET /api/registrations/user - Get user's registrations
- POST /api/registrations/validate - Validate exam code
- POST /api/results - Submit exam and create result
- GET /api/results/user - Get user's results
- GET /api/results/:id - Get result by ID
- GET /api/results/certificate/:id - Generate certificate for a result
The project includes an api.rest file that can be used with the REST Client extension in VS Code to test all endpoints. To use it:
- Install the REST Client extension in VS Code
- Open the api.rest file
- Click on "Send Request" above any endpoint to test it
- Use the variables defined in the file to chain requests (e.g., using tokens from login responses)
The application uses the following main models:
- User : Stores user information and authentication details
- Exam : Contains exam details, questions, and settings
- Registration : Tracks user registrations for exams
- Result : Stores exam results and user answers
Thank you for your interest in contributing to SkillNet! SkillNet is a cutting-edge platform designed to host secure and efficient online exams. Our backend is built with Node.js and utilizes modern technologies to deliver a seamless testing experience for educators and candidates.
SkillNet re-imagines online examinations by:
- Empowering Educators: Offering robust tools for creating, scheduling, and managing exams.
- Enhancing Candidate Experience: Delivering a user-friendly and secure testing environment.
- Ensuring Exam Integrity: Incorporating advanced proctoring solutions and real-time analytics for fair assessments. Features
- Exam creation and scheduling tools
- Secure, real-time exam monitoring and proctoring
- Comprehensive performance analytics
- Customizable exam templates
- Integrated communication channels
We welcome contributions in various forms, including bug fixes, feature implementations, and documentation improvements.
-
Fork the Repository
- Navigate to the repository skillnet-exam-server.
- Click the Fork button to create your copy of the repository.
-
Clone the Repository
- Clone your forked repository to your local machine:
git clone https://github.com/<your-username>/skill-mind/skillnet-exam-server.git
- Navigate to the project directory:
cd skillnet-exam-server -
Set Up the Project
Prerequisites:
-
Node.js (v16.x or above)
-
npm
-
git
Install Dependencies:
npm install
-
Create a New Branch
Create a branch for your feature or bug fix:
git checkout -b feature/<Issue title>
-
Make Changes and Commit Implement your changes. Test your changes thoroughly. Commit your work with a descriptive message:
git add. git commit -m "Issue Title" -
Push Changes Push your branch to your forked repository:
git push origin <Issue Title>
-
Create a Pull Request (PR) Click on Pull Requests and select New Pull Request. Provide a clear and concise title and description for your PR. Link any relevant issues.
Please adhere to our Code of Conduct to maintain a respectful and inclusive community.
- Write clean and modular code following the repository's coding standards.
- Ensure all changes are tested before submission.
- Document new features and updates thoroughly.
This project is licensed under the MIT License - see the LICENSE file for details.
{
"type": "module",
"scripts": {
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
"dev": "nodemon src/server.js",
"start": "node src/server.js"
},
"jest": {
"transform": {},
"extensionsToTreatAsEsm": [".js"]
}
}export default {
testEnvironment: 'node',
transform: {},
extensionsToTreatAsEsm: ['.js'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1'
}
};| Issue | Solution |
|---|---|
| "Cannot use import statement" | Ensure "type": "module" is set |
| Mock not working in tests | Use unstable_mockModule for ESM |
| Missing file extensions | Always include .js in imports |
| Async test failures | Add proper await/async handling |
// Importing from this package
import { createExam } from 'skillnet-exam-server'