Skip to content

Commit 80a3b00

Browse files
ProgrammerDATCHFabrice-Dush
authored andcommitted
[starts #187900329] Start User-view-single-product (#11)
* [starts #187900329] Start User-view-single-product * add functionalities * Added layout * Added single asset view * added styling * added-styling * added-stylings
0 parents  commit 80a3b00

File tree

118 files changed

+36086
-0
lines changed

Some content is hidden

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

118 files changed

+36086
-0
lines changed

.babelrc

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"presets": [
3+
"@babel/preset-env",
4+
"@babel/preset-react",
5+
"@babel/preset-typescript"
6+
],
7+
"plugins": [
8+
[
9+
"@babel/plugin-transform-runtime",
10+
{
11+
"regenerator": true
12+
}
13+
]
14+
]
15+
}

.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

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"parserOptions": {
4+
"ecmaVersion": 2018,
5+
"sourceType": "module",
6+
"project": "./tsconfig.json"
7+
},
8+
"plugins": [
9+
"@typescript-eslint",
10+
"react-hooks",
11+
"import",
12+
"jsx-a11y"
13+
],
14+
"extends": [
15+
"airbnb",
16+
"airbnb-typescript",
17+
"plugin:react/recommended",
18+
"plugin:@typescript-eslint/recommended",
19+
"plugin:jsx-a11y/recommended",
20+
"plugin:storybook/recommended"
21+
],
22+
"ignorePatterns": ["jest.config.ts"],
23+
"rules": {
24+
"react-hooks/rules-of-hooks": "error",
25+
"react-hooks/exhaustive-deps": "warn",
26+
"react/prop-types": "off",
27+
"import/extensions": [
28+
"error",
29+
"ignorePackages",
30+
{
31+
"ts": "never",
32+
"tsx": "never"
33+
}
34+
],
35+
"import/no-extraneous-dependencies": [
36+
"error",
37+
{
38+
"devDependencies": [
39+
"**/*.test.tsx",
40+
"**/*.test.ts"
41+
]
42+
}
43+
],
44+
"react/function-component-definition": [
45+
"error",
46+
{
47+
"namedComponents": "arrow-function"
48+
}
49+
],
50+
"eol-last": "off",
51+
"@typescript-eslint/comma-dangle": ["warn", {
52+
"arrays": "only-multiline",
53+
"objects": "only-multiline",
54+
"imports": "only-multiline",
55+
"exports": "only-multiline",
56+
"functions": "only-multiline"
57+
}],
58+
"linebreak-style": "off",
59+
"no-param-reassign": "off",
60+
"arrow-body-style": "off",
61+
"@typescript-eslint/semi": "off",
62+
"jsx-a11y/no-static-element-interactions": "off",
63+
"max-len": "off",
64+
"jsx-a11y/label-has-associated-control": ["error", {
65+
"required": {
66+
"some": ["nesting", "id"]
67+
}
68+
}]
69+
},
70+
"settings": {
71+
"react": {
72+
"pragma": "React",
73+
"version": "detect"
74+
},
75+
"import/resolver": {
76+
"typescript": {
77+
"alwaysTryTypes": true,
78+
"project": "./tsconfig.json"
79+
}
80+
}
81+
}
82+
}

.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 }}

.gitignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# dependencies
2+
/node_modules
3+
/.pnp
4+
.pnp.js
5+
6+
# testing
7+
/coverage
8+
9+
# production
10+
/build
11+
dist
12+
# misc
13+
.DS_Store
14+
.env.local
15+
.env.development.local
16+
.env.test.local
17+
.env.production.local
18+
19+
npm-debug.log*
20+
yarn-debug.log*
21+
yarn-error.log*
22+
23+
*storybook.log

.storybook/main.ts

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import type { StorybookConfig } from "@storybook/react-webpack5";
2+
3+
const config: StorybookConfig = {
4+
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
5+
addons: [
6+
"@storybook/addon-webpack5-compiler-swc",
7+
"@storybook/addon-onboarding",
8+
"@storybook/addon-links",
9+
"@storybook/addon-essentials",
10+
"@chromatic-com/storybook",
11+
"@storybook/addon-interactions",
12+
],
13+
framework: {
14+
name: "@storybook/react-webpack5",
15+
options: {},
16+
},
17+
};
18+
export default config;

