Vendure: Documentation - Deploy

Created on 20 Nov 2019  路  5Comments  路  Source: vendure-ecommerce/vendure

Is your feature request related to a problem? Please describe.
Currently, we run the server from "dev-server" it's great!

Describe the solution you'd like
For production deployment? do we copy "dev-server" and rename it to production?

Describe alternatives you've considered
Been trying to run it like a normal nodeJS app, but not having much luck.

Additional context

Most helpful comment

You basically never need to use the dev-server unless you are contributing to this repo directly.

To create a plugin you would do that in your newly-created project. The way I structure my projects is like this:

dist/
src/
  |- index.ts (etc)
  |-plugins/
      |- some-plugin/
            |- some-plugin.ts
            |- (other files/dirs used by the plugin)

I would also like to add additional queries to shop-api and extend the schema with new columns.
Docs on extending the GraphQL API

To add new columns, the simplest way is to add CustomFields as part of your plugin. If you require more complex data to be stored than is possible with custom fields, you would need to define a new TypeORM entity

I am aware that the plugins system is somewhat under-documented. I plan on creating a "real-world Vendure" repo which includes a fully-featured plugin implementation which demonstrates all of these concepts soon.

All 5 comments

Currently, we run the server from "dev-server" it's great!

Glad you had success with that, but actually the dev server is only intended to be used when developing the Vendure framework core & plugins themselves!

The recommended way to build a project with Vendure is given in the "getting started" guide: https://www.vendure.io/docs/getting-started/

The advantage of doing it that way is that you don't need to clone the entire Vendure monorepo (which is pretty big and includes lots of build/testing related code that is not needed for a production project).

So I'd recommend you follow the getting started guide, create a new project and then copy your existing code over to the resulting folder structure, because it includes a build step which will output transpiled JavaScript which can then be served for production.

Cool! thank you for clearing that up for me, i was a bit confused :-)

@michaelbromley don't mean to be pest. Creating new plugins - https://www.vendure.io/docs/developer-guide/plugins/writing-a-vendure-plugin/ is this done under the dev-server environment?

Or

Would i create new plugins with my own business logic under the newly created project outlined on "Getting Started"? I would also like to add additional queries to shop-api and extend the schema with new columns.

You basically never need to use the dev-server unless you are contributing to this repo directly.

To create a plugin you would do that in your newly-created project. The way I structure my projects is like this:

dist/
src/
  |- index.ts (etc)
  |-plugins/
      |- some-plugin/
            |- some-plugin.ts
            |- (other files/dirs used by the plugin)

I would also like to add additional queries to shop-api and extend the schema with new columns.
Docs on extending the GraphQL API

To add new columns, the simplest way is to add CustomFields as part of your plugin. If you require more complex data to be stored than is possible with custom fields, you would need to define a new TypeORM entity

I am aware that the plugins system is somewhat under-documented. I plan on creating a "real-world Vendure" repo which includes a fully-featured plugin implementation which demonstrates all of these concepts soon.

Man! thank you, really appreciate you taking the time. It makes total sense.

A hello world project would be amazing!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

michaelbromley picture michaelbromley  路  3Comments

option-greek picture option-greek  路  3Comments

michaelbromley picture michaelbromley  路  6Comments

hendrik-advantitge picture hendrik-advantitge  路  6Comments

chladog picture chladog  路  7Comments