Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/agust613/don_bosco_labs_back

Don Bosco Clinical Laboratory Backend
https://github.com/agust613/don_bosco_labs_back

api-rest backend dotenv express http nodejs postgres requests typescript

Last synced: 20 days ago
JSON representation

Don Bosco Clinical Laboratory Backend

Awesome Lists containing this project

README

        

# Clinical Laboratory - Backend Project

## Installation

- Clone and install dependencies

```bash
git clone https://github.com/AgusT613/don_bosco_labs_back

cd don_bosco_labs_backend

npm install
```

- Create a `.env` file

```bash
EXPRESS_PORT = your_express_port # Ex. 8080
# Postgres Connection
PG_HOST = "your_postgres_host"
PG_USER = "your_postgres_user"
PG_PASSWORD = "your_postgres_password"
PG_DATABASE = "your_database_name" # Ex. DonBoscoLabs
PG_PORT = your_postgres_port # By default postgres uses 5432 port
# Frontend Allowed Origin
ALLOWED_ORIGIN = "your_frontend_origin_url"
```

- Create the database with postgres using `psql` or `pgAdmin`
- You can copy the sql code on `src/api/db/db.sql`

```sql
CREATE DATABASE "DonBoscoLabs";

CREATE TABLE IF NOT EXISTS staff (
user_id SERIAL PRIMARY KEY,
name varchar(45) DEFAULT NULL,
surname varchar(45) DEFAULT NULL,
address varchar(50) DEFAULT NULL,
dni varchar(8) DEFAULT NULL,
email varchar(45) NOT NULL,
password varchar(100) NOT NULL,
entry_date date DEFAULT NULL,
area_id int DEFAULT NULL,
job_position_id int DEFAULT NULL
);

INSERT INTO staff (email, password) VALUES ('[email protected]', 'andres123456789'), ('[email protected]', 'maria123456789');
```

- Transpile the proyect from TS to JS

```bash
npm run build
```

- So as to finally run the project using:

```bash
npm run dev
```