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

Best practice #10

Open
wants to merge 5 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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
93 changes: 39 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,77 +1,62 @@
# Interested in working for Famly?
# Nursery Attendance App

Give us a chance to see your beautiful code! 🤩
## Overview

## How to get started
- Fork this repository
- Create a small application in React (or another agreed upon framework)
- Describe your design decisions and setup instructions in the README.md of the forked repository
A nursery attendance management application built with Vite.js, React.js, and TypeScript. It allows staff to:
- List children with pagination.
- Check in a child.
- Check out a child.

## The assignment
You are tasked to build a simple application for a nursery to manage the attendance of children each day.

The application should be able to do 3 things:
1. List children with some form of pagination/lazy-loading/infinite-scroll
2. Checkin a child
3. Checkout a child
## Design Decisions
### Project Structure
The project is organized to separate concerns:

Don't worry about design or anything like that.
* /public: Static assets and index.html.
* /src: Source code, including:
* /api: API-related functions.
* /components: React components.
* App.tsx: Main application component.
* index.tsx: Entry point for the React application.

If you have any questions feel free to reach out to the person who sent you the assignment ☺️
## Setup Instructions

## API Specification
### Prerequisites
- Node.js (version 14.x or higher)
- npm (version 6.x or higher) or yarn

You have received an access token in the email that contained the link to this page.
### Installation
1. Clone the repository and navigate into it:
```sh
git clone [email protected]:iziVersano/hire-me.git
cd hire-me

### Fetch some children from
2. Install dependencies:

The API does not support any limit or offset, so the pagination/lazy-loading/infinite-scroll will have to be done client-side only.

```
GET https://app.famly.co/api/daycare/tablet/group
Arguments: {
accessToken: <accessToken>,
groupId: '86413ecf-01a1-44da-ba73-1aeda212a196',
institutionId: 'dc4bd858-9e9c-4df7-9386-0d91e42280eb'
}
```sh
npm install
```
### Running the Application

Example in cURL:

```bash
curl "https://app.famly.co/api/daycare/tablet/group?accessToken=<accessToken>&groupId=86413ecf-01a1-44da-ba73-1aeda212a196&institutionId=dc4bd858-9e9c-4df7-9386-0d91e42280eb"
### Start the development server:
```sh
npm run dev
```
Open http://localhost:3000 in your browser.

### Checkin child
```
POST https://app.famly.co/api/v2/children/<childId>/checkins

Arguments: {
accessToken: <accessToken>
pickupTime: 16:00
}
```
## Usage
List Children: The main page lists children with pagination controls.
Check In/Out: Use "Check In" and "Check Out" buttons for managing attendance.

## Note

Example in cURL:
Checkin child API call throws a 403 an unauthorized error sometimes

```bash
```
curl \
-d 'accessToken=<accessToken>&pickupTime=16:00' \
https://app.famly.co/api/v2/children/fcd683d0-bc31-468c-948f-1ca70b91439d/checkins
```

### Checkout child
```
POST https://app.famly.co/api/v2/children/<childId>/checkout
Arguments: {
accessToken: <accessToken>
}
```

Example in cURL:

```bash
curl \
-d 'accessToken=<accessToken>' \
https://app.famly.co/api/v2/children/fcd683d0-bc31-468c-948f-1ca70b91439d/checkout
```
1 change: 1 addition & 0 deletions dist/assets/index.8a78f78a.css

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

46 changes: 46 additions & 0 deletions dist/assets/index.d9d3663f.js

Large diffs are not rendered by default.

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>React App</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
1 change: 1 addition & 0 deletions node_modules/.bin/browserslist

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

1 change: 1 addition & 0 deletions node_modules/.bin/esbuild

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

1 change: 1 addition & 0 deletions node_modules/.bin/jsesc

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

1 change: 1 addition & 0 deletions node_modules/.bin/json5

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

1 change: 1 addition & 0 deletions node_modules/.bin/loose-envify

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

1 change: 1 addition & 0 deletions node_modules/.bin/nanoid

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

1 change: 1 addition & 0 deletions node_modules/.bin/parser

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

1 change: 1 addition & 0 deletions node_modules/.bin/resolve

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

1 change: 1 addition & 0 deletions node_modules/.bin/rollup

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

1 change: 1 addition & 0 deletions node_modules/.bin/semver

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

1 change: 1 addition & 0 deletions node_modules/.bin/tsc

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

1 change: 1 addition & 0 deletions node_modules/.bin/tsserver

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

1 change: 1 addition & 0 deletions node_modules/.bin/update-browserslist-db

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

1 change: 1 addition & 0 deletions node_modules/.bin/vite

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

38 changes: 38 additions & 0 deletions node_modules/.vite/deps/_metadata.json

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

Loading