CyberSkill Shared is a comprehensive TypeScript-first utility library that standardizes development across CyberSkill projects. It provides shared utilities, configurations, and components for both frontend and backend development.
| Feature | Benefit |
|---|---|
| π Consistency | Standardized patterns and utilities across all projects |
| β‘ Productivity | Pre-built solutions for common development tasks |
| π‘οΈ Reliability | Type-safe implementations with comprehensive testing |
| π Scalability | Modular architecture that grows with your needs |
| π Performance | Optimized for production with minimal bundle impact |
| π Security | Built-in security best practices and npm provenance |
| Module | Highlights |
|---|---|
| config/ | ESLint, Vitest, Commitlint, env parsing, GraphQL Codegen, Storybook |
| node/ | Express middleware, MongoDB ODM, WebSocket, CLI tools, file upload, logging |
| react/ | Apollo Client, i18n (i18next + next-intl), Loading, Toast, Storage hooks |
| util/ | String processing, object manipulation, validation, serialization |
For the full module map and architecture, see CODEBASE.md.
Prerequisites: Node.js β₯ 24.0.0 Β· pnpm β₯ 10.0.0 Β· TypeScript β₯ 5.0.0
pnpm add @cyberskill/sharedAdd to your tsconfig.json:
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@cyberskill/shared/*": ["node_modules/@cyberskill/shared/src/*"]
}
}
}import { validateEmail } from '@cyberskill/shared/util';
import { RESPONSE_STATUS } from '@cyberskill/shared/constant';
validateEmail('user@example.com'); // trueimport { ApolloProvider } from '@cyberskill/shared/react/apollo-client';
import { LoadingProvider, useLoading } from '@cyberskill/shared/react/loading';
function App() {
return (
<ApolloProvider options={{ uri: 'https://api.example.com/graphql' }}>
<LoadingProvider>
<MyApplication />
</LoadingProvider>
</ApolloProvider>
);
}import { createCorsOptions } from '@cyberskill/shared/node/express';
import { mongo } from '@cyberskill/shared/node/mongo';
import { RESPONSE_STATUS } from '@cyberskill/shared/constant';
import cors from 'cors';
import express from 'express';
const app = express();
app.use(cors(createCorsOptions({
isDev: process.env.NODE_ENV === 'development',
whiteList: ['https://example.com']
})));
await mongo.connect({ uri: process.env.MONGODB_URI });git clone https://github.com/cyberskill-world/shared.git && cd shared
pnpm install && pnpm run build| Command | Description |
|---|---|
pnpm run dev |
Start development mode with hot reload |
pnpm run build |
Build for production |
pnpm run lint |
Check for linting issues |
pnpm run lint:fix |
Fix linting issues automatically |
pnpm run test |
Run tests |
pnpm run inspect |
Inspect project dependencies |
pnpm run reset |
Reset project state |
pnpm run ready |
Prepare project for development |
| Document | Description |
|---|---|
| API.md | API reference and usage examples |
| CODEBASE.md | Architecture, modules, and conventions |
| CONTRIBUTING.md | Development guidelines, code standards, and release process |
| SECURITY.md | Vulnerability disclosure policy |
| CHANGELOG.md | Release history |
- π Issues: GitHub Issues
- π¬ Discussions: GitHub Discussions
- π API Reference: JSDocs
- π§ Email: support@cyberskill.world
MIT β see LICENSE for details.
Made with β€οΈ by the CyberSkill Team
Website Β· Issues Β· Discussions
If this project helps you, please consider giving us a β on GitHub!