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

front-end task #24

Open
wants to merge 67 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
f2134e3
feat(config): add vite and its dependencies
arianshahalami Aug 7, 2023
db5ee0c
feat(config): configure typescript
arianshahalami Aug 7, 2023
4d96d61
feat(view): add initial html index page
arianshahalami Aug 7, 2023
a77f016
feat(config): configure ignored files and folders
arianshahalami Aug 7, 2023
dd24340
feat(config): load main component
arianshahalami Aug 7, 2023
a0f52f8
Merge branch 'feature/init-config' into develop
arianshahalami Aug 7, 2023
1efd627
feat(config): add eslint and prettier
arianshahalami Aug 7, 2023
25c1b13
feat(config): configured eslint-ignored files
arianshahalami Aug 7, 2023
ed28cf0
feat(config): configured xo
arianshahalami Aug 7, 2023
915ee30
feat(config): configured prettier
arianshahalami Aug 7, 2023
acd2018
feat(config): configured edit-config
arianshahalami Aug 7, 2023
01317b9
feat(style-guide): reformatted whole project
arianshahalami Aug 7, 2023
ddf5a53
feat(package): install linting tools
arianshahalami Aug 7, 2023
94542c6
feat(config): change ts-config file
arianshahalami Aug 7, 2023
2033f7b
feat(package): install commitlint
arianshahalami Aug 7, 2023
c7759b9
feat(config): configure commitlint
arianshahalami Aug 7, 2023
ceed970
feat(package): install husky and lint-staged
arianshahalami Aug 7, 2023
3bb1c04
feat(config): configure scripts
arianshahalami Aug 7, 2023
b3d8e3c
feat(config): configure lintstaged
arianshahalami Aug 7, 2023
924c2f7
feat(config): configure husky
arianshahalami Aug 7, 2023
9750145
Merge branch 'feature/lint-config' into develop
arianshahalami Aug 7, 2023
ea14c45
feat(structure): move app component to the components folder
arianshahalami Aug 8, 2023
ac8de8e
feat(assets): add iran-yekan font
arianshahalami Aug 8, 2023
03bf466
feat(assets): add intro-page image
arianshahalami Aug 8, 2023
2a02af9
feat(styles): add css-normlizer and base-css
arianshahalami Aug 8, 2023
92377c1
feat(styles): apply base-styles on whole project
arianshahalami Aug 8, 2023
ce53be9
Merge branch 'feature/config-assets' into develop
arianshahalami Aug 8, 2023
a2e5aaa
fix(config): changed some eslint rules
arianshahalami Aug 8, 2023
3b1f2dc
fix(config): changed some eslint rules
arianshahalami Aug 8, 2023
6ec065b
feat(styles): add design variables
arianshahalami Aug 8, 2023
e125035
feat(structure): change components folder-structure
arianshahalami Aug 8, 2023
5dc5ec9
fix(styles): change body-gradiant and card-radius values
arianshahalami Aug 8, 2023
39473d7
feat(styles): replace static values with variables
arianshahalami Aug 8, 2023
08e17be
feat(styles): apply iran-yekan font
arianshahalami Aug 8, 2023
fe9e782
feat(styles): move introduction-card styles to related file
arianshahalami Aug 8, 2023
5fc6a45
feat(styles): configure font styles
arianshahalami Aug 8, 2023
af96cf8
feat(styles): adjust line-height
arianshahalami Aug 8, 2023
21d3a62
feat(component): add card and related styles
arianshahalami Aug 8, 2023
132259b
chore(package): install react-router
arianshahalami Aug 8, 2023
d60233f
fix(component): remove app component
arianshahalami Aug 8, 2023
83814b8
fix(component): move router to the seperate file so fast-refresh work…
arianshahalami Aug 8, 2023
b9cf015
fix(styles): remove utility classes
arianshahalami Aug 8, 2023
de17de5
fix(styles): made font-sizes rem based
arianshahalami Aug 8, 2023
c9616cf
feat(styles): add input and btn styles
arianshahalami Aug 8, 2023
c992bf4
fix(style-guide): reformat sdk based on prettier
arianshahalami Aug 8, 2023
4075a14
fix(config): add js and jsx to eslint prettier
arianshahalami Aug 8, 2023
c3b354a
feat(type): add introduction SubmittedDataUserDetails type
arianshahalami Aug 8, 2023
14b68ab
feat(styles): add styles of introduction component
arianshahalami Aug 8, 2023
83884c7
feat(component): add introduction component forms and logic
arianshahalami Aug 8, 2023
abce3e2
feat(styles): centeralize card
arianshahalami Aug 8, 2023
d43a1f8
feat(styles): make introdcution compoent mobile-first
arianshahalami Aug 8, 2023
743baeb
Merge branch 'feature/introduction-component' into develop
arianshahalami Aug 8, 2023
10d1cdd
feat(assets): add subscription card image
arianshahalami Aug 9, 2023
482cd0a
feat(styles): add danger and success status colors
arianshahalami Aug 9, 2023
ce49e03
fix(styles): make main-content full-width
arianshahalami Aug 9, 2023
74caf92
refactor(component): make components export default
arianshahalami Aug 9, 2023
86a064e
feat(config): configure prject routes
arianshahalami Aug 9, 2023
837d1c8
feat(component): add subscription-details component
arianshahalami Aug 9, 2023
a631a41
feat(styles): add subscription-details component styles
arianshahalami Aug 9, 2023
021df0c
feat(type): add subscription-details component types
arianshahalami Aug 9, 2023
6a6031c
fix(config): turned off no-unused-vars
arianshahalami Aug 9, 2023
3bc2b84
Merge branch 'feature/suscription-details-component' into develop
arianshahalami Aug 9, 2023
de0da09
docs(documentation): customized readme file
arianshahalami Aug 9, 2023
67cd110
fix(styles): make card centered
arianshahalami Aug 9, 2023
84b6101
fix(styles): make hero-image cover the box
arianshahalami Aug 9, 2023
a10e4c6
chore(package): add commitlint as local dependency
arianshahalami Aug 9, 2023
3d1fc50
feat(utility): add email-validator
arianshahalami Aug 9, 2023
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
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
end_of_line = lf
charset = utf-8

