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 verification email validation #23

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file added .DS_Store
Binary file not shown.
71 changes: 71 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
version: 2.1

orbs:
node: circleci/[email protected]

executors:
node-executor:
docker:
- image: circleci/node:16

jobs:
build:
executor: node-executor
environment:
CC_TEST_REPORTER_ID: b996f145a438f80141cfcc86bb35a2c212a2a24c394abee18da6add05eaaee7e
steps:
- checkout
- run: npm install

- run:
name: Install Code Climate test reporter
command: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
- run:
name: Initialize Code Climate test reporter
command: ./cc-test-reporter before-build
- run:
name: Run Tests with Coverage
command: npx nyc npm run test:coverage
- run:
name: Format Coverage Report
command: npx nyc report --reporter=text-lcov > coverage.lcov
- run:
name: Upload Coverage Report to Code Climate
command : ./cc-test-reporter after-build -t lcov
when: always
- store_artifacts: # upload test coverage as artifact
path: ./coverage/lcov.info


deploy:
executor: node-executor
steps:

- checkout
- run: npm install
- run:
name: Install TypeScript
command: sudo npm install -g typescript
- run:
name: Build Project

command: npx tsc


- run:
name: Compile TypeScript
command: ./node_modules/.bin/tsc




workflows:
version: 2
build_and_deploy:
jobs:
- build
- deploy:
requires:
- build
34 changes: 34 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: "2"
checks:
argument_count:
enabled: false
file_lines:
enabled: false
method_count:
enabled: false
return_count:
enabled: false
similar_code:
enabled: false

exclude_paths:
- "node_modules/**"
- "coverage/**"

engines:
eslint:
enabled: true
config:
extensions:
- .js
- .jsx

ratings:
paths:
- "**.js"
- "**.jsx"

test_reporter:
id: "cc-test-reporter"
coverage_files:
- "coverage/lcov.info"
26 changes: 21 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
PORT=
DEV_DATABASE_URL=
TEST_DATABASE_UR=
DATABASE_URL=
JWT_SECRET=
PORT =
JWT_SECRET =
DB_URL =

DEV_DB_NAME =
DEV_DB_USER =
DEV_DB_PASS =
DEV_DB_HOST =

TEST_DB_NAME =
TEST_DB_USER =
TEST_DB_PASS =
TEST_DB_HOST =

PRO_DB_NAME =
PRO_DB_USER =
PRO_DB_PASS =
PRO_DB_HOST =

EMAIL_USER =
EMAIL_PASS =
41 changes: 41 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"root": true,
"extends": "airbnb-base",
"env": {
"node": true,
"es6": true,
"mocha": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"one-var": 0,
"one-var-declaration-per-line": 0,
"new-cap": 0,
"consistent-return": 0,
"no-param-reassign": 0,
"comma-dangle": 0,
"curly": ["error", "multi-line"],
"import/no-unresolved": [2, { "commonjs": true }],
"no-shadow": ["error", { "allow": ["req", "res", "err"] }],
"valid-jsdoc": ["error", {
"requireReturn": true,
"requireReturnType": true,
"requireParamDescription": false,
"requireReturnDescription": true
}],
"require-jsdoc": ["error", {
"require": {
"FunctionDeclaration": true,
"MethodDefinition": true,
"ClassDeclaration": true
}
}]
}
}
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
/node_modules
.env
.env
/coverage
/dist




12 changes: 12 additions & 0 deletions .hound.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
linters:
eslint:
enabled: true
config_file: .eslintrc
file_patterns:
- '*.js'
- '*.ts'
enabled_plugins:
- eslint-plugin-react
- eslint-plugin-import
- eslint-plugin-prettier
- eslint-plugin:@typescript-eslintnp
8 changes: 8 additions & 0 deletions .sequelizerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const path = require('path')

module.exports = {
config: path.resolve('./src/database/config', 'config.js'),
'models-path': path.resolve('./src/database/models'),
'seeders-path': path.resolve('./src/database/seeders'),
'migrations-path': path.resolve('./src/database/migrations'),
}
3 changes: 2 additions & 1 deletion Conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ For specific files, we will be using dot notation with `element.action.ts`. For
- Services: `element.service.ts (Example: user.services.ts)`
- Routes: `element.route.ts (Example: user.route.ts)`
- Test: `element.test.ts(Example: user.test.ts)`
- Utils: `element.utils.ts(Example: password.utils.ts)`

