|
|
7 éve | |
|---|---|---|
| admin-ui | 7 éve | |
| docs | 7 éve | |
| server | 7 éve | |
| shared | 7 éve | |
| .editorconfig | 7 éve | |
| .gitignore | 7 éve | |
| .lintstagedrc.yml | 7 éve | |
| .prettierrc | 7 éve | |
| .travis.yml | 7 éve | |
| CONTRIBUTING.md | 7 éve | |
| LICENSE | 7 éve | |
| README.md | 7 éve | |
| graphql.config.json | 7 éve | |
| package.json | 7 éve | |
| schema.json | 7 éve | |
| tslint.json | 7 éve | |
| yarn.lock | 7 éve |
A headless GraphQL ecommerce framework built on NestJS with TypeScript.
Currently in pre-alpha, i.e. it is not yet useable.
Vendure is a headless framework, which means that it is just an API serving JSON via a GraphQL endpoint. The code for
the server is located in the server directory.
We will ship with an administration UI which is a stand-alone web application which can be used to perform tasks such
as inventory, order and customer management. The code for this is located in the admin-ui directory.
The server requires an SQL database to be available. I am currently using bitnami-docker-phpmyadmin Docker image, which is MariaDB including phpMyAdmin.
Vendure uses TypeORM, so it compatible will any database which works with TypeORM.
cd server && yarnyarn start:devyarn populatecd admin-ui && yarnyarn startVendure server will detect the most suitable locale based on the Accept-Language header of the client.
This can be overridden by appending a lang query parameter to the url (e.g. http://localhost:3000/api?lang=de).
All locales in Vendure are represented by 2-character ISO 639-1 language codes.
The developer may add custom fields to most of the entities in Vendure, which may contain any data specific to their business requirements. For example, attaching extra login data to a User or some boolean flag to a Product.
Custom fields can currently be added to the following entities:
Custom fields are configured by means of a customFields property in the VendureConfig object passed to the bootstrap() function.
bootstrap({
port: API_PORT,
apiPath: API_PATH,
cors: true,
jwtSecret: 'some-secret',
dbConnectionOptions: {
// ...
},
customFields: {
Product: [
{ name: 'infoUrl', type: 'string' },
{ name: 'downloadable', type: 'boolean' },
{ name: 'shortName', type: 'localeString' },
],
User: [
{ name: 'socialLoginToken', type: 'string' },
],
},
})
When Vendure runs, the specified properties will be added to a customFields property of the Product and User entities, and
the GraphQL schema will be updated to reflect the availability of these fields.
In the admin UI, there will be form inputs which allow these fields to be updated by an administrator.
Currently the supported types are:
| type | corresponding type in DB | corresponding GraphQL type |
|---|---|---|
| string | varchar | String |
| localeString | varchar | String |
| int | int | Int |
| float | double | Float |
| boolean | bool / tinyint | Boolean |
| datetime | datetime / timestamp | String |
Note that the "localeString" type can be localized into any languages supported by your instance.
The following types are under consideration:
Currently a custom field configuration has only a "name" and "type". We will be adding further configuration options in the future as the framework matures. Currently-planned options are:
MIT