tenseijs / tensei Goto Github PK
View Code? Open in Web Editor NEW๐ Content management and distribution with a touch of elegance.
Home Page: https://tenseijs.com
License: MIT License
๐ Content management and distribution with a touch of elegance.
Home Page: https://tenseijs.com
License: MIT License
Tensei should have a way of defining indexes for multiple columns on SQL databases.
Please fix it
Can someone please tell me how can I check if the object belongs to the user or not? Someting like this
Todo.user.id = user.id
Please help me regarding this.... ๐๐ป
Responsive CMS sidebar does not close on backdrop click and menu item click
As a user, when viewing my tensei dashboard on smaller devices, the sidebar should automatically close when i click on a menu item. it should also close when i click on the backdrop.
Responsive cms sidebar should close on backdrop and menu item click
If applicable, add code samples to help explain your problem.
Add any other context about the problem here.
Test the @tensei/knex package to 100% test coverage for mysql, pg and sqlite databases
Where and how to setup cors in tensei?
Teams should have the following API endpoints:
There is a typo on one of the documentation page.
Please take a comment
to try out the mutations and queries specified in the GraphQL explorer, or if you're using Rest, make API calls with a Rest client such as Postman or Insomnia.
Congratulations, you've successfully run your first Tensei app ๐.
Administrators should use an email / password pair to get access to the admin panel.
As an administrator, I should be able to:
Quick summary what's this feature request about.
It is more convenient to login with email/password authentication when email sending is not configured yet.
Some suggestions or tasks to be completed for this feature:
When users request a magic link from the administration panel login page, we generate a magic link with a token and send them an email with this token. This token is currently a random string, but it needs to be better.
Let's implement the following operations on the string:
I am unable to create a new tensei app
ERROR :
Exit code: 1
Command: node-pre-gyp install --fallback-to-build
Arguments:
Directory: /mnt/d/Learning/tensei/CMS/cms-using-ubuntu/blogging-app/node_modules/sqlite3
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using [email protected]
node-pre-gyp info using [email protected] | linux | x64
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp info check checked for "/mnt/d/Learning/tensei/CMS/cms-using-ubuntu/blogging-app/node_modules/sqlite3/lib/binding/napi-v6-linux-x64/node_sqlite3.node" (not found)
node-pre-gyp http GET https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/napi-v6-linux-x64.tar.gz
node-pre-gyp http 403 https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/napi-v6-linux-x64.tar.gz
node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/napi-v6-linux-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v88 ABI, glibc) (falling back to source compile with node-gyp)
node-pre-gyp http 403 status code downloading tarball https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/napi-v6-linux-x64.tar.gz
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info ok
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info find Python using Python version 3.8.2 found at "/usr/bin/python3"
gyp http GET https://nodejs.org/download/release/v15.8.0/node-v15.8.0-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v15.8.0/node-v15.8.0-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v15.8.0/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v15.8.0/SHASUMS256.txt
gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args '/home/manjit2003/.nvm/versions/node/v15.8.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/mnt/d/Learning/tensei/CMS/cms-using-ubuntu/blogging-app/node_modules/sqlite3/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/manjit2003/.nvm/versions/node/v15.8.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/manjit2003/.cache/node-gyp/15.8.0/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/home/manjit2003/.cache/node-gyp/15.8.0',
gyp info spawn args '-Dnode_gyp_dir=/home/manjit2003/.nvm/versions/node/v15.8.0/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/home/manjit2003/.cache/node-gyp/15.8.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/mnt/d/Learning/tensei/CMS/cms-using-ubuntu/blogging-app/node_modules/sqlite3',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info ok
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack at getNotFoundError (/home/manjit2003/.nvm/versions/node/v15.8.0/lib/node_modules/npm/node_modules/which/which.js:10:17)
gyp ERR! stack at /home/manjit2003/.nvm/versions/node/v15.8.0/lib/node_modules/npm/node_modules/which/which.js:57:18
gyp ERR! stack at new Promise (<anonymous>)
gyp ERR! stack at step (/home/manjit2003/.nvm/versions/node/v15.8.0/lib/node_modules/npm/node_modules/which/which.js:54:21)
gyp ERR! stack at /home/manjit2003/.nvm/versions/node/v15.8.0/lib/node_modules/npm/node_modules/which/which.js:71:22
gyp ERR! stack at new Promise (<anonymous>)
gyp ERR! stack at subStep (/home/manjit2003/.nvm/versions/node/v15.8.0/lib/node_modules/npm/node_modules/which/which.js:69:33)
gyp ERR! stack at /home/manjit2003/.nvm/versions/node/v15.8.0/lib/node_modules/npm/node_modules/which/which.js:80:22
gyp ERR! stack at /home/manjit2003/.nvm/versions/node/v15.8.0/lib/node_modules/npm/node_modules/isexe/index.js:42:5
gyp ERR! stack at /home/manjit2003/.nvm/versions/node/v15.8.0/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
gyp ERR! System Linux 4.4.0-19041-Microsoft
gyp ERR! command "/home/manjit2003/.nvm/versions/node/v15.8.0/bin/node" "/home/manjit2003/.nvm/versions/node/v15.8.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/mnt/d/Learning/tensei/CMS/cms-using-ubuntu/blogging-app/node_modules/sqlite3/lib/binding/napi-v6-linux-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/mnt/d/Learning/tensei/CMS/cms-using-ubuntu/blogging-app/node_modules/sqlite3/lib/binding/napi-v6-linux-x64" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=6" "--node_napi_label=napi-v6"
gyp ERR! cwd /mnt/d/Learning/tensei/CMS/cms-using-ubuntu/blogging-app/node_modules/sqlite3
gyp ERR! node -v v15.8.0
gyp ERR! node-gyp -v v7.1.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/home/manjit2003/.nvm/versions/node/v15.8.0/bin/node /home/manjit2003/.nvm/versions/node/v15.8.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/mnt/d/Learning/tensei/CMS/cms-using-ubuntu/blogging-app/node_modules/sqlite3/lib/binding/napi-v6-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/mnt/d/Learning/tensei/CMS/cms-using-ubuntu/blogging-app/node_modules/sqlite3/lib/binding/napi-v6-linux-x64 --napi_version=7 --node_abi_napi=napi --napi_build_version=6 --node_napi_label=napi-v6' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/mnt/d/Learning/tensei/CMS/cms-using-ubuntu/blogging-app/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (node:events:378:20)
node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1067:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
node-pre-gyp ERR! System Linux 4.4.0-19041-Microsoft
node-pre-gyp ERR! command "/home/manjit2003/.nvm/versions/node/v15.8.0/bin/node" "/mnt/d/Learning/tensei/CMS/cms-using-ubuntu/blogging-app/node_modules/sqlite3/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /mnt/d/Learning/tensei/CMS/cms-using-ubuntu/blogging-app/node_modules/sqlite3
node-pre-gyp ERR! node -v v15.8.0
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Please help me regarding this ๐
How do I upload files from the CMS???
Date, date time, timestamps fields are handled poorly.
At the moment it is not exactly clear what these fields do and how they operate. They should work seamlessly and as expected by the underlying database.
All date related fields should function as expected with no bugs or unexpected behaviour
A clear and concise description of what you expected to happen.
The guides link in the main readme.me is leading to a 404 page
to see the main page for guides, which i assume it could be the getting-started
If applicable, add code samples to help explain your problem.
i just found out this app from this video which i liked so i went here with some curiosity, hope this little issue will help
Hey brother hope you are in good condition...
I was just wondering if I can deploy the API to NextJs
serverless functions on Vercel??
Is this possible??
Hello, @bahdcoder hope you are going well...
Extremely thank you for such an amazing project.
Just one more request... Can you please add some more examples?
This would be of so much help...
Please consider adding some examples whenever possible...
I try to reach the https://tenseijs.com/ web and It does not work
GraphQL API exposes hidden resources and fields
When I call the hideFromApi()
method on a resource, the resource still shows up in graphQL API schema.
The resource should be completely shielded, and should not show up.
This resource should not also show up in the queries of other related resources.
All packages defining resources should be updated to hide / show appropriately
Secure this functionality with automated tests
Incorrect documentation page title
The documentation getting started page has "tailwind css" in it title. This is because the code docs website was focked from tailwind css documentation repo.
Title surfix should be " - Open source Node.js Headless CMS"
graphql inserts
works, but insert
failed with integer
field.
yarn create tensei-app cats
cd cats
index.js
asconst { auth } = require('@tensei/auth')
const { graphql } = require('@tensei/graphql')
const { tensei, resource, text, integer } = require('@tensei/core')
tensei()
.root(__dirname)
.resources([resource('Cat').fields([text('Name'), integer('Age')])])
.plugins([auth().plugin(), graphql().plugin()])
.start()
.catch(console.error)
yarn dev
http://localhost:8810/graphql
mutation { insert_cats( objects:[{ name: "Tom", age: 3 }] ) { id } }
worksmutation { insert_cat( object:{ name: "Tom", age: 3 } ) { id } }
failed with{
"errors": [
{
"message": "Validation failed.",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"insert_cat"
],
"extensions": {
"errors": [
{
"message": "string validation failed on age",
"validation": "string",
"field": "age"
}
],
"code": "BAD_USER_INPUT",
"exception": {
"errors": [
{
"message": "string validation failed on age",
"validation": "string",
"field": "age"
}
],
"stacktrace": [
"UserInputError: Validation failed.",
" at Object.context.userInputError (/home/username/test/bug/node_modules/@tensei/graphql/build/index.js:445:67)",
" at /home/username/test/bug/node_modules/@tensei/graphql/build/Resolvers.js:59:31",
" at processTicksAndRejections (internal/process/task_queues.js:93:5)",
" at async /home/username/test/bug/node_modules/@tensei/graphql/build/index.js:446:32"
]
}
}
}
],
"data": null
}
insert one cat
In Graphql Playground, TYPE DETAILS for insert_cat(...):cat!
It reads age: String
. Is this a mistake?
N/A
N/A
Add support for Sqlite to the @tensei/knex package
After setting up authentication on my API, and then running yarn tensei-sdk g
command in my client application, the command did not generate complete types for my API. The tensei.auth().socialRedirectUrl()
was not present while trying to access the endpoint.
yarn add @tensei/sdk
yarn tensei-sdk g
or yarn tensei-sdk g the-url-your-api-is-running-on
import { sdk } from '@tensei/sdk' const tensei = sdk() export default tensei
tensei.auth().socialRedirectUrl()
.The yarn tensei-sdk g
command should generate complete types.
The plugin system needs improvement. There are currently six hooks, but it doesn't look too necessary.
A better way to handle life cycle hooks for plugins would be to have the beforeDatabaseSetup
and setup
hooks. Right now these are the only two that might be necessary.
Hooks for plugins should be easy to use and very necessary
If applicable, add screenshots to help explain your problem.
If applicable, add code samples to help explain your problem.
Add any other context about the problem here.
Hey @bahdcoder, I was thinking of using this in my next product. But I also have to feature a paywall to users. Is tensei integrable with Stripe or any other payment provider? Btw the lib is amazing... I made the whole backend in 1-2 hours... ๐
Thanks...
The Procedure component not adding new items when the 'enter' button is clicked.
The Procedure component should add new items when the 'enter' button is clicked.
If applicable, add code samples to help explain your problem.
Add any other context about the problem here.
REST API exposes hidden resources and fields
When I call the hideFromApi()
method on a resource, the resource still shows up in REST API.
The resource should be completely shielded, and should not show up.
This resource should not also show up in the queries of other related resources.
Hello, I just updated the @tensei/rest
package. One thing I noticed that tensei is not starting the rest api server. Earlier the api was working perfectly.
Any guess guys why this might be happening?
Here the code :
const { cms } = require("@tensei/cms");
const { auth } = require("@tensei/auth");
const { media, files, file } = require("@tensei/media");
const { graphql } = require("@tensei/graphql");
const { rest } = require("@tensei/rest");
tensei()
.root(__dirname)
.resources([
ActivityResource,
SchoolResource,
StudentResource,
AgeGroupResource,
StudentGenderResource,
UserGenderResource,
UserRoleResource,
LanguageResource,
resource("User Permission").fields([
belongsTo("User"),
text("Permisson Name"),
text("url"),
]),
])
.plugins([
welcome(),
cms().plugin(),
media().plugin(),
auth()
.setup(({ user }) => {
user.fields([
text("Name").searchable(),
text("Contact Number"),
hasMany("User Permission"),
date("Birth date"),
belongsTo("User Gender"),
belongsTo("User Role"),
text("Assigned Country"),
text("Assigned State"),
text("Assigned District"),
text("Address"),
integer("Points"),
]);
})
.plugin(),
graphql().plugin(),
rest().plugin(),
])
.register(({ app }) => {
app.use(require("cors")());
})
.start()
.catch(console.error);
Unable to start the Tensei server after running the yarn dev
command.
npx create-tensei-app your-app-name --template=rest
.yarn dev
to start the server.The server is meant to start properly without any errors and show a link in the terminal to access the server and cms.
Heyy @bahdcoder any idea on when the version 1.0 of Tensei will be released? I am thinking of using it in production of my startup. Great job dude.
Regards,
Manjit Pardeshi
Just wanted to ask if it have any Web interface like the Django Admin Panel...
dev
scripts command is wrong
yarn create tensei-app tensei
cd tensei
yarn dev
...
[nodemon] starting `node src/index index.js`
...
...
[nodemon] starting `node index.js`
...
N/A
N/A
this may fix it
{
"scripts": {
"dev": "nodemon index.js",
"start": "node index.js"
},
}
Why Person
give me both person
and people
named resources?
yarn create tensei-app persons
cd persons
index.js
asconst { auth } = require('@tensei/auth')
const { graphql } = require('@tensei/graphql')
const { tensei, resource, text, integer } = require('@tensei/core')
tensei()
.root(__dirname)
.resources([resource('Person').fields([text('Name'), integer('Age')])])
.plugins([auth().plugin(), graphql().plugin()])
.start()
.catch(console.error)
yarn dev
person
and people
named resourcesGot resources named as person
only
N/A
N/A
The standard methods this manager class should have are:
All of these methods should also be available on the DatabaseRepositoryInterface
I just started a fresh installation according to quick start. After cms login and redirecting from cmd link it shows errors here:
return window.Tensei.state.admin.admin_permissions.includes(e)
Do we have to implement admin permissions somehow?
Hey @bahdcoder, can you please guide me in sending a mail from a particular email address? I am using SMTP from SES. Here is my code snippet :
smtp("admin-auth")
.auth({
user: "USER",
pass: "PASS",
type: "login",
})
.port(587)
.host("*****.ap-south-1.amazonaws.com")
.plugin(),
How can we define the from
property here? As it is always sending email from no-reply@localhost:8810
which further gets soft bounced...
Thank You
Regards,
Manjit Pardeshi
Using graphql when trying to filter any resource with the where
it throws an error - string cannot represent a non-string value
A clear and concise description of what the bug is.
where
, use a boolean field for comparisons.I expect Graphql to fetch the appropriate result for my query
A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.
query {
products(where: { trending: { _eq: true }}) {
id
name
description
price
category {
name
}
}
}
If applicable, add code samples to help explain your problem.
Add any other context about the problem here.
Hello @bahdcoder I just made complete backend in Tensei, I was amazing... But now i have changed the db to MongoDb. How ever, I am unable to login now. What could be the reason and what I can do in this matter?
This is my package.json
{
"name": "tensei-awesome-app",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"@mikro-orm/mongodb": "^4.5.6",
"@tensei/auth": "^0.8.4",
"@tensei/cms": "^0.8.4",
"@tensei/core": "^0.8.4",
"@tensei/graphql": "^0.8.4",
"@tensei/media": "^0.8.4"
},
"scripts": {
"dev": "nodemon src/index",
"start": "node index.js"
},
"devDependencies": {
"@mikro-orm/sqlite": "^4.4.0",
"nodemon": "^2.0.7"
}
}
Index.js
const { cms } = require("@tensei/cms");
const { auth } = require("@tensei/auth");
const { media, files, file } = require("@tensei/media");
const { graphql } = require("@tensei/graphql");
const {
tensei,
welcome,
resource,
text,
integer,
hasOne,
textarea,
belongsTo,
belongsToMany,
hasMany,
date,
} = require("@tensei/core");
tensei()
.root(__dirname)
.plugins([
welcome(),
cms().plugin(),
media().plugin(),
auth()
.rolesAndPermissions()
.plugin(),
graphql().plugin(),
])
.databaseConfig({
type: "mongo",
dbName: "khelo_ka_raja",
clientUrl:
"mongodb+srv://mystring",
})
.start()
.catch(console.error);
Everything works just perfectly removing the db config. This also dosent show any error. Can you please help me in this? It would be great as I am in a hurry.
Regards,
@Manjit2003
Whenever I edit the user for example I have extened the user using
.setup(({ user }) => {
user.fields([
text("Avatar").nullable(),
select("Role").options(["Student", "Reviewer"]).nullable(),
]);
})
then whenever I try to edit the avatar of user from the cms, i keep the password field blank... But whenever the user trys to log in it shows invalid credentials
.setup(({ user }) => {
user.fields([
text("Avatar").nullable(),
select("Role").options(["Student", "Reviewer"]).nullable(),
]);
})
Only the avatar should change, not the password
request.manager should be a method. This method should take in a resource, and inject a resource into the Manager instance.
That way, the code will look like this:
manager('User').create(request, payload)
manager('User').database().deleteOneById()
Detail view not using resource label
When I set the label of a resource and visit the detail view on the CMS, I see the wrong label on relationships.
.label()
to all resources and give them labels.Relationships on detail view should show correct labels
This is the form view with correct labels:
This is the detail view with wrong labels:
Hello @bahdcoder, hope you are doing great!! I just had a question in my mind... What are your future plans regarding Tensei? You thinking to monetize this just like strapi? Or it will be just like what it is today?
Well Well... The project is doing absolutely great...
Regards,
@Manjit2003
A tutorial on how to setup social authentication with React and
Would give the community a better understanding of how social authentication works in Tensei
Select all the tutorial formats that apply:
A basic beautiful starter with React and Tensei, a tutorial that walks through setting up Google or Github authentication.
Implement more secure practices on passwordless authentication
When users request a magic link from the administration panel login page, we generate a magic link with a token and send them an email with this token. This token is currently a random string, but it needs to be better.
Let's implement the following operations on the string:
We would encrypt the token using standard token encryption before sending in the email. When we receive the email from the user's click, we'll decrypt the token before searching for it in our database.
Quick summary what's this feature request about.
More security on the platform
A clear and concise description of what you want to happen.
Let us know if this is related to any issue/pull request.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.