npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@prisma-cms/boilerplate

v2.0.10

Published

Opensource framework CMS powered by GraphQL, Prisma, MySQL, React & Apollo GraphQL

Downloads

12

Readme

🙌 Sorry for my english...

Examples

Example 1

Extends type User. Add custom fields

Example 2

Remove some fields from API schema

=========================================

Installation

Base requirements

Linux server

i used ubuntu-18 on digitalocean.com (referral link) with 2GB tarif plan for $10/month

sudo apt update
sudo apt upgrade -y

Install common programs

sudo apt install -y mc git build-essential
# Create user (not required if you use another user)
sudo useradd USERNAME -d /home/USERNAME -G sudo -s /bin/bash
sudo mkdir /home/USERNAME
cd /home/USERNAME

# for bash hightlighting
wget https://gist.githubusercontent.com/Fi1osof/2f8ea23f5411c5c7a0e0025f04941aee/raw/.bashrc 

sudo chown USERNAME: /home/USERNAME -R

# set password
passwd USERNAME

Install node-js and npm

curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
sudo apt-get install -y nodejs

Check node-js node -v

Install yarn

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn

Check yarn yarn -v

Install prisma

sudo npm i -g prisma npm-run-all nodemon pm2

Check prisma prisma -v

Reset homedir permissions

sudo chown $(whoami): ~ -R

Create /var/www if not exists

sudo mkdir /var/www
sudo chown $(whoami): /var/www -R

Install @prisma-cms/boilerplate

cd /var/www
git clone https://github.com/prisma-cms/boilerplate
cd boilerplate
yarn --ignore-engines
# Fix Error: Cannot find module '../build/Release/sharp.node'
npm rebuild

Deploy schema

There two variants to use:

Signup on www.prisma.io/cloud/

If you use Prisma Cloud, first you need signin. Note: for authorize required browser able opened from commandline. If you want authorize on server which does not have X and can not run browser, you should install prisma localy on your own computer, run prisma login localy, then copy local file ~/.prisma/config.yml on target server.

Check you is logged in.

prisma account

If you loged in success, you can run yarn deploy.

Install prisma local

Install docker

sudo apt-get install software-properties-common python-software-properties
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main'
sudo apt-get update
sudo apt-get install -y docker-engine

Check docker installed docker -v

Install docker-compose

sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

Check docker-compose docker-compose -v

Start prisma docker images

Note: before do this, you can edit src/server/schema/prisma/docker-compose.yml for change prisma port and password.

sudo docker-compose -f ./src/server/schema/prisma/docker-compose.yml up -d

Start PhpMyAdmin (optionaly)

sudo docker run -d --link prisma_mysql_1:db --network prisma_default -p 8080:80 phpmyadmin/phpmyadmin

Deploy

If you use Prisma Cloud, you'll get endpoint automatically, just run:

yarn deploy

If you use Prisma local, you should specify endpoint by youself, for example:

endpoint=http://localhost:4466/my-project/my-stage yarn deploy

Note: you sould not execute this commands separately from yarn deploy, but may, if undestand what they are doing.

This command run several commands:
1. `yarn build-schema-prisma` - generate raw graphql schema (for backend)
2. `yarn deploy-schema` - deploy generated schema into prisma server. <br />
  If you deploy schema for update exists database and wont force deploy while prisma reject deleting data, you may use `yarn deploy-schema -f` OR `yarn deploy-force` (for run complete procedure).
3. `yarn get-schema -p prisma` - get schema from prisma server
4. `yarn build-schema-api` - generate API schema (for frontend)
5. `yarn generate-fragments-api` - generate JS fragments for apollo client.

Run server API

APP_SECRET={MY_ULTRA_SECRET_KEY} endpoint={endpoint} yarn start-server

Current endpoint after deploy you may see by this command (look for uncommented endpoint):

cat src/server/schema/prisma/prisma.yml |grep endpoint

For example:

APP_SECRET=MY_SECRET endpoint=https://eu1.prisma.sh/username/prisma/dev yarn start-server-dev

Open http://localhost:4000 (or http://server_address:4000)

Here you may write graphql requests.

Run frontend server

# start server on PORT 3000
yarn start

Open http://localhost:3000

# specify your own port
PORT=3223 yarn start

# or run on default web-port (admin permissions required)
sudo PORT=80 yarn start

# or run https (admin permissions required, used self-signed certificate)
sudo HTTPS=true PORT=443 yarn start

Build scripts and run Server-Side-Rendering server (SSR)

Build scripts

PUBLIC_URL=/ yarn build

Run SSR server

yarn start-ssr

Known Issues

Cannot find module '../build/Release/sharp.node'

rm yarn.lock -f
npm rebuild

Crash server if used more that one sharp version

Check that installed one sharp modules

find -regex .*/node_modules/sharp$

Should be only one modules ./node_modules/sharp

ToDo:

  1. Write using nginx docs
  2. Write server customization docs
  3. Write frontend customization docs
  4. Examples

Support project

We are looking for sponsors.

Also you may support by paypal.com (send for [email protected]) or ETH 0x4c791666351Ec3b223acF96C9d9BE431679E5C04