Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
A lightweight and flexible static site generator framework built with Express and React. Supports dynamic content, REST API management, and an admin panel.
Simple SSG is a comprehensive and flexible framework designed to simplify the creation and management of static sites and dynamic web applications. Built with Express and React, it now supports a full range of features, including a web app for the admin panel, dynamic middleware management, REST API support, and seamless integration with Sequelize for database management.
multer
, enabling easy handling of media and other file types.Simple SSG is actively being developed with the goal of providing a fully integrated framework that simplifies the creation and management of static sites and dynamic web applications. We are continuously adding new features and improvements to ensure that the framework meets the needs of modern web development. While it is already a powerful tool, the development is ongoing until our vision of a complete, all-in-one solution is fully realized.
npx
is also in the works, making it even easier to get started with Simple SSG.Install Simple SSG via npm:
npm install simplessg
A basic project structure without middleware, database, API, or admin panel:
.
├── dist
├── package.json
├── public
├── scripts
│ └── serve.js
├── simplessg.config.js
└── src
├── _posts
│ ├── first-article.md
│ └── second-article.md
├── components
│ └── index.jsx
├── content
│ ├── 404.md
│ ├── posts
│ │ ├── index.md
│ │ ├── author
│ │ │ ├── [id].md
│ │ │ └── index.md
│ │ ├── [slug].md
│ │ └── tag
│ │ ├── [id].md
│ │ └── index.md
│ ├── about.md
│ └── index.md
├── site.json
└── templates
├── posts.jsx
├── default.jsx
├── home.jsx
├── index.css
├── index.js
├── not-found.jsx
├── author.jsx
└── tag.jsx
A more detailed project structure that includes middleware, routers, database controllers and models, client and admin scripts, and a more complex public assets structure:
.
├── dist
├── middlewares
│ ├── db
│ │ ├── controllers
│ │ │ └── index.js
│ │ ├── index.js
│ │ └── models
│ │ └── index.js
│ ├── index.js
│ ├── routers
│ │ └── index.js
│ └── server-mw
│ └── index.js
├── package.json
├── public
│ └── assets
│ ├── css
│ ├── js
│ └── media
├── scripts
│ └── serve.js
├── simplessg.config.js
└── src
├── admin-scripts
│ └── index.js
├── _posts
│ ├── first-article.md
│ └── second-article.md
├── client-scripts
│ └── index.js
├── components
│ └── index.jsx
├── content
│ ├── 404.md
│ ├── posts
│ │ ├── index.md
│ │ ├── author
│ │ │ ├── [id].md
│ │ │ └── index.md
│ │ ├── [slug].md
│ │ └── tag
│ │ ├── [id].md
│ │ └── index.md
│ ├── about.md
│ ├── index.md
│ └── login.md
├── site.json
└── templates
├── posts.jsx
├── default.jsx
├── home.css
├── home.jsx
├── index.js
├── login.jsx
├── not-found.css
├── not-found.jsx
├── author.jsx
└── tag.jsx
package.json
Below is an example of a package.json
file that includes simplessg
as a dependency, along with other dependencies like sequelize for database management:
{
"name": "mywebsite",
"private": true,
"version": "1.0.0",
"main": "server.js",
"dependencies": {
"mysql2": "^3.10.1",
"sequelize": "^6.37.3",
"simplessg": "^1.2.0"
},
"scripts": {
"start": "node scripts/serve.js"
}
}
simplessg.config.js
This configuration file is used to define various settings for Simple SSG, such as paths, middleware, session handling, and localization:
const {defineLocale} = require('./scripts/locale');
const root = __dirname;
const cssBundlePath = distPath + '/assets/css/bundle.css';
module.exports = {
root,
cssBundlePath,
clientScriptExternal: {react: 'React', 'react-dom/client': 'ReactDOM'},
useInternalRouters: true,
useAdminPanel: true,
adminFavicon: '/assets/media/si-icon-32.png',
adminPanelStyles: ['/assets/css/alegreya-v35-latin/font.css'],
reactUri: '/assets/js/react.production.min.js',
reactDomUri: '/assets/js/react-dom.production.min.js',
useCookieParser: true,
useSession: true,
session: {
secret: '...',
cookie: {
secure: false, // Set secure to true if using HTTPS
},
},
defineLocale,
locale: 'id',
useRedis: true,
// setting redis, optional. Currently used only for session management
redis: {
host: 'localhost',
port: 6379,
},
};
serve.js
This script initializes the Simple SSG instance, applies middleware, generates static content, watches for changes, and serves the application:
const config = require('../simplessg.config');
const {SimpleSSG} = require('simplessg');
const appMiddleware = require('../middlewares');
const start = async () => {
const ss = new SimpleSSG(config);
await ss.use(appMiddleware);
await ss.generate();
ss.watch(true);
ss.serve();
};
start();
More detailed documentation on using Sequelize, handling file uploads, authentication, customizing the admin panel, managing client-side JavaScript, and other topics may be covered later or in separate documentation. For now, we are still focused on completing the features.
Contributions are welcome! If you find a bug or have a feature request, please open an issue on GitHub.
Simple SSG is licensed under the MIT License.
FAQs
A lightweight and flexible static site generator framework built with Express and React. Supports dynamic content, REST API management, and an admin panel.
The npm package simplessg receives a total of 0 weekly downloads. As such, simplessg popularity was classified as not popular.
We found that simplessg demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.