Skip to content

Commit

Permalink
Production release (#70)
Browse files Browse the repository at this point in the history
* champs-ec-fe initial project setup

* Configure project tailwindcss

* chore(ESLint & precommit setup):setting up ESLint & precommit

* ch(redux): Configuring react redux

- Set up Redux store for Next.js app
- Modify _app.js to wrap app with Redux Provider
- Pass Redux store instance to Provider
- Update store configuration based on Redux Toolkit
- Created welcome slice

* feat(login)-userlogin

* Feat(sign up): User must be able to Register to the website

* feat(login)-userlogin

* ft(test-setup)

* feat(auto-tests-setup)

* ft(setting up ci tools)

* ch(deployment):add deployment git action

* bg(login)-addingtests

* bgfix(signup):Test for signup page

* feat(Two Factor Authentication):Seller authentication and OTP verification

* feat(UpdatePassword):User is able to update password

* feat(google-login):Integrate google login authentication

* bug(two-factor-authentication): bug fix for two factor authentication feature

* feat(admin)-assigningroles

* feat(password Reset):Users should be presented with reset password link

* feat: Enable sellers to create products from dashboard
- Added product creation form with basic fields (name, description, price,currency,Product Image).
- Integrated backend API endpoints for product creation and validation.
-Enhanced product Validations for good user Experience

* feat(admin)-disable-users

* Feat(Landing-Page):implements the landing page for the E-champs

* ft/axios-interceptor

* feat(reviews):add-product-reviews

* feat(cart management): add functionality for user cart mamangement

* Bgfix(Navabar): The login user and user type the issue about Menu

* ft/logout

* feat(seller products):update and delete

* feat(track-orders):add implementation of buyer track order status

* Configure app notifications

* fix(profiles) #187300200 Users should be able to view and edit their profiles

-addresses all required changes on wishlist
-User now he can view all products he added on wishlist
-Fixed margin between wishlist component and Footer
-Worked on feedback given on good and useful user experience

* feat:(payment):A buyer should be able to make a payment using Stripe API

* Feat(Dashboard): The seller and admin dashboard

* feat(feature)-improvsingleproductview-#187893630

* bgFix(dashboard): Change the dashboard Routes

* feat(chatbot):add a chatbot for travellers interaction

* feat(chatbot):add a chatbot for travellers interaction

* ft(docker):fe server should run in the docker

* fix(chat ui):fixed ui for the chat

* bugFix(Navbar): correct the navabar and dashboard

* bg-fix(search):A buyer should be able to search for products

* bug-fix(button-loading):add a loading state to clicked button

* ft(wishlist):add-products-to-wishlist

* ft(wishlist):add-products-to-wishlist

* ft(seller stats) seller should see statics on daily basis (#60)

- Update pie chart to show Available, Expired, and Other product categories
- Ensure percentages always sum to 100% by introducing,
-indicating total number of total products, available products , expired products and wished products
-Also the percentage is being on indicated regarding total products, available products , expired products and wished products

Co-authored-by: Eli Hirwa <[email protected]>

* fix(reset password & payments):fixing reset & payment ui (#63)

* bg(bug)-fixproductview (#67)

* -Ensures profile image is not uploaded again during every update (#69)

-Disabled  future date on date of birth , hence only people with 10 years can registet
-form reset on succesfully creation of products
-toast show up on successfully creation of products
-ensured correct date formatting in all page

Co-authored-by: Eli Hirwa <[email protected]>

---------

Co-authored-by: Emmanuel MUNEZERO <[email protected]>
Co-authored-by: sabatohura <[email protected]>
Co-authored-by: k3lly003 <[email protected]>
Co-authored-by: ISHIMWE Ami Paradis <[email protected]>
Co-authored-by: kayigmb <[email protected]>
Co-authored-by: tchami <[email protected]>
Co-authored-by: kanu-cast <[email protected]>
Co-authored-by: RwigimbaP_dev <[email protected]>
Co-authored-by: Denis Niwemugisha <[email protected]>
Co-authored-by: uwimana janet <[email protected]>
Co-authored-by: PrinceRWIGIMBA <[email protected]>
Co-authored-by: ISHIMWE Ami Paradis <[email protected]>
Co-authored-by: janet-barbie <[email protected]>
  • Loading branch information
14 people authored Jul 17, 2024
1 parent 19230fa commit 97647b8
Show file tree
Hide file tree
Showing 277 changed files with 50,587 additions and 1 deletion.
89 changes: 89 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
version: 2
orbs:
coveralls: coveralls/[email protected]
jobs:
build:
docker:
- image: cimg/node:18.17.0
working_directory: ~/repo
steps:
- setup_remote_docker:
version: 20.10.7
- checkout
# Update npm
- run:
name: update-npm
command: "sudo npm install -g npm@latest"
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package-lock.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
name: Install dependencies
command: npm install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package-lock.json" }}
- run:
name: Create reports directory
command: mkdir -p ./reports/
- run:
name: Install Jest
command: npm install --save-dev jest
- run:
name: Install JUnit coverage reporter
command: npm install --dev jest-junit
- run:
name: Run tests with JUnit as reporter
command: |
npx jest --ci --runInBand --reporters=default --reporters=jest-junit --verbose
test_exit_code=$?
echo "Jest exit code: $test_exit_code"
if [ $test_exit_code -ne 0 ]; then
exit 0 # Ignore non-zero exit code for debugging
fi
environment:
JEST_JUNIT_OUTPUT_DIR: ./reports/
JEST_JUNIT_ADD_FILE_ATTRIBUTE: "true"
- store_test_results:
path: ./reports/
# Run coverage
- run:
name: Run coverage
command: npm run test || true
when: always
- run:
name: Upload coverage to Coveralls
command: npx coveralls < coverage/lcov.info
# Run coverage report for Code Climate
- run:
name: Setup Code Climate test-reporter
command: |
# download test reporter as a static binary
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
when: always
- run:
name: Make cc-test-reporter executable
command: chmod +x ./cc-test-reporter
- run:
name: Send coverage report to Code Climate
command: |
./cc-test-reporter after-build -t lcov
when: always
# Upload results
- store_artifacts: # upload test coverage as artifact
path: ./coverage/lcov.info
prefix: tests
- run:
name: Debugging step
command: |
echo "Exit status of previous command: $?"
cat ./reports/junit.xml || true
cat ./coverage/lcov.info || true
ls -la ./coverage
ls -la ./reports
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
URL= {Render_URL}/api
86 changes: 86 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module",
"project": "./tsconfig.json"
},
"extends": [
"next/core-web-vitals",
"airbnb",
"airbnb/hooks",
"plugin:@typescript-eslint/recommended",
"plugin:@next/next/recommended",
"plugin:storybook/recommended",
"plugin:testing-library/react",
"plugin:jest-dom/recommended",
"prettier"
],
"env": {
"browser": true,
"es2021": true,
"node": true,
"jest": true
},
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"react",
"jest",
"testing-library",
"jest-dom"
],
"rules": {
"one-var": 0,
"no_console": 0,
"camelcase": [
"error",
{
"properties": "always",
"allow": [
"_",
"HTTP_STATUS_CODE"
]
}
],
"@typescript-eslint/no-explicit-any": 0,
"one-var-declaration-per-line": 0,
"consistent-return": 0,
"no-param-reassign": 0,
"comma-dangle": 0,
"curly": [
"error",
"multi-line"
],
"no-shadow": [
"error",
{
"allow": [
"req",
"res",
"err"
]
}
],
"valid-jsdoc": [
"error",
{
"requireReturn": true,
"requireReturnType": true,
"requireParamDescription": false,
"requireReturnDescription": true
}
],
"import/prefer-default-export": 0,
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"react/jsx-filename-extension": [1, { "extensions": [".tsx"] }],
"react/react-in-jsx-scope": "off"
}
}




13 changes: 13 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#### What does this PR do?

#### Description of Task to be completed?

#### How should this be manually tested?

#### Any background context you want to provide?

#### What are the relevant pivotal tracker/Trello stories?

#### Screenshots (if appropriate)

#### Questions:
24 changes: 24 additions & 0 deletions .github/workflows/preview.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Vercel Preview Deployment

on:
push:
branches-ignore:
- main

jobs:
Deploy-Preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install Vercel CLI
run: npm install --global vercel

- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}

- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}

