https://github.com/emanuelangel/lab-2
AplicaciΓ³n Agenda de Consultorios - Laboratorio 2
https://github.com/emanuelangel/lab-2
authentication bcrypt bootstrap cookies express jsonwebtoken mysql pug sessions zod
Last synced: 3 months ago
JSON representation
AplicaciΓ³n Agenda de Consultorios - Laboratorio 2
- Host: GitHub
- URL: https://github.com/emanuelangel/lab-2
- Owner: EmanuelAngel
- Created: 2024-10-03T00:40:08.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-06T06:26:43.000Z (over 1 year ago)
- Last Synced: 2024-12-14T12:42:38.504Z (over 1 year ago)
- Topics: authentication, bcrypt, bootstrap, cookies, express, jsonwebtoken, mysql, pug, sessions, zod
- Language: JavaScript
- Homepage:
- Size: 740 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Welcome to our project / Bienvenido a nuestro proyecto
- [πͺπΈ Leer en espaΓ±ol](README_es.md)
# Clinic Appointment Scheduler - Laboratory 2
Repository containing the source code for the Clinic Appointment Scheduler project, part of the "Laboratory 2" course in the "University Technical Degree in Software Development" program at [Universidad de la Punta](https://www.ulp.edu.ar/) in San Luis, Argentina.
## Team Members
- [Angel Emanuel](https://github.com/EmanuelAngel)
- [Alcaraz Rodrigo NicolΓ‘s](https://github.com/RodrigoNAlcaraz)
## Recommendations
- **Node.js** Version used in the project: v20.14. [Recommended LTS Version](https://nodejs.org/en/download/prebuilt-installer)
## Description
- Sign up, log in, and log out.
- Create, list, edit, activate, and deactivate patients.
- Create, list, edit, activate, and deactivate professionals (doctors).
- Create, list, edit, activate, and deactivate specialties.
- List schedules.
- Assign an appointment to a patient in an available time slot of a schedule.
## Details
- A patient can have none or multiple health insurance plans.
- A professional can have one or more specialties.
- Each schedule corresponds to a registration in a professional's specialty.
- Schedules can include appointments on different days, both morning and afternoon.
- Schedule time slots can be fragmented, allowing unavailable time slots on the same day.
- Secure access to the application based on user roles (e.g., admin, professional, patient).
## Instructions to Run the Project Locally
1. Clone the repository:
```bash
git clone https://github.com/EmanuelAngel/lab-2.git
```
2. Navigate to the cloned folder:
```bash
cd lab-2
```
3. Install dependencies:
```bash
npm|yarn|pnpm install
```
4. Download the database copy and import it into a MySQL manager.
5. Create a `.env` file and modify the environment variables according to your setup:
```bash
NODE_ENV = development
PORT = 3001
DB_HOST = localhost
DB_USER = root
DB_PORT = 3306
DB_PASS =
DB_NAME = mydb
DB_CONNECTION_LIMIT = 10
JWT_SECRET = secret_very_secret
JWT_EXPIRES = 1h
```
6. Start the server:
```bash
npm|yarn|pnpm run dev
```
## Project Structure
```bash
.
βββ public/ # Static files (CSS, JS)
βββ views/ # Dynamic views in Pug
βββ src/ # Main source code
β βββ .bin/ # Entry point - Server
β βββ config/ # Database configuration
β βββ middlewares/ # Application middlewares
β βββ migrations/ # Database change history
β βββ apps/ # Application modules
β β βββ agenda_base/ # Schedule module
β β β βββ agenda_base.http # HTTP request testing
β β β βββ controller.js
β β β βββ router.js
β β β βββ model.js
β β β βββ schema.js # Validation schemas
β β βββ auth/ # Authentication and authorization module
β β βββ pacientes/ # Patients module
β β βββ profesionales/ # Professionals module
β β βββ ... # Other modules
β βββ app.js # Main application configuration
βββ package.json
βββ db.copy.sql # Latest database version
βββ .env # Environment variables
```
## Technologies Used
- [Express v4.19.0](https://expressjs.com/): Node.js Framework.
- [MySQL v8.0](https://www.mysql.com/): Relational database management system. - Used for persistent storage of patients, professionals, schedules, appointments, and health insurance data.
- [Pug](https://pugjs.org/): Template engine for Node.js - Used to generate dynamic views.
- [Bootstrap](https://getbootstrap.com/): Feature-packed frontend toolkit.
- [Bootstrap Icons](https://icons.getbootstrap.com/): Icons for Bootstrap
- [Zod](https://zod.dev/): Schema declaration and validation library.
- [Render](https://render.com/): Hosting service for deployment.
- [StandardJS](https://standardjs.com/): JavaScript style guide, linter, and formatter.
- [REST Client](https://marketplace.visualstudio.com/items?itemName=humao.rest-client): Visual Studio Code Extension tool for making and testing HTTP requests.
- [JSON Web Tokens](https://jwt.io/): For authentication and role-based access control.
- [bcrypt](https://www.npmjs.com/package/bcrypt): For hashing, salting, and verifying passwords.
- [cookie-parser](https://www.npmjs.com/package/cookie-parser): Middleware for parsing cookies in HTTP requests.
- [morgan](https://www.npmjs.com/package/morgan): Middleware for logging HTTP requests in Node.js.
- [dotenv](https://www.npmjs.com/package/dotenv): Loads environment variables from a `.env` file.
- [cors](https://www.npmjs.com/package/cors): Middleware to enable CORS (Cross-Origin Resource Sharing) in web applications.
- [nodemon](https://nodemon.io/): Tool that automatically restarts a Node.js application when file changes are detected.
## Future Scalability
This project has been designed and architected with scalability in mind, ready to integrate future functionalities such as:
- Management of overbooked appointments.
- Additional appointment states (canceled, rescheduled, etc.).
- Handling photocopies of ID documents.
- Advanced administration panel.
The modular structure of the project facilitates the incorporation of these and other features while maintaining organized and maintainable code.