Postgres, Express, React, Node - Stack Boilerplate
🚧 WORK IN PROGRESS
🚧
upcoming features:
optional
Yarn (npm install)
git clone --depth 1 https://github.com/princejoogie/pern-boilerplate.git <project-name>
cd ./<project-name>/server && npm install
# or
cd ./<project-name>/server && yarn
ormconfig.json
# replace those with "< >" to how you setup your postgres
{
"type": "postgres",
"host": "localhost",
"port": 5432,
"username": <postgres-username>,
"password": <postgres-password>,
"database": <db-name>,
"synchronize": true,
"logging": true,
"entities": ["src/entity/**/*.ts"],
"migrations": ["src/migration/**/*.ts"],
"subscribers": ["src/subscriber/**/*.ts"],
"cli": {
"entitiesDir": "src/entity",
"migrationsDir": "src/migration",
"subscribersDir": "src/subscriber"
}
}
make sure to add postgres bin to environmental variables
createdb <db-name>
# or run the recreate sciprt
npm run schema:drop # !WARNING - this will recreate the database so only run this initially
.env
and .env.development
# Content of .env and .env.development should have these 4 variables
PORT=4000
BASE_URL=http://localhost
ACCESS_TOKEN_SECRET=access_token_secret_here
REFRESH_TOKEN_SECRET=refresh_token_secret_here
npm run migration:create && npm run migration:run
npm run dev
cd ./<project-name>/client && npm install
# or
cd ./<project-name>/client && yarn
npm run gen
npm run dev
Prince Carlo Juguilon