FUNQL
FUNQL
is Simply a new way to create web servers
·
Report Bug
·
Request Feature
Table of Contents
About The Project
What Is FUNQL?
FUNQL is just a Native Graphql
If you hate
gql
and prefer to handle backend tasks with standard and robust methods.If you experience difficulties in using graphql in your projects due to its inherent complexities namely, time-consuming typesafety.
Despite the simplicity of REST APIs, you are likely to get caught in the process of life-cycles and middlewares, etc.
If you hate the secrets under the hood of libraries or frameworks.
If you love MongoDB and want to use its potential capabilities.
FUNQL Is For You!
FUNQL Basics
FUNQL
is just a sets of rules:
- You must send standard
JSON
’sHTTP POST
request tohttp://localhost:${PORT}/funql
- Your request should have
wants
object in it.wants
object should have 2 properties :model
anddoit
.model
is one of your MongoDB schemas anddoit
is one of your methods you write for that schema. - Your request should have
details
object in it,details
object should have 2 properties:set
andget
.
set
is a group of proprieties you try to send in a request like properties you need for creating a schema or properties you need to sort or filter on getting documents from schema.get
is an object to specify which fields client wants to retrieve.
- The structure of folders is quite important in a
funql
project
deno
server:
Folder structure example in - project
a blog example
- config
should have
- utils
maybe
- someUtils.ts
maybe
- index.ts
should have
- someUtils.ts
- db.ts
maybe
- redis.ts
maybe
- index.ts
should have
- utils
- src
should have
- utils
maybe
- populateMany.ts
maybe
- throwErr.ts
maybe
- index.ts
should have
- populateMany.ts
- functions
should have
- user
should have if we have an user schema
- funcs
should have if we have common fns
- getUsers.ts
maybe
- …
maybe
- index.ts
should have
- getUsers.ts
- adding.ts
maybe
- login.ts
maybe
- singing.ts
maybe
- getting.ts
maybe
- …
maybe
- index.ts
should have
- funcs
- …
other models fns
- index.ts
should have
- user
- schemas
should have
- utils
maybe
- someUtils.ts
maybe
- someOtherUtils.ts
maybe
- index.ts
should have
- someUtils.ts
- user.ts
maybe
- post.ts
maybe
- category.ts
maybe
- …
maybe
- index.ts
should have
- utils
- index.ts
should have
- utils
- index.ts
should have
- script.json
should have if use denon
- config
Basic Rules
every schema should have 4 seprate things : schemas
- an inteface to describe and hint
functions
Features
- It uses the best capabilities of graphql idea.
- It uses the best design elements of REST API’s.
- It removes all unnecessary extra code, validation, repetitive procedures.
funql
fully implementsfunctional programming
characteristics. Everything is comprised of small functionsfunql
is fundamentally based onfs(function schema)
architecture.
Getting Started
To install FUNQL
simply enter the following into a terminal:
Prerequisites
deno
must be installed.
Installation
Install Latest Version:
deno install -qAf --v8-flags="--max-old-space-size=48384,--max-heap-size=16384" --allow-read --allow-write --unstable https://deno.land/x/funql/funql.ts
Install Specific Version:
deno install -qAf --v8-flags="--max-old-space-size=48384,--max-heap-size=16384" --allow-read --allow-write --unstable https://deno.land/x/funql@{SPECIFIC_VERSION}/funql.ts
Usage
To start using funql
, just enter this command:
funql --init [blog]
blog
is name of the project and for sake of simplicity, we create the blog project byfunql
becausefunql
is just a concept with set of rulesblog project
uses mongoDB and redis. So install them, we recommend using denon for running project so after installdenon
just run on the root of project directory :
denon start
After downloading dependencies, http://localhost:8000/
will be displayed on the console.
Now send this http request to retrieve data:
POST http://localhost:8000/funql HTTP/1.1
content-type: application/json
{
"wants": {
"model": "Country",
"doit": "adding"
},
"details": {
"set": {
"name": "iran",
"enName": "iran"
},
"get": {
"_id": 0,
"name": 0,
"cities": {
"_id": 1,
"name": 1
}
}
}
}
Roadmap
See the open issues for a list of proposed features (and known issues).
Language | Process | Description |
---|---|---|
Deno | 🔵 🔵 🔵 🔵 ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ | just starting |
NodeJS | ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ | nothing for know |
Golang | ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ | nothing for know |
Rust | ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ | nothing for know |
Contributing
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Show your support
Give a ⭐️ if this project helped you!
License
This project is AGPL–3.0 License licensed.