https://github.com/shadowc/tymfony
A TypeScript based express framework designed to feel like symfony
https://github.com/shadowc/tymfony
Last synced: 9 months ago
JSON representation
A TypeScript based express framework designed to feel like symfony
- Host: GitHub
- URL: https://github.com/shadowc/tymfony
- Owner: shadowc
- License: mit
- Created: 2022-05-01T10:14:20.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-12-12T10:12:22.000Z (over 1 year ago)
- Last Synced: 2025-03-16T03:54:36.072Z (about 1 year ago)
- Language: TypeScript
- Size: 2.73 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tymfony
A symfony-like `TypeScript` framework designed around `express` to make the
experience of creating `node` based back-end solutions easier.
## Proof of concept
The final idea would be that you install this package in your app and, along
with a global binary, you can create a minimalistic app that loads a
default controller and template. You could then go and install other
`tymfony` packages that add files to config and the `/types/config` (TBD)
directory.
> The final aim of this project is that the`framework` directory would instead
> live inside `node_modules` and that you can have a small script `main.js` to
> start the server added by a `postinstall` script.
## How to add pages
You can add classes derived from the `AbstractController` class (or any
class for that matter) inside the `controllers` directory and `tymfony` will
automatically scan it and add them to the `express` route system allowing
you to work on a one-file-per-route basis and getting some tools of
a symfony-like framework.
You can then add services inside the `services` dir, and entities in the
`entities` or `model` dir.
## Dependency Injection
There will be a container available globally with the different packages
installed on `tymfony` as we move to a better way of figuring out dependency
injection.
### Installing a hypothetical package
- You run `npm i` on some package named `@tymfony/package`.
- The package installs itself in `node_modules`
- There is a `postinstall` script that copies some config files to `config`
- The `postinstall` script also adds files to a `config_types` (TBD) dir and
modifies the general `config.d.ts` that allows new patterns in the
configuration general file of `tymfony`.
- You start importing classes or using this package in your app as you create
controllers, services, entities and models.