.storybook/preview.ts

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import type { Preview } from "@storybook/react";
2+
3+
const preview: Preview = {
4+
parameters: {
5+
controls: {
6+
matchers: {
7+
color: /(background|color)$/i,
8+
date: /Date$/i,
9+
},
10+
},
11+
},
12+
};
13+
14+
export default preview;

README.md

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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)
20+
[![CI](https://github.com/atlp-rwanda/e-commerce-ninjas-fe/actions/workflows/ci.yml/badge.svg)](https://github.com/atlp-rwanda/e-commerce-ninjas-fe/actions/workflows/ci.yml)
21+
22+
## Completed features
23+
- Setup empty react
24+
- Setup Redux store
25+
- Setup StoryBook documentation
26+
- Sign up page
27+
- Login/Signup with Google
28+
29+
## Get started
30+
- Clone repository
31+
```bash
32+
git clone https://github.com/atlp-rwanda/e-commerce-ninjas-fe
33+
```
34+
- Install dependencies
35+
```bash
36+
npm install
37+
```
38+
- Run App - it will run on http://localhost:5000/
39+
```bash
40+
npm run dev
41+
```
42+
43+
## StoryBook
44+
45+
To run storybook for documentation, use this command
46+
47+
```sh
48+
npm run storybook
49+
```
50+
51+
## Folder Structure
52+
53+
- `public`: Contains static files and folder like `index.html` and images.
54+
- `src`: The main source folder for the React application.
55+
- `components`: Reusable UI components.
56+
- `pages`: Different pages/screens of the application.
57+
- `store`: Redux store setup and slices.
58+
- `stories`: StoryBook stories for UI components.
59+
- `utils`: Utility functions and helpers.
60+
- `.babelrc`: Babel configuration file.
61+
- `.eslintrc`: ESLint configuration file.
62+
- `.gitignore`: Specifies which files and directories to ignore in Git.
63+
- `package-lock.json`: Automatically generated file that describes the exact tree of dependencies.
64+
- `package.json`: Contains project metadata and dependencies.
65+
- `README.md`: The readme file you are currently reading.
66+
- `tsconfig.json`: TypeScript configuration file.
67+
- `webpack.dev.config.ts`: Webpack configuration file for development.
68+
- `webpack.prod.config.ts`: Webpack configuration file for production.

build/index.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!doctype html><html><head><meta charset="utf-8"/><title>E-Commerce Ninjas FrontEnd</title><script defer="defer" src="main.c05cff687073893a108e.js"></script></head><body><div id="root"></div></body></html>

build/main.c05cff687073893a108e.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**
2+
* @license React
3+
* react-dom.production.min.js
4+
*
5+
* Copyright (c) Facebook, Inc. and its affiliates.
6+
*
7+
* This source code is licensed under the MIT license found in the
8+
* LICENSE file in the root directory of this source tree.
9+
*/
10+
11+
/**
12+
* @license React
13+
* react.production.min.js
14+
*
15+
* Copyright (c) Facebook, Inc. and its affiliates.
16+
*
17+
* This source code is licensed under the MIT license found in the
18+
* LICENSE file in the root directory of this source tree.
19+
*/
20+
21+
/**
22+
* @license React
23+
* scheduler.production.min.js
24+
*
25+
* Copyright (c) Facebook, Inc. and its affiliates.
26+
*
27+
* This source code is licensed under the MIT license found in the
28+
* LICENSE file in the root directory of this source tree.
29+
*/
30+
31+
/**
32+
* @license React
33+
* use-sync-external-store-with-selector.production.min.js
34+
*
35+
* Copyright (c) Facebook, Inc. and its affiliates.
36+
*
37+
* This source code is licensed under the MIT license found in the
38+
* LICENSE file in the root directory of this source tree.
39+
*/

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+
}

netlify.toml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[[redirects]]
2+
from = "/*"
3+
to = "/index.html"
4+
status = 200
5+
6+
[[redirects]]
7+
from = "/api/*"
8+
to = "/index.html"
9+
status = 200
10+
force = true

0 commit comments

Comments
 (0)