Vulcan Next logoVN Live Documentation

Previous page

Back to documentation index


Graphql + Mongo backend

Authentication

Passport authentication

Access the See the home page footer to access signup, login, logout and profile page. Implementation is based on Next official example with Passport and Next Connect

Experimental SSR redirection

This feature is experimental and not useful in most scenarios. We advise to stick to client-side only patterns. See relevant issue.

See src/pages/vn/debug/private for a demo. You can use withPrivateAccess HOC to make a page private and handle redirections correctly in all situations (server-side, client-side, in the context of a static export etc.).

Apollo Server

Demo of a simple server

See src/pages/api/graphql for a demo server built with Apollo and Express

NOTE: Expect drastic enhancement of the way the server is set up, thanks to VulcanJS declarative approach.

GraphQL Playground

GraphQL Playground is available on api/graphql. All API routes of Next are located in the src/pages/api folder, hence the api prefix.

Graphql Voyager

Open api/debug/graphql-voyager and explore your API visually.

MongoDB

Persistance with Mongo through Docker

As easy as ABC:

yarn start:mongo

It will run an ephemeral Docker instance of Mongo v4. Data are stored in your project, in the ./.mongo folder. The container is removed when stopped, but your data are persisted and will still be available on next run.

Lambda safe connection

Relevant docs:

Official tutorial without mongoose

Best practice for Mongo in AWS Lambda

Mongoose for schema-based modeling

Conversion between GraphQL ID and Mongoose ID types

See relevant issue


Previous page

Back to documentation index