- name: Deploy Project Artifacts
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/production.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Vercel Production Deployment

on:
push:
branches:
- main

jobs:
Deploy-Production:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install Vercel CLI
run: npm install --global vercel

- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}

- name: Build Project Artifacts
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}

- name: Deploy Project Artifacts
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

*storybook.log
.env
1 change: 1 addition & 0 deletions .hintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
3 changes: 3 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
npx lint-staged
npm test
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"singleQuote": true,
"trailingComma": "all",
"arrowParens": "always",
"parser": "typescript"
}

18 changes: 18 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { StorybookConfig } from '@storybook/nextjs';

const config: StorybookConfig = {
stories: ['../lib/**/*.mdx', '../lib/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
'@storybook/addon-onboarding',
'@storybook/addon-links',
'@storybook/addon-essentials',
'@chromatic-com/storybook',
'@storybook/addon-interactions',
],
framework: {
name: '@storybook/nextjs',
options: {},
},
staticDirs: ['../public'],
};
export default config;
14 changes: 14 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { Preview } from '@storybook/react';
import '../src/app/globals.css'
const preview: Preview = {
parameters: {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
};

export default preview;
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:20

WORKDIR /app

COPY package*.json ./

RUN npm install

COPY . .

EXPOSE ${PORT}

CMD ["npm","run","dev"]
Loading

0 comments on commit 97647b8

Please sign in to comment.