Skip to content
This repository has been archived by the owner on May 4, 2024. It is now read-only.

REST API that allows you to manage employees and departments in a company.

License

Notifications You must be signed in to change notification settings

jhordyess/employees-api-node

Repository files navigation

Employees API in Node

REST API that allows you to manage employees and departments in a company.

Description

REST API allows you to manage employees and departments in a company. You can use it to add, update, and delete employees and departments; also includes authentication and Swagger documentation.

Technologies Used

Screenshot

Swagger UI

How to use for development

  1. Clone the repository:
git clone [email protected]:jhordyess/employees-api-node.git
  1. Open the project folder:
cd employees-api-node
  1. Create a .env file in the root folder by copying the example from the .env.example file. And replace the values with your own.

  2. Configure SQL Server if needed. You can following the SQLServerConfig.md guide.

  3. Install the dependencies:

yarn
  1. Run the project:
yarn dev
  1. Now you can test the endpoints at http://localhost:3000/api/v1. The API docs(Swagger UI) will be available at http://localhost:3000/api/v1/docs

How to use for development with Docker

You can use the VSCode dev containers to run the project in a containerized environment.

You need to have installed Docker and VSCode, and the Dev Containers extension.

  1. Clone the repository:
git clone [email protected]:jhordyess/employees-api-node.git
  1. Open the project with VSCode:
code employees-api-node
  1. Create a .env file in the root folder by copying the example from the .env.example file. And replace the values with your own.

  2. Open the terminal in VSCode, and run the docker compose file:

docker compose -f docker-compose.dev.yml up -d
  1. Open the command palette and select the option Dev Containers: Reopen in Container.

  2. Wait for the container to be built and the project to be started.

  3. Open the terminal in VSCode and run the project:

yarn dev
  1. Now you can test the endpoints at http://localhost:3000/api/v1. The API docs(Swagger UI) will be available at http://localhost:3000/api/v1/docs

How to use for production with Docker

To run the project in production with Docker, remember to create the .env file and replace the values with your own.

Then, run the following command in the terminal:

docker compose -f docker-compose.prod.yml up -d

To stop or remove, run:

docker compose -f docker-compose.prod.yml down

Take note that this production configuration is just for testing purposes, and may not be suitable for a real production environment.

To-Do

  • Fully translate the API documentation to English
  • Elaborate the Entity-Relationship Diagram

Contribution

If you would like to contribute to the project, open an issue or make a pull request on the repository.

License

© 2024> Jhordyess. Under the MIT license. See the LICENSE file for more details.


Made with 💪 by Jhordyess