Skip to content

chicodevs/employee-crud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

NodeJS API by Francisco-gui

This is Node.js + Express rest API with a Relational Database in PostgreSQL. Front-end builded in Vue.js + Boostrap 4.

--> How to run the API

  1. clone repository and go to project folder
git clone https://github.com/chicodevs/employee-crud.git
cd employee-crud
cd employee-api
  1. Create a new database and a .env PostgreSQL connection string:
Schema:
  CREATE TABLE employee (
    employee_id uuid PRIMARY KEY NOT NULL DEFAULT uuid_generate_v4(),
    name VARCHAR(255) NOT NULL,
    job_role VARCHAR(255) NOT NULL,
    salary NUMERIC(12,2) NOT NULL,
    birth DATE NOT NULL,
    employee_registration INTEGER NOT NULL
  )

PostGreSQL connection string:
  DATABASE_URL=postgres://YourUserName:YourPassword@YourHostname:5432/YourDatabaseName
  1. run the development server:
npm run dev

You can use insomnia to test all endpoints

# ROUTES
GET      /employees
POST     /employees
GET      /employees/:id
PUT      /employees/:id
DELETE   /employees/:id

--> How to build Front-end

  1. go to project folder
cd employee-crud
cd front-vue2
  1. Run the command:
npm run serve
  1. on PORT localhost:8080 you can acess the employees list and create a new employee registration image image

About

CRUD Node.JS + PostgreSQL + Vue JS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published