This is the API to create the React Avançado Landing Page.
This project uses PostgreSQL, so, in order to make it working, install in your local machine or use Docker.
The configuration to the Database can be found on config/database.js
After cloning this project, install the dependencies:
yarn install
And run using:
yarn develop
The urls to access are:
http://localhost:1337/admin
- The Dashboard to create and populate datahttp://localhost:1337/graphql
- GraphQL Playground to test your queries
The first time to access the Admin you'll need to create an user.
This project uses Postgres
and if you want all the data previously, unzip the data.zip, copy the uploads
folder to public/uploads and restore the data from the local.dump
file inside the zip.
brew install postgresql
pg_ctl -D /usr/local/var/postgres start
psql postgres
postgres=# CREATE ROLE strapi WITH LOGIN PASSWORD 'strapi';
postgres=# ALTER ROLE strapi WITH PASSWORD 'strapi123';
or
postgres=# ALTER user strapi with encrypted password 'strapi123';
postgres=# \du
postgres=# \l
- superuser: paulajbastos
postgres=# ALTER ROLE strapi CREATEDB;
psql postgres -U strapi
CREATE DATABASE strapi;
DROP DATABASE IF EXISTS strapi;
GRANT ALL PRIVILEGES ON DATABASE strapi TO strapi;
brew services restart postgresql
or
pg_ctl -D /usr/local/var/postgres stop
pg_ctl -D /usr/local/var/postgres start
➜ ~ psql -h 127.0.0.1 -U strapi -d strapi -W < strapi_dump.sql
Strapi Login: paulajbastos@gmail.com
Strapi Senha: Admin123
(https://strapi.io/documentation/v3.x/migration-guide/migration-guide-3.0.x-to-3.1.x.html)
node -e "console.log(require('crypto').randomBytes(64).toString('base64'))" # (all users)
heroku config
postgres://username:password@host:port/dbname
heroku config:set DATABASE_USERNAME=username
heroku config:set DATABASE_PASSWORD=password
heroku config:set DATABASE_HOST=host
heroku config:set DATABASE_PORT=5432
heroku config:set DATABASE_NAME=dbname
heroku config:set ADMIN_JWT_SECRET=gerarToken
PGPASSWORD=strapi123 pg_dump -Fc --no-acl --no-owner -h localhost -U strapi strapi > strapi-local.dump
heroku pg:backups:restore 'https://paulajbastosdev.com/strapi-local.dump' DATABASE_URL