loading...
Cover image for Part 1. Clock-in/out System - Diagram

Part 1. Clock-in/out System - Diagram

carlillo profile image Carlos Caballero Updated on ・3 min read

clock-in/out system (10 Part Series)

1) Part 1. Clock-in/out System - Diagram 2) Part 2. Clock-in/out System: Basic backend (I) — AuthModule 3 ... 8 3) Part 3. Clock-in/out System - Basic backend (II) - UsersModule 4) Part 4. Clock-in/out System - Basic backend (III) - AppModule 5) Part 5. Clock-in/out System: Seed Database and migration data 6) Part 6. Clock-in/out System: Basic frontend - Angular 7) Part 7. Deploy Backend (NestJS): Docker/Docker-Compose 8) Part 8. Clock-in/out System: Deploy frontend (Angular 6+) using environments 9) Part 9. Clock-in/out System: Testing: Backend Testing 10) Part 10. Testing: Backend Testing — Unit Testing — Controllers

This post is part of a Series of post which I’m describing a clock-in/out system
if you want to read more you can read the following posts:


Originally published at www.carloscaballero.io on November 25, 2018.

In this first post of the series of post about the clock-in/out system I’m going to describe the system’s architecture. The best way to describe the problem
which our system will resolve is using a diagram. In this diagram you can see
different components which can be in different or in the same server. The Figure
1 show the diagram used to build the clock-in/out system.


Figure 1. Clock-in/out system: Diagram

So, the components of our system are the following:

  • ID Card: All users have a card which is identified using an UID. The way to work is that the user pass their card near of a Arduino system which has a NFC reader.
  • Arduino: There are two Arduino in the system. The first is used to clock-in and the second is used to clock-out. So, each Arduino send to the backend the UID’s card using the POST verb over HTTPS. The Arduino system have a NFC and a WiFi chip: 1) The first is used to read the card; 2) and the second is used to connect to the LAN to send the UID to the server.
  • Backend: The backend is developed using NestJS which is a framework over express (although you can use other libraries as fastify) which can developed software using the SOLID principles and the syntax as Angular. This backend will be connected to a relational database Postgres using TypeORM as ORM.
  • Frontend: The frontend is developed using Angular which is a framework over JavaScript which is a good option when you want scale large webapps (client-side). In this case, is used to illustrated how to using the last Angular's version and good practices. The frontend is develop using RxJS, RxJS is a library for reactive programming using Observables, to make it easier to compose asynchronous or callback-based code. The connection between frontend and backend could have been using sockets to obtain real-time but using polling you obtained a result as a socket (near real-time) but more easiest.

There are several components which could be developed in the future as an
admin panel to manage information about users and cards, personal
information about my check-in/out in the system, the frontend could do search by
users to know if the user is in the building or not. Maybe, in the future this
features could be develop but today will go to presented a basic system of
clock-in/clock-out.

The GitHub project is https://github.com/Caballerog/clock-in-out


Originally published at www.carloscaballero.io on November 25, 2018.

clock-in/out system (10 Part Series)

1) Part 1. Clock-in/out System - Diagram 2) Part 2. Clock-in/out System: Basic backend (I) — AuthModule 3 ... 8 3) Part 3. Clock-in/out System - Basic backend (II) - UsersModule 4) Part 4. Clock-in/out System - Basic backend (III) - AppModule 5) Part 5. Clock-in/out System: Seed Database and migration data 6) Part 6. Clock-in/out System: Basic frontend - Angular 7) Part 7. Deploy Backend (NestJS): Docker/Docker-Compose 8) Part 8. Clock-in/out System: Deploy frontend (Angular 6+) using environments 9) Part 9. Clock-in/out System: Testing: Backend Testing 10) Part 10. Testing: Backend Testing — Unit Testing — Controllers

Posted on Feb 24 '19 by:

carlillo profile

Carlos Caballero

@carlillo

I'm PhD. in Computer Science from Málaga, Spain. Currently, I am teaching developers and degree/master computer science how to be experts in web technologies and computer science.

Discussion

markdown guide
 

Hi Carlos,

Why do you prefer to use two different Arduino? If there is no specific reason for that you can use one instead of two. Just check the time of each transaction. Let's say user punched it's card several time within the day, you can follow these fingerprints for determining how much time he/she spend in the desired field.

 

Hi Çağatay,

I thought as you when I started the project but when I spoke with the customer he said to me that the users prefered two different place to check-in/out. So, the Arduino send a request to the backend in which its operation type is included.

When I finish the project I can to do your propose☺️ because I prefer too.