Skip to content

Commit 988e126

Browse files
author
AimePazzo
committed
Merge branch 'develop' of github.com:atlp-rwanda/e-commerce-ninjas-fe into develop
2 parents 1704915 + ff1539f commit 988e126

27 files changed

+12876
-7153
lines changed

.circleci/config.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
version: 2.1
2+
3+
jobs:
4+
test:
5+
docker:
6+
- image: cimg/node:current
7+
steps:
8+
- setup_remote_docker:
9+
version: docker24
10+
- checkout
11+
- run:
12+
name: Update npm
13+
command: "sudo npm install -g npm@latest"
14+
- run:
15+
name: Install dependencies
16+
command: npm install
17+
- run:
18+
name: Run tests and generate coverage
19+
command: |
20+
mkdir -p test-results
21+
npm test -- --watchAll=false --coverage --outputFile=test-results/jest.xml --json --useStderr
22+
- run:
23+
name: Upload coverage to Code Climate
24+
command: |
25+
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
26+
chmod +x ./cc-test-reporter
27+
./cc-test-reporter before-build
28+
./cc-test-reporter format-coverage -t lcov -o coverage/codeclimate.json coverage/lcov.info
29+
./cc-test-reporter upload-coverage
30+
./cc-test-reporter after-build --exit-code $?
31+
- store_test_results:
32+
path: test-results
33+
- store_artifacts:
34+
path: coverage
35+
destination: coverage
36+
37+
workflows:
38+
test_workflow:
39+
jobs:
40+
- test

.eslintrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"plugin:@typescript-eslint/recommended",
1919
"plugin:storybook/recommended"
2020
],
21+
"ignorePatterns":["jest.config.ts"],
2122
"rules": {
2223
"react-hooks/rules-of-hooks": "error",
2324
"react-hooks/exhaustive-deps": "warn",

.github/workflows/ci.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
pull_request:
8+
branches:
9+
- develop
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
matrix:
17+
node-version: [20.x]
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v3
22+
23+
- name: Use Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
28+
- name: Clear npm cache and reinstall dependencies
29+
run: |
30+
npm cache clean --force
31+
npm install
32+
33+
- name: Run tests explicitly with npm run
34+
run: |
35+
npm run test --if-present -- --passWithNoTests
36+
37+
- name: Upload coverage to Coveralls
38+
uses: coverallsapp/github-action@v2
39+
env:
40+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

README.md

+43-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
1-
# e-commerce-ninjas-fe
2-
Front end repository for the teams' project
1+
# E-COMMERCE NINJAS WEB APPLICATION - FRONTEND
2+
3+
Our e-commerce web application server, developed by Team Ninjas, facilitates smooth online shopping with features like user authentication, product cataloging, and secure payments. It's built to enhance the user experience with high performance and reliability. Suitable for any online marketplace looking to grow.
4+
5+
6+
## Hosted Application URL
7+
8+
[https://e-commerce-ninja-fn-staging.netlify.app/](https://e-commerce-ninja-fn-staging.netlify.app/)
9+
10+
## Github repository
11+
12+
[https://github.com/atlp-rwanda/e-commerce-ninjas-fe](https://github.com/atlp-rwanda/e-commerce-ninjas-fe/tree/develop)
13+
14+
15+
[![Maintainability](https://api.codeclimate.com/v1/badges/a7dce016f123cdcc9042/maintainability)](https://codeclimate.com/github/atlp-rwanda/e-commerce-ninjas-fe/maintainability)
16+
[![Test Coverage](https://api.codeclimate.com/v1/badges/a7dce016f123cdcc9042/test_coverage)](https://codeclimate.com/github/atlp-rwanda/e-commerce-ninjas-fe/test_coverage)
17+
[![Netlify Status](https://api.netlify.com/api/v1/badges/a3ed5a75-a862-4f3b-ba21-8369180cf3e6/deploy-status)](https://app.netlify.com/sites/e-commerce-ninja-fn-staging/deploys)
18+
[![Coverage Status](https://coveralls.io/repos/github/atlp-rwanda/e-commerce-ninjas-fe/badge.svg)](https://coveralls.io/github/atlp-rwanda/e-commerce-ninjas-fe)
19+
[![CircleCI](https://dl.circleci.com/status-badge/img/gh/atlp-rwanda/e-commerce-ninjas-fe/tree/develop.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/atlp-rwanda/e-commerce-ninjas-fe/tree/develop)
320

421
## Completed features
522
- Setup empty react
@@ -19,10 +36,30 @@ Front end repository for the teams' project
1936
```bash
2037
npm run dev
2138
```
39+
40+
## StoryBook
2241

42+
To run storybook for documentation, use this command
2343

24-
## StoryBook
25-
To run storybook for documentation, use the command
26-
```bash
27-
npm run storybook
44+
```sh
45+
npm run storybook
2846
```
47+
48+
## Folder Structure
49+
50+
- `public`: Contains static files like `index.html` and images.
51+
- `src`: The main source folder for the React application.
52+
- `components`: Reusable UI components.
53+
- `pages`: Different pages/screens of the application.
54+
- `store`: Redux store setup and slices.
55+
- `stories`: StoryBook stories for UI components.
56+
- `utils`: Utility functions and helpers.
57+
- `.babelrc`: Babel configuration file.
58+
- `.eslintrc`: ESLint configuration file.
59+
- `.gitignore`: Specifies which files and directories to ignore in Git.
60+
- `package-lock.json`: Automatically generated file that describes the exact tree of dependencies.
61+
- `package.json`: Contains project metadata and dependencies.
62+
- `README.md`: The readme file you are currently reading.
63+
- `tsconfig.json`: TypeScript configuration file.
64+
- `webpack.dev.config.ts`: Webpack configuration file for development.
65+
- `webpack.prod.config.ts`: Webpack configuration file for production.

jest.config.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"preset": "ts-jest",
3+
"testEnvironment": "jsdom",
4+
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"],
5+
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
6+
"transform": {
7+
"^.+\\.(ts|tsx)$": "ts-jest"
8+
},
9+
"moduleNameMapper": {
10+
"\\.(css|less|scss|sass)$": "identity-obj-proxy"
11+
}
12+
}

0 commit comments

Comments
 (0)