A simple boilerplate for the PERN stack using Vite.js. It includes Node-Postgres v8.8, Express, React 18, React Router DOM v6.6, Morgan, Axios, jsonwebtoken, bcrypt, dotenv, and Nodemon.
This boilerplate was made using the official Vite template(npm create vite@latest my-app -- --template react
) for the client. Then, the backend was built around it. You can find more templates to scaffold your project using Vite, here or community templates on Awesome Vite.js.
npx degit seanhagstrom/Vite-PERN my-app
cd my-app
cd client && npm install
cd .. && npm install
npm run start:dev
The above installation should remove the
.git
history. If it didn't run the following script:
rm -rf .git
Once the
.git
history has been erased, initialize the project as a git repository with the following command:
git init
Before you run
npm run seed
, you'll need to update the package.json name to the name of your db and create your database inpsql
. You can do this from the CLI with the following command:
createdb your_database_name
Happy coding!