Skip to content

cesaraaron/my-app-server

Repository files navigation

my-app-server

The server of my-app-universal

Getting started

Prerequisites

  • Yarn

Installing

# Clone the repo
$ git clone /~https://github.com/cesaraaron/my-app-server && cd my-app-server

# Install dependencies
$ yarn install

If you already have a prima server up and running, create a .env.local file on the root directory with the following keys set to:

PRISMA_ENDPOINT= # the url of the prisma server
PRISMA_SECRET= # can be anything
APP_SECRET= # can be anything

Then run:

$ yarn deploy

If you don't have a server:

$ yarn deploy -n

When prompt:

  1. Use a demo server.

  2. If you haven't registered with Prisma Cloud before, the CLI will now open a browser window asking you to sign up.

  3. Follow the instructions in the browser to register with Prisma Cloud.

  4. Select either demo-eu1 or demo-us1

  5. Just confirm the suggested values by hitting Enter two times.

Copy the endpoint value of ./database/prisma.yml and paste it into PRISMA_ENDPOINT of .env.local

Start the development server:

$ yarn dev

Deployment

Prerequisites

Make sure the managementApiSecret of docker-compose.yaml matches the PRISMA_MANAGEMENT_API_SECRET in .env.production before deploying.

Installing

# Clone the repo
$ git clone /~https://github.com/cesaraaron/my-app-server && cd my-app-server


# Install dependencies
$ yarn install

# Fetch the prisma & mysql docker images and run them in the background
$ docker-compose up -d

# Build the graphql-yoga server
$ yarn build

# Create a local .env.production file on your server and add your env variables
# If you already have a .env.production file with all the 4 varialbes set, skip this step.
$ cp .env .env.production && vim .env.production

# Run the graphql-yoga server in the background
$ dotenv -e .env.production -- pm2 start dist/index.js --name my-app-server

Built with

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published