-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Added documentation for guidance and general definition about g…
…land
- Loading branch information
Showing
5 changed files
with
223 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Changelog | ||
|
||
## [1.0.0] - 2024-09-15 | ||
|
||
### Added | ||
- Initial release of Gland framework with core features including middleware support, custom routing, and integration with internal logging and SQL query runners. | ||
Initial release with the following features: | ||
- Basic server setup and middleware support. | ||
- Routing with decorators (`@Route`, `@Get`, etc.). | ||
- Configuration loading from `.confmodule` files. | ||
- [Gland Logger](https://github.com/medishen/gland-logger) for configurable logging. | ||
- [Qiu](https://github.com/medishen/gland-qiu) for SQL query execution with support for MySQL, MariaDB, and PostgreSQL. | ||
- Basic framework setup with middleware support and routing. | ||
- Project initialization with basic structure and setup. | ||
- Initial project setup and configuration. | ||
|
||
### Performance | ||
- Benchmark tests demonstrated efficient request handling with high throughput. | ||
|
||
### Documentation | ||
- Added detailed documentation including FAQ, contributing guidelines, and security policy. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,56 @@ | ||
# Contributing to Gland | ||
# Contributing | ||
|
||
First off, thank you for considering contributing to Gland! It’s people like you that make this project possible and better for everyone. We welcome any contributions, whether they are bug reports, new features, or documentation improvements. | ||
We welcome contributions to the Gland project! Please follow these guidelines to ensure that your contributions are well-organized and aligned with our project's goals. | ||
|
||
## How to Contribute | ||
|
||
### Reporting Bugs | ||
1. **Fork the Repository**: Create a personal fork of the Gland repository on GitHub. | ||
|
||
If you find a bug in the project, please create an issue on GitHub with the following information: | ||
2. **Clone Your Fork**: Clone your forked repository to your local machine: | ||
```bash | ||
git clone https://github.com/your-username/gland.git | ||
``` | ||
|
||
- **Title**: A short and descriptive title for the issue. | ||
- **Description**: A detailed description of the bug, including steps to reproduce it, the expected behavior, and the actual behavior. | ||
- **Environment**: Information about your environment, including Node.js version, OS, and any other relevant details. | ||
- **Screenshots**: If applicable, include screenshots to help illustrate the problem. | ||
3. **Create a Branch**: Create a new branch for your changes: | ||
```bash | ||
git checkout -b feature/your-feature | ||
``` | ||
|
||
### Suggesting Enhancements | ||
4. **Make Changes**: Implement your changes and write tests to cover them. | ||
|
||
If you have an idea for an enhancement or a new feature, please open an issue with the following details: | ||
5. **Commit Your Changes**: Commit your changes with a descriptive message. Follow semantic commit messages: | ||
``` | ||
type(scope): subject | ||
|
||
- **Title**: A short and descriptive title for the enhancement. | ||
- **Description**: A detailed description of the enhancement, including why it would be useful, and how it should work. | ||
- **Alternatives**: Any alternative solutions or features you've considered. | ||
[Optional body] | ||
|
||
### Pull Requests | ||
[Optional footer] | ||
``` | ||
|
||
If you want to contribute code, follow these steps: | ||
For example: | ||
``` | ||
feat(router): add support for nested routes | ||
|
||
1. **Fork the Repository**: Click the "Fork" button on the repository's GitHub page. | ||
2. **Clone Your Fork**: Clone your fork to your local machine with `git clone https://github.com/medishen/gland.git`. | ||
3. **Create a Branch**: Create a new branch for your changes with `git checkout -b my-feature`. | ||
4. **Make Your Changes**: Make your changes to the codebase. | ||
5. **Commit Your Changes**: Commit your changes with a descriptive commit message. | ||
6. **Push to Your Fork**: Push your branch to your forked repository with `git push origin my-feature`. | ||
7. **Open a Pull Request**: Open a pull request on the original repository and describe your changes in detail. | ||
Added functionality to support nested routes in the router. | ||
``` | ||
|
||
### Code Style | ||
6. **Push Your Changes**: Push your changes to your forked repository: | ||
```bash | ||
git push origin feature/your-feature | ||
``` | ||
|
||
To maintain consistency throughout the codebase, please adhere to the following guidelines: | ||
7. **Create a Pull Request**: Open a pull request from your branch to the main repository's `main` branch. | ||
- Follow the existing code style. | ||
- Write clear and descriptive commit messages. | ||
- Include comments for complex or unclear code sections. | ||
- Write tests for new features or bug fixes. | ||
## Code of Conduct | ||
### Running Tests | ||
Please adhere to the [Code of Conduct](CODE_OF_CONDUCT.md) when contributing to the project. | ||
To run the tests locally, use the following commands: | ||
## Testing | ||
1. **Install Dependencies**: Run `npm install` to install all dependencies. | ||
2. **Run Tests**: Run `npm test` to execute the test suite. | ||
Ensure that all new features and bug fixes are covered by tests. Run the test suite before submitting your pull request to ensure that your changes do not introduce any regressions. | ||
Make sure all tests pass before opening a pull request. | ||
## Contact | ||
## Communication | ||
For any questions or further assistance, please reach out to us at [bitsgenix@gmail.com](mailto:bitsgenix@gmail.com). | ||
If you have any questions or need further assistance, feel free to contact the maintainers at [mediishn@gmail.com](mailto:mediishn@gmail.com). | ||
|
||
## License | ||
|
||
By contributing to Gland, you agree that your contributions will be licensed under the MIT License. | ||
|
||
--- | ||
|
||
Thank you for taking the time to contribute to Gland! | ||
Thank you for contributing to Gland! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# FAQ | ||
|
||
## What is Gland? | ||
|
||
Gland is a lightweight web server framework designed for Node.js. It provides a flexible and extensible way to build web applications with support for middleware, routing, and a modular approach to configuration. | ||
|
||
## How do I get started with Gland? | ||
|
||
To get started with Gland, you can follow these simple steps: | ||
|
||
1. Install Gland via npm: | ||
```bash | ||
npm install gland | ||
``` | ||
|
||
2. Create a basic server: | ||
```typescript | ||
import path from 'path'; | ||
import gland from 'gland'; | ||
const g = new gland(); | ||
g.load(path.join(__dirname, '.confmodule')); | ||
g.init(3000, () => { | ||
console.log('Server running on port 3000'); | ||
}); | ||
``` | ||
|
||
3. Define your routes and handlers in a configuration file (`.confmodule`): | ||
```typescript | ||
import { Context, Get, Route } from 'gland'; | ||
@Route('/') | ||
export class Test { | ||
@Get() | ||
test(ctx: Context) { | ||
ctx.write('hello world'); | ||
ctx.end(); | ||
} | ||
} | ||
``` | ||
## How does Gland handle logging? | ||
Gland uses the internal logger package, [@medishn/gland-logger](https://github.com/medishen/gland-logger), to handle logging. You can access the logger using the `logger` property: | ||
```typescript | ||
import gland from 'gland'; | ||
const g = new gland(); | ||
const logger = g.logger; | ||
``` | ||
## What is Qiu? | ||
Qiu is an internal query runner for Gland that supports various SQL databases, including MySQL, MariaDB, and PostgreSQL. For more information, visit the [Qiu repository](https://github.com/medishen/gland-qiu). | ||
## Where can I find more information? | ||
- [Gland Repository](https://github.com/medishen/gland) | ||
- [Gland Logger](https://github.com/medishen/gland-logger) | ||
- [Qiu](https://github.com/medishen/gland-qiu) | ||
## How can I report issues or contribute? | ||
Please report issues and contribute to the Gland project via the [GitHub repository](https://github.com/medishen/gland). For contributions, see the `CONTRIBUTING.md` file for guidelines. | ||
## Contact | ||
For further inquiries, you can reach us at [bitsgenix@gmail.com](mailto:bitsgenix@gmail.com). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Security Policy | ||
|
||
## Reporting a Vulnerability | ||
|
||
To report a security vulnerability in Gland, please contact us via email at [bitsgenix@gmail.com](mailto:bitsgenix@gmail.com). We take security seriously and will address any vulnerabilities promptly. | ||
|
||
## Supported Versions | ||
|
||
We support the current version and the previous major version of Gland. Security updates are provided for these versions. | ||
|
||
## Security Best Practices | ||
|
||
- Ensure that you are using the latest version of Gland to benefit from the latest security fixes. | ||
- Review and follow the best practices outlined in our documentation for secure coding and deployment. | ||
|
||
## Additional Resources | ||
|
||
- [OWASP](https://owasp.org) | ||
- [Node.js Security](https://nodejs.org/en/docs/guides/security/) | ||
|
||
For any other security-related concerns or questions, please do not hesitate to contact us. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# Software Requirements Specification (SRS) | ||
|
||
## Introduction | ||
|
||
### Purpose | ||
|
||
This document provides a detailed Software Requirements Specification (SRS) for the Gland framework. It outlines the requirements for the system, including functional and non-functional requirements, to ensure that the framework meets its intended use. | ||
|
||
### Scope | ||
|
||
Gland is a Node.js web server framework designed to provide a modular, flexible, and efficient way to build web applications. The framework includes features such as middleware support, routing, and an internal logger and query runner. | ||
|
||
## Functional Requirements | ||
|
||
### Middleware | ||
|
||
- The framework must support the addition and execution of middleware functions. | ||
- Middleware functions should be able to modify the request and response objects and invoke the next middleware in the chain. | ||
|
||
### Routing | ||
|
||
- The framework must support defining routes using decorators (`@Route`, `@Get`, `@Post`, etc.). | ||
- Routes should be able to handle different HTTP methods and provide responses to client requests. | ||
|
||
### Configuration | ||
|
||
- The framework should support loading configuration modules from specified paths. | ||
- Configuration should allow setting various options such as log level, caching, and module patterns. | ||
|
||
### Logging | ||
|
||
- The framework must integrate with the internal logger package (`@medishn/gland-logger`). | ||
- Logging should be configurable and include different log levels. | ||
|
||
### Query Runner | ||
|
||
- The framework must integrate with the internal query runner (`@medishn/gland-qiu`). | ||
- It should support SQL databases including MySQL, MariaDB, and PostgreSQL. | ||
|
||
## Non-Functional Requirements | ||
|
||
### Performance | ||
|
||
- The framework must handle high loads efficiently and process requests with minimal latency. | ||
- The performance of the framework should be benchmarked and optimized for scalability. | ||
|
||
### Security | ||
|
||
- The framework must follow security best practices to protect against common vulnerabilities. | ||
- Regular security updates should be provided to address any identified issues. | ||
|
||
### Usability | ||
|
||
- The framework should provide clear and concise documentation for users. | ||
- Examples and usage guides should be included to facilitate ease of use. | ||
|
||
## System Architecture | ||
|
||
### Components | ||
|
||
- **WebServer**: Manages HTTP requests and responses, handles middleware, and routes. | ||
- **Logger**: Handles logging and provides configurable log levels. | ||
- **Query Runner**: Manages SQL queries and supports multiple database types. | ||
|
||
### Dependencies | ||
|
||
- **Node.js**: The runtime environment for executing the Gland framework. | ||
- **Additional Packages**: Internal dependencies such as `@medishn/gland-logger` and `@medishn/gland-qiu`. | ||
|
||
## Glossary | ||
|
||
- **Middleware**: Functions that process requests and responses in a web server. | ||
- **Routing**: The process of mapping URLs to specific handlers or controllers. | ||
- **Configuration**: Settings and options that control the behavior of the framework. | ||
- **Logging**: The process of recording events and messages for debugging and monitoring. | ||
- **Query Runner**: A component that executes SQL queries and interacts with databases. | ||
|
||
For more details on the system design and architecture, please refer to the project's documentation. |