Created Express routing to demonstrate CRUD functionality (Create / Read / Update / Delete) for two API items: Companies and Employees
Used Express validation middleware to demonstrate basic payload validation
Used Express middleware to enforce authorisation
Companies DB table consists of these fields: Name (required), email, phone, website
Employees DB table consists of these fields: First name (required), last name (required), Company (foreign key to Companies), email, phone
User DB table (Additional table to enforce log in as admin functionality)
Important Instructions
This project is built with MySQL as database choice. Please setup MySQL in the system before installing and running the project.
After installing MySQL in the system, create a database inside.
Once you setup your mysql database you need to set the database name, username, password in src/configs/sequelizeconfig.ts file
key
Type
Description
database
string
Your MYSql database name.
username
string
Your username
password
string
Your password.
All the API reference is given in the API Reference docs. However, to ease API testing there is a POSTMAN api JSON file added in the root of the project (/postman/engagexr-apis.postman_collection.json) directory. Import this file in the POSTMAN application and test the API with pre-loaded data. More info about API's is given in the API Reference section.
you can find the server logs under logs folder under the root directory.
Environment Variables
To run this project, you will need to add the following environment variables to your .env file