Welcome to the backend part of NavDesk. This is a Co-Working App project utilizing state-of-the-art technologies to manage access and administration within "Las Naves" facility in Valencia!
- About the project
- Deploy
- Stack
- ER Diagram from SQL
- Clone
- Endpoints
- Future functionalities
- Contribution
- Web refferences
- Development
- Appreciation
- Contact
This project is an efficient implementation of an Access Control System using Node.js, Express, TypeORM, TypeScript and more technologies. It emphasizes robust data handling and seamless access management for StartUp companies who want to create a petition to use a Meeting room or Event room in our building. Through the system, administrators can manage user access to different rooms and track access history efficiently. There is also a possibility to get a detailed report for an enterprise, room or even a person as well as availability view in real time.
More functionalities are on the way!
Used technologies for the project:
- The database schema includes entities like
User
,Room
,Booking
,Booking_History
, andReport
. These tables are interconnected to provide a comprehensive system for managing access controls dynamically. The relationships between them provide a faster and more capable way of updating the data in real time environment. It is designed in SQL together with TypeORM.
- Before starting it is important to have SQL and MySQLWorkbench installed locally in order to work with the database. If you dont have it or simply prefer to use a Docker configuration please follow the steps bellow and then you can continue with the clone.
-1- Create docker SQL Image
docker build -t mssql-app
-2- Create a SQL containerdocker run -d --name mssql-container -p 3306:3306 mssql-app
-3- Run Docker Desktop App and run the container from there
- Clone the repository from the url
$ npm install
(to get all the node packages)- Connect the cloned repo with our Database (if you dont have docker make a mysql container and run it on the wanted port such as:
docker run -d --name mysqlc -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root -v mysql_data:/var/lib/mysql mysql
) - Change variables in .env with the PORT given from Docker (default is 3306)
$ npm run migrations
$ npm run db:seed
$ npm run db:refresh
to execute everything from the beginning$ npm run dev
to run our server
Method | URI | Action | Auth | Body |
---|---|---|---|---|
POST | /auth/register | Register user | N/A (public) | { "email": "userEmail", "password": "userPassword" } |
POST | /auth/login | Login user | N/A (public) | { "email": "userEmail", "password": "userPassword" } |
Method | URI | Action | Auth | Body |
---|---|---|---|---|
GET | /users/all-users | View all users | Token (admin) | N/A |
GET | /users/{id} | View user by ID | Token (admin) | N/A |
PUT | /users/{id} | Update user by ID | Token (user) | { "usernname": "newUserName", "startUp": "newStartUp", "email": "newEmail" } |
DELETE | /users/{id} | Delete user by ID | Token (user) | N/A |
GET | /users/{id}/current-access | Display all current accesses of users ID | Token (user) | N/A |
GET | /users/{id}/access-history | View user access histories | Token (user) | N/A |
Method | URI | Action | Auth | Body |
---|---|---|---|---|
GET | /rooms/all | View all rooms | Token(user) | N/A |
GET | /rooms/{id}/current-state | Display current state of a room | Token (user) | |
GET | /rooms/{id} | Display room by ID | Token (user) | N/A |
PUT | /rooms/{id} | Update a room by ID | Token (admin) | name, capacity, type |
DELETE | /rooms/{id} | Delete room by ID | Token (admin) | N/A |
Method | URI | Action | Auth | Body |
---|---|---|---|---|
GET | /access/room/{id} | View current room state by ID | Token (admin) | N/A |
POST | /access/reserve | Create new booking | Token (user) | { "room_id": "id" } , { "date": "YYYY-MM-DD" } |
POST | /access/check-in/{id} | Check-in to a booking by ID | Token (user) | N/A |
POST | /access/check-out/{id} | Check-out to a booking by ID | Token (user) | N/A |
DEL | /access/cancel/{id} | Delete a booking by ID | Token (user) | N/A |
Method | URI | Action | Auth | Body |
---|---|---|---|---|
GET | /history/period | View all accesses for certain date period | Token (admin) | { "start_date": "YYYY-MM-DD", "end_date": "YYYY-MM-DD"} |
GET | /history/room/{id} | Create order | Token (admin) | N/A |
Method | URI | Action | Auth | Body |
---|---|---|---|---|
POST | /report/daily | Create a daily report for all bookings | Token (admin) | N/A |
GET | /report/room-usage/{id} | Create report for a room by ID | Token (admin) | N/A |
GET | /report/period | Create a report for specific date period | Token (admin) | {"start_date" : "YYYY-MM-DD", "end_date": "YYYY-MM-DD"} |
DEL | /report/delete/{id} | Delete a report by ID | Token (admin) | N/A |
✅ Add reports and details inside
⬜ Add more calendar options
⬜ StartUp and old users validations
Feel free to suggest an improvment or functionality to my project.
There are two ways of doing this:
- Opening an issue
- Creating a fork of the repository
- Creating a new branch
$ git checkout -b feature/yourUsername -feat
- Make a commit with your changes
$ git commit -m 'feat: this X thing'
- Make a push to the branch
$ git push origin feature/yourUsername -feat
- Opening a Pull Request
- Creating a new branch
To achieve my project I used data from the following sites:
- google.com
- pinterest.com
- spacebring.com
- ...
const developer = "yoanastamenova";
console.log("Developed by: " + developer);