Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
40 changes: 40 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Code of Conduct

## Our Pledge

EntityForge is a small open-source project and I want it to be a welcoming place for everyone — whether you're filing your first issue, submitting a pull request, or just asking a question.

Participation in this project is open to everyone regardless of age, background, experience level, gender identity, nationality, race, religion, or sexual orientation. Respectful, constructive collaboration is the only expectation.

## Standards

**Behaviour that makes this project better:**

- Being patient and respectful in discussions
- Giving feedback that focuses on the code or idea, not the person
- Accepting that people have different approaches and experience levels
- Acknowledging mistakes openly and moving forward constructively

**Behaviour that is not acceptable:**

- Harassment, insults, or personal attacks of any kind
- Dismissing contributors because of their experience level
- Sexualised language or unwanted advances
- Sharing someone's private information without their permission
- Any conduct that would be considered unprofessional in a collaborative setting

## Scope

This applies to all project spaces — GitHub issues, pull requests, discussions, and any public communication where you are representing EntityForge.

## Reporting

If something happens that makes you uncomfortable, please reach out directly at **veda_ravula@outlook.com**. All reports will be handled promptly, fairly, and with full respect for your privacy.

## Enforcement

Depending on the severity, responses may range from a private conversation and warning, to a temporary or permanent removal from the project. The goal is always to keep the project a good place to contribute — not to punish.

## Attribution

Adapted from the [Contributor Covenant v2.0](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html).
51 changes: 51 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Contributing to EntityForge

Thanks for taking the time to contribute. EntityForge is a small project and every improvement — whether it's a bug report, a fix, or a suggestion — is genuinely appreciated.

## Getting Started

```bash
git clone https://github.com/vedavith/Entity-Forge.git
cd Entity-Forge
composer install
```

Run the test suite to make sure everything is working:

```bash
vendor/bin/phpunit
vendor/bin/phpstan analyse
```

All tests must pass and PHPStan must report no errors (level 8) before submitting a pull request.

## Ways to Contribute

- **Bug reports** — open an issue with a clear description of what happened, what you expected, and how to reproduce it
- **Bug fixes** — pick an open issue, fix it, and open a pull request
- **Feature suggestions** — open an issue to discuss the idea before building it; this saves time on both sides
- **Documentation** — improvements to the README, code comments, or examples are always welcome
- **Tests** — additional test coverage for untested paths is a great first contribution

## Pull Request Guidelines

- Branch off `main` and keep your branch focused on one thing
- Follow the existing code style — PHP 8.3+, strict types, no magic
- Write or update tests for any code you change
- Keep commits clean and descriptive
- Do not include unrelated changes in the same PR

## Code Style

- PHP 8.3+ features encouraged (enums, readonly, named arguments, fibers where appropriate)
- No commented-out code
- No `var_dump`, `print_r`, or debug output left in
- Column names passed to repository methods must be validated — never interpolate raw user input into SQL

## Reporting Security Issues

Please do **not** open a public issue for security vulnerabilities. Email **veda_ravula@outlook.com** directly with the details. I'll respond as quickly as possible.

## Code of Conduct

This project follows the [Code of Conduct](CODE_OF_CONDUCT.md). Please read it before participating.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Vedavith Ravula

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
21 changes: 21 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Security Policy

## Supported Versions

Use this section to tell people about which versions of your project are
currently being supported with security updates.

| Version | Supported |
| ------- | ------------------ |
| 5.1.x | :white_check_mark: |
| 5.0.x | :x: |
| 4.0.x | :white_check_mark: |
| < 4.0 | :x: |

## Reporting a Vulnerability

Use this section to tell people how to report a vulnerability.

Tell them where to go, how often they can expect to get an update on a
reported vulnerability, what to expect if the vulnerability is accepted or
declined, etc.
28 changes: 28 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,34 @@ It provides everything needed to build a scalable SaaS backend: JSON-driven code

---

## Example Projects

### [ledger-api](https://github.com/vedavith/ledger-api)

A double-entry accounting REST API that demonstrates a complete EntityForge project using the `shared` tenancy strategy.

**What it covers:**

- Entity schemas for `Account`, `JournalEntry`, and `LedgerLine` with foreign key relations and tenant-scoped unique indexes
- Migrations generated with `generate:all --migration` and run with `migrate`
- Tenants created with `tenant:create`
- Controllers scaffolded with `make:controller` and filled in with CRUD logic using `$request->json()` and `BaseRepository`
- Middleware scaffolded with `make:middleware` — `TenantMiddleware` reads the `X-Tenant-ID` header and calls `TenantContext::setTenantId()`
- Transaction wrapping in `JournalController` — if any ledger line insert fails, the journal entry is rolled back atomically
- Routes wired in `public/index.php` via `Router` and `Pipeline`

```bash
git clone https://github.com/vedavith/ledger-api.git
cd ledger-api
composer install
# create database, edit config/application.yaml, then:
php vendor/bin/ef migrate
php vendor/bin/ef tenant:create acme --name="Acme Corp"
php -S localhost:8181 -t public
```

---

## Requirements

- PHP 8.3+
Expand Down
Loading