This repository is an orchestrator coordinating two microservices: one for user authentication (Auth) and another for task management with CRUD functionalities. It is built using TypeScript for maintainability, Axios for HTTP requests, and employs a CI/CD pipeline with GitHub Actions. The Docker images are published to the GitHub Container Registry
- 📦 RESTful API: Clean and reusable API endpoints.
- 🧩 Modular Code Structure: Clean and scalable architecture.
- 📄 Environment Variables: Configurable via
.env
file.
├── src
│ ├── controllers # API controllers
│ ├── environment # environments dev and prod
│ ├── helpers # Helper functions
│ │ ├── mappers # mappers
│ │ └── utilities # utilities
│ ├── interfaces # interfaces and types
│ ├── middleware # middlewares
│ ├── routes # Express routes
│ ├── server # Server entry point
│ ├── services # API services
│ │ ├── app.ts # Express app setup
│ └── index.ts # App configuration
├── .env # Environment variables
├── tsconfig.json # TypeScript configuration
├── package.json # Dependencies and scripts
└── README.md # Project documentation
- Clone the repository:
git clone https://github.com/Aanttrax/orchestrator.git cd orchestrator
- Install dependencies:
npm install
- Set up environment variables: Create a .env file in the root directory and add the following:
PORT=3200 HOST=0.0.0.0 SERVICE_AUTH=http://localhost:3100/ SERVICE_TASK=http://localhost:3200/
- Start the development server:
npm run dev
-
Alive
- GET
/alive
- Response:
{ "success": true, "response": "Server online" }
- GET
-
User Registration
- POST
/signup
- Request Body:
{ "userName": "john_doe", "password": "prueba", "name": "john", "lastName": "Doe", "email": "[email protected]" }
- Response:
{ "success": true, "response": "user created" }
- Headers:
"auth-token": "*laksjflieuaksjdhfknclkasjhfeiuhakjfaeh;f;s"
- POST
-
User Login
- POST
/signin
- Request Body:
{ "email": "[email protected]", "password": "prueba" }
- Response:
{ "success": true, "response": "logged-in user" }
- Headers:
"auth-token": "*laksjflieuaksjdhfknclkasjhfeiuhakjfaeh;f;s"
- POST
-
Create Task
- POST
/task
- Headers:
"auth-token": "*laksjflieuaksjdhfknclkasjhfeiuhakjfaeh;f;s"
- Request Body:
{ "title": "new Task", "description": "description of the task" }
- Response:
{ "success": true, "response": "Task Created" }
- POST
-
Get Tasks
- GET
/task
- Headers:
"auth-token": "*laksjflieuaksjdhfknclkasjhfeiuhakjfaeh;f;s"
- Response:
{ "success": true, "response": [ { "_id": "674a1d6735166960a3dac662", "title": ".......", "description": "....", "done": false, } ] }
- GET
-
Get Task by Id
- GET
/task/:taskId
- Headers:
"auth-token": "*laksjflieuaksjdhfknclkasjhfeiuhakjfaeh;f;s"
- Response:
{ "success": true, "response": { "_id": "674a1d6735166960a3dac662", "title": ".......", "description": "....", "done": false, } }
- GET
-
Update Task by Id
- PUT
/task/:taskId
- Headers:
"auth-token": "*laksjflieuaksjdhfknclkasjhfeiuhakjfaeh;f;s"
- Request Body:
{ "title": "new Task", "description": "description of the task", "done": true }
- Response:
{ "success": true, "response": "Task Updated" }
- PUT
-
Delete Task by Id
- DELETE
/task/:taskId
- Headers:
"auth-token": "*laksjflieuaksjdhfknclkasjhfeiuhakjfaeh;f;s"
- Response:
{ "success": true, "response": "Task Deleted" }
- DELETE
- Fork the repository.
- Create a new branch:
git checkout -b feature-name
- Commit your changes:
git commit -m "Add your message"
- Push to the branch:
git push origin feature-name
- Create a pull request.
- Express.js - Web framework for Node.js.
- TypeScript - Typed JavaScript at any scale.
- Axios - HTTP requests for modern applications.
This project is licensed under the MIT License. See the LICENSE file for details.