7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.idea
.vscode
.config
node_modules/*
config/*
public/*
scripts/*
32 changes: 32 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"root": true,
"env": {
"browser": true,
"es2020": true
},
"extends": ["xo", "xo-react"],
"overrides": [
{
"extends": ["prettier", "plugin:prettier/recommended"],
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"]
}
],
"ignorePatterns": ["dist", ".eslintrc.js"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["react-refresh"],
"rules": {
"react-refresh/only-export-components": [
"warn",
{
"allowConstantExport": true
}
],
"react/function-component-definition": "off",
"react/react-in-jsx-scope": "off",
"no-unused-vars": "off"
}
}
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
# dependencies
node_modules


# editors and IDE
.idea
.vscode

# production
/build


# misc
.DS_Store
.env
.env.production

4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run commitlint
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run pre-commit
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/frontend-challenge.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"*.{js,jsx,tsx,ts}": "eslint --fix",
"*.{md,json,html,css,scss,sass}": "prettier --write"
}
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"tabWidth": 4,
"singleQuote": false,
"endOfLine": "lf",
"printWidth": 100
}
3 changes: 3 additions & 0 deletions .xo-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"prettier": true
}
63 changes: 24 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,34 @@
# Sheypoor frontend-challenge
# Sheypoor Front-end Task

The task is to implement a **2 step UI wizard** to create a user account. There is no UX or UI constraints, this is
up to you to decide.
This is a two-steped wizard based on Sheyppor task details.

The User information that we need to collect is described in the User type:
```
interface User {
name: string
age: number
email: string
newsletter: 'daily' | 'weekly' | 'monthly'
}
```
You can, for example collect the name and age in the first step and then email and newsletter in the second step.
You may use a routing library such that every step is a separate route but this is completely optional and not
required.
## Features

There is a dummy `sdk` package(implemented in the /sdk folder) which exports a `createUser` function. This function returns a `Promise`.
Use it to simulate a request that creates a user account.
Ex:
- BEM methodology applied
- Follows Gitflow branching strategy
- Follows XO, ESLint and Prettier rules alongside commit-lint, lint-staged and husky hooks
- Lazy-loaded components
- UI lib free (pure sass)
- Extensible and stable architecture

```
import { createUser } from 'sdk'
## Libs and Frameworks

const details = {...}

createUser(details).then( ... )
```
- React
- TypeScript
- React Router
- Prettier, ESLint, XO, Husky
- SASS

The focus should be on code style and the way you approach the problem implementation wise.
Feel free to use any other helper library although ideally the more code you write yourself the better.
## Deployment

### Implementation requirements:
This app uses **Vite** as development server. To run the project simply copy and paste this command in you terminal

- use either vanilla Javascript or one of the frameworks we use at Sheypoor(React / Knockout.js) or whatever you like
- use npm to manage dependencies, there is pre-initialized package.json included in this repo

### Getting started:

- Fork the repo
- Implement your solution
- Create a PR against this repo
```bash
npm run build
```

Optional: build the project and deploy (ie make it available as a static project) on
[Github Pages](https://pages.github.com/), otherwise please provide detailed instructions
on how to start the project locally.
then

Any questions please contact us via email (jobs AT sheypoor.com) :)
```bash
vite preview
```
7 changes: 7 additions & 0 deletions commitlint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { UserConfig } from "@commitlint/types";

const Configuration: UserConfig = {
extends: ["@commitlint/config-conventional"],
};

export default Configuration;
12 changes: 12 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading