Added a README.md that covers local user testing and a link to the production api.
This commit is contained in:
20
README.md
Normal file
20
README.md
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
Local User Testing:
|
||||||
|
|
||||||
|
1. Create a Postgres DB
|
||||||
|
- name: idea_tracker
|
||||||
|
- user: postgres
|
||||||
|
- password: 1234
|
||||||
|
- port: 5432
|
||||||
|
* NOTE: A command you will run later will create the .env file, so feel free to alter that after the fact if you don't want to use those credentials or DB name
|
||||||
|
2. Run the following commands
|
||||||
|
- npm install
|
||||||
|
- npm run migrate:dev
|
||||||
|
- npx prisma generate
|
||||||
|
- npm run setup:env
|
||||||
|
- npm run seed:dev
|
||||||
|
- npm run dev
|
||||||
|
|
||||||
|
Production User Testing:
|
||||||
|
|
||||||
|
- Go to https://idea-tracker-api.onrender.com/api-docs
|
||||||
|
- This will likely take some time unless the server has been used recently. Render shuts it down if there isn't any traffic on their free development servers and I am unwilling to pay to keep it live.
|
||||||
BIN
Updated Code.zip
BIN
Updated Code.zip
Binary file not shown.
@@ -9,10 +9,11 @@
|
|||||||
"seed:dev": "node --env-file=.env prisma/seed.js",
|
"seed:dev": "node --env-file=.env prisma/seed.js",
|
||||||
"seed:prod": "node prisma/seed.js",
|
"seed:prod": "node prisma/seed.js",
|
||||||
"migrate:dev": "npx prisma migrate dev",
|
"migrate:dev": "npx prisma migrate dev",
|
||||||
"migrate:deploy": "npx prisma migrate deploy"
|
"migrate:deploy": "npx prisma migrate deploy",
|
||||||
|
"setup:env": "node -e \"const fs = require('fs'); const secret = require('crypto').randomBytes(32).toString('hex'); const content = `PORT=8080\\nNODE_ENV=development\\nDATABASE_URL=postgresql://postgres:134@localhost:5432/idea_tracker\\nJWT_SECRET=${secret}\\nJWT_EXPIRES_IN=1h\\n`; if (!fs.existsSync('.env')) { fs.writeFileSync('.env', content); console.log('.env file created with a fresh JWT_SECRET.'); } else { console.log('.env already exists, skipping generation.'); }\""
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "",
|
"author": "Lew Price",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
BIN
src/.DS_Store
vendored
Normal file
BIN
src/.DS_Store
vendored
Normal file
Binary file not shown.
Reference in New Issue
Block a user