Skip to content

Commit ec7e9d9

Browse files
authored
Merge pull request #21 from atlp-rwanda/feat-CRUD-product-187419064
#187419064 A seller should be able to CRUD products
2 parents 76408a9 + 8be3be9 commit ec7e9d9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+3247
-658
lines changed

.env-example

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
PORT = <Your application port>
2+
3+
SERVER_URL=http://localhost:<PORT>
4+
DEPLOYED_URL=https://hackers-ec-be.onrender.com
5+
16
DB_DEV_URL=postgres://<user>:<password>@localhost:5432/<database>
27
DB_TEST_URL=
38
DB_PROD_URL=
49
DEV_MODE=development
510
DB_HOSTED_MODE=local
6-
PORT = <Your application port>
711

812
SESSION_SECRET=
913

@@ -27,3 +31,6 @@ SERVICE = < your SERVICE >
2731
EMAIL=<your email>
2832
PASSWORD=<email password>
2933

34+
CLOUDINARY_CLOUD_NAME=
35+
CLOUDINARY_API_KEY=
36+
CLOUDINARY_API_SECRET=

.github/workflows/node.js.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ jobs:
3131
DB_PROD_URL: ${{ secrets.DB_PROD_URL }}
3232
DB_DEV_URL: ${{ secrets.DB_DEV_URL }}
3333
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
34-
35-
DEPLOYED_URL: ${{ secrets.DEPLOYED_URL }}
3634
CLOUDINARY_CLOUD_NAME: ${{ secrets.CLOUDINARY_CLOUD_NAME }}
3735
CLOUDINARY_API_KEY: ${{ secrets.CLOUDINARY_API_KEY }}
3836
CLOUDINARY_API_SECRET: ${{ secrets.CLOUDINARY_API_SECRET }}
3937
CLOUDINARY_FOLDER_NAME: ${{ secrets.CLOUDINARY_FOLDER_NAME }}
38+
SERVER_URL: ${{ secrets.SERVER_URL }}
39+
DEPLOYED_URL: ${{ secrets.DEPLOYED_URL }}
4040
JWT_SECRET: ${{ secrets.JWT_SECRET }}
4141
strategy:
4242
matrix:
@@ -52,12 +52,14 @@ jobs:
5252
run: npm install
5353
- name: Run tests
5454
run: npm run test
55+
5556
- name: Setup Code Climate test-reporter
5657
run: |
5758
# Download test reporter as a static binary
5859
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
5960
chmod +x ./cc-test-reporter
6061
./cc-test-reporter before-build
62+
6163
- name: Store coverage report
6264
if: always()
6365
run: mkdir -p coverage

package-lock.json

+147-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"dev": "ts-node-dev --require dotenv/config src/index.ts",
88
"build": "tsc",
99
"start": "node --require dotenv/config dist/index.js",
10+
"drop-all-tables": "psql -U your_username -d your_database_name -c \"SELECT 'DROP TABLE IF EXISTS \"' || tablename || '\" CASCADE;' FROM pg_tables WHERE schemaname = 'public'\" | psql -U your_username -d your_database_name",
1011
"migrate": "npx sequelize-cli db:migrate",
1112
"migrate:reset": "npx sequelize-cli db:migrate:undo:all && npm run migrate && npm run seed",
1213
"migrate:down": "sequelize cli db:migrate:undo:all",
@@ -31,11 +32,13 @@
3132
"bcrypt": "^5.1.1",
3233
"cross-env": "^7.0.3",
3334
"cors": "^2.8.5",
35+
"cloudinary": "^2.2.0",
3436
"dotenv": "^16.4.5",
3537
"express": "^4.19.2",
3638
"express-session": "^1.18.0",
3739
"joi": "^17.12.3",
3840
"jsonwebtoken": "^9.0.2",
41+
"multer": "^1.4.5-lts.1",
3942
"nodemailer": "^6.9.13",
4043
"npm-run-all": "^4.1.5",
4144
"passport": "^0.7.0",
@@ -66,7 +69,8 @@
6669
"/src/database/config",
6770
"src/helpers",
6871
"src/documention/index.ts",
69-
"/src/utils"
72+
"/src/utils",
73+
"src/middlewares/multer.ts"
7074
]
7175
},
7276
"devDependencies": {
@@ -77,6 +81,7 @@
7781
"@types/express-session": "^1.18.0",
7882
"@types/jest": "^29.5.12",
7983
"@types/jsonwebtoken": "^9.0.6",
84+
"@types/multer": "^1.4.11",
8085
"@types/node": "^20.12.7",
8186
"@types/nodemailer": "^6.4.14",
8287
"@types/passport": "^1.0.16",

0 commit comments

Comments
 (0)