REST API that allows you to manage employees and departments in a company.
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.
- Node modules: Express, Prisma, Swagger UI
- Programming Language: TypeScript
- Build Tool: Webpack
- Database: SQL Server
- Dev Environment: VSCode with dev containers in Zorin OS
- Clone the repository:
git clone [email protected]:jhordyess/employees-api-node.git
- Open the project folder:
cd employees-api-node
-
Create a
.env
file in the root folder by copying the example from the.env.example
file. And replace the values with your own. -
Configure SQL Server if needed. You can following the SQLServerConfig.md guide.
-
Install the dependencies:
yarn
- Run the project:
yarn dev
- 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
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.
- Clone the repository:
git clone [email protected]:jhordyess/employees-api-node.git
- Open the project with VSCode:
code employees-api-node
-
Create a
.env
file in the root folder by copying the example from the.env.example
file. And replace the values with your own. -
Open the terminal in VSCode, and run the docker compose file:
docker compose -f docker-compose.dev.yml up -d
-
Open the command palette and select the option
Dev Containers: Reopen in Container
. -
Wait for the container to be built and the project to be started.
-
Open the terminal in VSCode and run the project:
yarn dev
- 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
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.
- Fully translate the API documentation to English
- Elaborate the Entity-Relationship Diagram
If you would like to contribute to the project, open an issue or make a pull request on the repository.
© 2024> Jhordyess. Under the MIT license. See the LICENSE file for more details.
Made with 💪 by Jhordyess