### MODEL: FOR MODEL NAMING
- Model should be named as Entity in singular and start with a capital letter.
- Model should be named as Entity in singular, models we will use dot notation eg. user.model.ts.
- Table name should be named as entity in plural and start with a lowercase letter.

### Utils
Expand Down
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM node:14

WORKDIR /app
COPY package.json .
RUN npm install
COPY . .
CMD ["npm","run","dev"]
27 changes: 27 additions & 0 deletions ESLINTCONFIG.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
__Steps to Configure ESlint and Pre-commit Hooks in your local repository__<br>

Open Your Git bash and run the following commands<br>

1.```npx husky install ``` <br>
To add the .husky Directory

2.After that, navigate to the __.husky__ directory which has been Added and add this piece of code to the __pre-commit__ file:<br>

```
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

# Run ESLint with --fix option to format code
npx eslint --fix .

# Run tests
npm run test

```
<br>

3. ```chmod +x .husky/pre-commit``` <br>
To Make the pre-commit file executable


__note: The above commands has to be run in the Git Bash, not Powershell Terminal__
86 changes: 86 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
[![Test Coverage](https://api.codeclimate.com/v1/badges/b8b4783a32fb76cb4953/test_coverage)](https://codeclimate.com/github/atlp-rwanda/e-commerce-furebo-32-bn/test_coverage)

[![Maintainability](https://api.codeclimate.com/v1/badges/b8b4783a32fb76cb4953/maintainability)](https://codeclimate.com/github/atlp-rwanda/e-commerce-furebo-32-bn/maintainability)
[![HoundCI](https://img.shields.io/badge/style-yellow?style=flat&logo=houndci&label=HoundCI)](https://houndci.com)
[![CircleCI](https://dl.circleci.com/status-badge/img/gh/atlp-rwanda/e-commerce-furebo-32-bn/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/atlp-rwanda/e-commerce-furebo-32-bn/tree/main)

![NodeJS](https://img.shields.io/badge/node.js-6DA55F?style=for-the-badge&logo=node.js&logoColor=white) ![Express.js](https://img.shields.io/badge/express.js-%23404d59.svg?style=for-the-badge&logo=express&logoColor=%2361DAFB)

# E-Commerce Geeklord Project


# How to use the project



# Table of contents


- [Introduction](#introduction)
- [Installation](#installation)
- [Features](#features)
- [Running Tests](#running-tests)
- [Built With](#built-with)

## Introduction

This project is an e-commerce application designed to provide a seamless online shopping experience. It includes a robust backend built with Node.js and PostgreSQL, supporting features like product management, user authentication, and order processing.

## Installation

To get started with the project, follow these steps:

1. Clone the repository:

```bash
git clone https://github.com/atlp-rwanda/e-commerce-furebo-32-bn.git
```

2. Navigate to the project directory:

```bash
cd e-commerce-furebo-32-bn
```

3. Install the necessary dependencies:

```bash
npm install
```

4. Build the project:

```bash
npm run build
```

5. Start the development server:

```bash
npm run dev
```

## Features

- **User Authentication and Authorization**: Secure login and registration functionality with JWT authentication.
- **Product Management**: CRUD operations for products, including the ability to add, update, delete, and view products.
- **Shopping Cart**: Add products to the cart, view cart details, and update or remove items from the cart.
- **Order Processing**: Place orders and view order history.
- **Admin Dashboard**: Manage products, view orders, and perform other administrative tasks.
- **Search and Filter**: Search for products by name, category, or other criteria, and apply filters to narrow down results.
- **Responsive Design**: Optimized for various devices to ensure a great user experience across desktops, tablets, and smartphones.
- **Payment Integration**: Integration with popular payment gateways to process transactions securely.

# Tests

How to run tests:

```bash
$ npm run test
```

# Built with

- ### Node.js
- ### Express
- ### Postgres
Loading