Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ft authorization 187584917 #27

Closed
wants to merge 103 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
c8a99c5
Initial commit
Anguandia May 10, 2024
58560da
Set up an empty Express Boilerplate with dotenv
ProgrammerDATCH May 11, 2024
192095b
Merge pull request #1 from atlp-rwanda/chore-setup-boilerplate
ProgrammerDATCH May 11, 2024
2c260a7
Setup API documentation using swagger
MANISHIMWESalton May 11, 2024
d486290
Merge pull request #2 from atlp-rwanda/chore-setup-swagger
MANISHIMWESalton May 11, 2024
54800bf
Setting houndci badge
AimePazzo May 13, 2024
02fe26a
[Delivers #187584905] Integrate CirlceCI
SaddockAime May 13, 2024
25598c1
Setting github action workflows
AimePazzo May 13, 2024
969ea85
Setting github action workflows
AimePazzo May 14, 2024
a71f916
Added sequelize
Fabrice-Dush May 14, 2024
38b9e32
Added sequelize
Fabrice-Dush May 14, 2024
d0d5eea
Added Sequelize
Fabrice-Dush May 14, 2024
748703b
Added sequelize
Fabrice-Dush May 14, 2024
063a488
Merge pull request #3 from atlp-rwanda/chore-setup-db-engine
Fabrice-Dush May 14, 2024
3f9e314
setting simple test
AimePazzo May 14, 2024
f202b29
setting simple test
AimePazzo May 14, 2024
40df81c
setting simple test
AimePazzo May 14, 2024
68533cd
merging with develop
AimePazzo May 14, 2024
0e1347b
fixing spelling words
AimePazzo May 14, 2024
74ddb1f
coverage status badge
SaddockAime May 14, 2024
a53f33b
setting codecov badge
AimePazzo May 14, 2024
8828f1d
Merge pull request #4 from atlp-rwanda/ch-setup-ci
AimePazzo May 14, 2024
bd35ace
Update ci.yml
AimePazzo May 14, 2024
8caa900
Modified structure of codebase to fit our needs (#6)
ProgrammerDATCH May 15, 2024
aeb72d0
[finishes #187612234] Update ReadMe to Check Pivotal Tracker (#10)
ProgrammerDATCH May 17, 2024
d0d7ac5
Setup docker (#9)
ndahimana154 May 17, 2024
b9c84f8
Ch deploy application 187584908 (#11)
ProgrammerDATCH May 17, 2024
2e00db8
Test auto deployment (#14)
ProgrammerDATCH May 20, 2024
8c9088c
[finishes #187584862] Added EsLint and Pre-commit hook (#16)
ProgrammerDATCH May 20, 2024
8462809
[finishes #187584899] Configure The App to use PostgreSQL as DB Engin…
AimePazzo May 20, 2024
3254abc
[fixes #187584899]Merged conflict
AimePazzo May 20, 2024
17e2f93
[fixes #187584899] wrong spelling in test
AimePazzo May 20, 2024
6744a22
Added instructions in README file
AimePazzo May 20, 2024
f761863
Testing auto deployment (#18)
ProgrammerDATCH May 21, 2024
8618461
Test auto deploy via hooks (#19)
ProgrammerDATCH May 21, 2024
334048d
Re-test auto deployment (#20)
ProgrammerDATCH May 21, 2024
f16f59f
[fixes #187584899] Added environment variable for testing(online) and…
AimePazzo May 21, 2024
b946394
[fixes #187584899]Merge branch develop
AimePazzo May 21, 2024
3a8bfc3
correct ci
AimePazzo May 21, 2024
078ce9d
[finishes #187584908] Auto Deploy app to render (#21)
ProgrammerDATCH May 21, 2024
452bcb6
Merge branch 'develop'
AimePazzo May 21, 2024
4e31c2f
secret variable in env.example
AimePazzo May 21, 2024
3067e96
removed unwanted folder
AimePazzo May 21, 2024
1e0758b
modified testing script
AimePazzo May 21, 2024
890aea3
modified ci
AimePazzo May 21, 2024
b731d39
modified testing script
AimePazzo May 21, 2024
92520ce
modified testing script
AimePazzo May 21, 2024
d61bf8b
updating ci
AimePazzo May 21, 2024
3d01fa9
updating ci
AimePazzo May 21, 2024
ca57a7f
updating ci
AimePazzo May 21, 2024
4830413
[fixes #187584899] final
AimePazzo May 21, 2024
b4712bf
[fixes #187584899] final
AimePazzo May 21, 2024
c76b096
[fixes #187584899] final
AimePazzo May 21, 2024
88238b4
added .env.example
AimePazzo May 21, 2024
10e3fe9
added .env.example
AimePazzo May 21, 2024
4dd55eb
started task
AimePazzo May 22, 2024
8b903a3
Merge branch 'develop' into ft-registration-187584912
AimePazzo May 22, 2024
ed7ef8e
[Delivers #187584912] Started my task
AimePazzo May 22, 2024
74026bb
[Delivers #187584912] Started
AimePazzo May 23, 2024
194a0be
[Finishes #187584912] test are passing 100%
AimePazzo May 23, 2024
3a9e89b
[Finishes #187584912] test are passing 100%
AimePazzo May 23, 2024
48fdf57
[Finishes #187584912] test are passing 100%
AimePazzo May 23, 2024
ab76a00
[Finishes #187584912] setting test to use online database
AimePazzo May 23, 2024
7bd5c9c
[Fixes #187584912] test status must be true not false
AimePazzo May 23, 2024
7233562
[Fixes #187584912] coverage to use online db
AimePazzo May 23, 2024
6a5ddfc
[Fixes #187584912] extended timeout
AimePazzo May 23, 2024
3c6c004
[Fixes #187584912] extended timeout
AimePazzo May 23, 2024
a373ef4
[Fixes #187584912] added another environment in repo
AimePazzo May 23, 2024
d8c0874
[Fixes #187584912] added another environment in repo
AimePazzo May 23, 2024
bc3ebc2
added dist folder
AimePazzo May 23, 2024
88bff5a
[finishes 187584912] apply all feedbacks
AimePazzo May 23, 2024
b9bb1dd
[finishes 187584912] added dist in gitignore
AimePazzo May 23, 2024
ff78044
[finishes 187584912] updated generateToken
AimePazzo May 23, 2024
8d3c712
[finishes 187584912] updated test
AimePazzo May 23, 2024
a2d0e96
[fixes #187584912] fexes spilling and testing online
AimePazzo May 24, 2024
91de215
[fixes 187584912] added upload image functionality and write test
AimePazzo May 24, 2024
709ca97
using production db
AimePazzo May 24, 2024
d1174d4
using test db
AimePazzo May 24, 2024
8055270
Changed database configuration
AimePazzo May 25, 2024
61a5d7b
Changed database configuration
AimePazzo May 25, 2024
b7fcf50
debuging
AimePazzo May 25, 2024
ef841ad
[finishes #187584912] correcting test now it 100%
AimePazzo May 26, 2024
7081c07
[finishes #187584912] correcting test now it 100%
AimePazzo May 26, 2024
1e82837
[finishes #187584912] update api_key
AimePazzo May 26, 2024
a60e711
[finishes #187584912] update JWT_SECRET
AimePazzo May 26, 2024
8b45c43
[finishes #187584912] update circleCI
AimePazzo May 26, 2024
2930c5f
Updated config.yml
AimePazzo May 26, 2024
c44f12d
Updated config.yml
AimePazzo May 26, 2024
5722f30
Updated config.yml
AimePazzo May 26, 2024
a8e23b7
Updated config.yml
AimePazzo May 26, 2024
cf02fd1
Updated config.yml
AimePazzo May 26, 2024
3ac7ee7
Updated config.yml
AimePazzo May 26, 2024
26f5a5a
Updated config.yml
AimePazzo May 26, 2024
2587bf7
Updated config.yml
AimePazzo May 26, 2024
ea8e3ac
Updated config.yml
AimePazzo May 26, 2024
c30b9ae
Updated config.yml
AimePazzo May 26, 2024
2435b20
Updated config.yml
AimePazzo May 26, 2024
3945415
Updated config.yml
AimePazzo May 26, 2024
ab62dec
Updated config.yml
AimePazzo May 26, 2024
316079f
Updated config.yml
AimePazzo May 26, 2024
3657a13
[fixes #187584912] removed circleCi
AimePazzo May 26, 2024
db8050c
[fixes #187584912] fixed yml syntax CI
AimePazzo May 26, 2024
f08a84d
Added authorization middleware
Fabrice-Dush May 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 0 additions & 48 deletions .circleci/config.yml

This file was deleted.

38 changes: 31 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@ on:
push:
branches:
- develop

env:
PORT: ${{ secrets.PORT }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
DATABASE_PORT_TEST: ${{ secrets.DATABASE_PORT_TEST }}
DATABASE_HOST_TEST: ${{ secrets.DATABASE_HOST_TEST }}
DATABASE_NAME_TEST: ${{ secrets.DATABASE_NAME_TEST }}
DATABASE_USERNAME_TEST: ${{ secrets.DATABASE_USERNAME_TEST }}
DATABASE_PASSWORD_TEST: ${{ secrets.DATABASE_PASSWORD_TEST }}
DATABASE_TEST_URL: ${{ secrets.DATABASE_TEST_URL }}
NODE_EN: ${{ secrets.NODE_EN }}
DATABASE_URL_PRO: ${{ secrets.DATABASE_URL_PRO }}
API_KEY: ${{ secrets.API_KEY }}
API_SECRET: ${{ secrets.API_SECRET }}
CLOUD_NAME: ${{ secrets.CLOUD_NAME }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}

jobs:
build:
Expand All @@ -26,20 +29,41 @@ jobs:

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm install
- run: npm ci

- name: Install dependencies
run: |
npm install husky --save-dev
npm install

- name: Set NODE_ENV to test
run: echo "NODE_ENV=test" >> $GITHUB_ENV

- run: npm run build --if-present

- run: npm test --if-present

- run: npm run coverage --if-present

- name: Setup Code Climate test-reporter
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build

- name: Send coverage report to Code Climate
run: ./cc-test-reporter after-build -t lcov

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@v2
env:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ node_modules/
coverage
.nyc_output
.vscode
dist
.cache_ggshield
dist

14 changes: 6 additions & 8 deletions .sequelizerc
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
require("@babel/register");
const path = require('path');

const path = require("path");
module.exports = {
"config": path.resolve('./dist/src/databases/config', 'config.js'),
"migrations-path": path.resolve('./dist/src/databases/migrations'),
"seeders-path": path.resolve('./dist/src/databases/seeders'),
"models-path": path.resolve('./dist/src/databases/models'),
};
'config': path.resolve('dist/src','databases', 'config', 'config.js'),
'models-path': path.resolve('dist/src','databases', 'models'),
'seeders-path': path.resolve('dist/src','databases', 'seeders'),
'migrations-path': path.resolve('dist/src','databases', 'migrations')
};
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ This is the backend for E-Commerce-Ninjas, written in Node.js with TypeScript.
[![Maintainability](https://api.codeclimate.com/v1/badges/839fc3fa18d25362cd8b/maintainability)](https://codeclimate.com/github/atlp-rwanda/e-commerce-ninjas-bn/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/839fc3fa18d25362cd8b/test_coverage)](https://codeclimate.com/github/atlp-rwanda/e-commerce-ninjas-bn/test_coverage)
[![Coverage Status](https://coveralls.io/repos/github/atlp-rwanda/e-commerce-ninjas-bn/badge.svg)](https://coveralls.io/github/atlp-rwanda/e-commerce-ninjas-bn)
[![CircleCI](https://dl.circleci.com/status-badge/img/gh/atlp-rwanda/e-commerce-ninjas-bn/tree/develop.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/atlp-rwanda/e-commerce-ninjas-bn/tree/develop)
[![codecov](https://codecov.io/gh/atlp-rwanda/e-commerce-ninjas-bn/graph/badge.svg?token=6ZWudFPM1S)](https://codecov.io/gh/atlp-rwanda/e-commerce-ninjas-bn)

## HOSTED SERVER URL
Expand Down Expand Up @@ -81,6 +80,40 @@ This is the backend for E-Commerce-Ninjas, written in Node.js with TypeScript.
- `services/`: Service functions like sendEmails.
- `index.ts`: Startup file for all requests.

## Initialize Sequelize CLI

1. Initialize Sequelize CLI:
```sh
npx sequelize-cli init
```
2. Generate Seeder:
```sh
npx sequelize-cli seed:generate --name name-of-your-seeder
```
3. Generate Migrations:
```sh
npx sequelize-cli migration:generate --name name-of-your-migration
```
4. Define Migration:
Edit the generated migration file to include the tables you want to create.
5. Define Seeder Data:
Edit the generated seeder file to include the data you want to insert.
6. Run the Seeder:
```sh
npm run createAllSeeders
```
7. Run the Migration:
```sh
npm run createAllTables
```
8. Delete the Seeder:
```sh
npm run deleteAllSeeders
```
9. Delete the Migration:
```sh
npm run deleteAllTables
```



Expand Down
Loading
Loading