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

Wizard has been implemented #32

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
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
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:18.17.1-alpine AS BUILD_IMAGE

WORKDIR /app

COPY package.json .
RUN npm i

COPY . .

EXPOSE 5173

CMD ["yarn", "dev"]

# Im not building the project as it needs to setup nginx and customize it to be compatible with vite, due to this issue: https://stackoverflow.com/questions/74982873/vite-react-js-with-react-router-dom-gives-404-error-on-page-reload
58 changes: 12 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,15 @@
# Sheypoor frontend-challenge
# Audrey's frontend challenge

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.
### Getting started locally:
In the root directory run commands below:
- ```npm install``` to install the dependencies.
- ```npm run dev``` or ```yarn dev``` to run the repository on **[http://localhost:3000](http://localhost:3000)**

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.
### Getting started with docker:
In the root directory run commands below:
- ```docker build -t [any name you like] .``` to create a docker image.
- ```docker run -d --rm -p 5173:3000 [any name you like]``` to create and run the docker container.
- **open [http://localhost:5173](http://localhost:5173)** to visit the app.

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:

```
import { createUser } from 'sdk'

const details = {...}

createUser(details).then( ... )
```

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.

### Implementation requirements:

- 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

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.

Any questions please contact us via email (jobs AT sheypoor.com) :)
### Prerequisites
- **Node v18.17.1**
19 changes: 19 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Implementing create user flow" />
<title>Create User Flow</title>
<base href="/" />
</head>

<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="src/index.tsx"></script>
</body>

</html>
Loading