{"id":19326197,"url":"https://github.com/marlinsk/tmaior-test-marlon-backend-application","last_synced_at":"2026-04-10T11:31:07.547Z","repository":{"id":206120935,"uuid":"541873690","full_name":"Marlinsk/tmaior-test-marlon-backend-application","owner":"Marlinsk","description":"A backend project with clean architecture + SOLID + TDD and CD/CD process","archived":false,"fork":false,"pushed_at":"2023-11-08T02:20:23.000Z","size":222,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-06T06:44:02.203Z","etag":null,"topics":["babel","cicd","clean-architecture","deployment","docker","docker-container","docker-image","dockerfile","express-js","mongodb","nodejs","pipeline","process","solid","tdd","test-automation","tests","typescript"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Marlinsk.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-27T02:41:44.000Z","updated_at":"2023-11-08T02:28:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"f271e63f-25e0-42d1-b086-ab470028904b","html_url":"https://github.com/Marlinsk/tmaior-test-marlon-backend-application","commit_stats":null,"previous_names":["marlinsk/tmaior-test-marlon-backend-application"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marlinsk%2Ftmaior-test-marlon-backend-application","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marlinsk%2Ftmaior-test-marlon-backend-application/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marlinsk%2Ftmaior-test-marlon-backend-application/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marlinsk%2Ftmaior-test-marlon-backend-application/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Marlinsk","download_url":"https://codeload.github.com/Marlinsk/tmaior-test-marlon-backend-application/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240427313,"owners_count":19799471,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["babel","cicd","clean-architecture","deployment","docker","docker-container","docker-image","dockerfile","express-js","mongodb","nodejs","pipeline","process","solid","tdd","test-automation","tests","typescript"],"created_at":"2024-11-10T02:12:45.470Z","updated_at":"2026-04-10T11:31:02.524Z","avatar_url":"https://github.com/Marlinsk.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Technical test TMaior\nProject developed for technical evaluation in the selection process for the Junior DevOps position at TMaior.\n\n## The objective of this project version\nBackend application developed for practical purposes using **Clean aArchitecture + object-oriented programming paradigm + SOLID principles.** This application is a API Restfull developed with **Node.js + TypeScript + MongoDB ATLAS + Prisma ORM + Docker.** For the pipelines I used **Github Actions** for the continuous integration and delivery processes.\n\n## Tutorial\n**Note:** To follow the step-by-step instructions for running the application on your machine, you need to have knowledge of terminal commands, Git and GitHub commands, and npm package manager commands, as well as navigating between folders using the terminal.\n\n### Cloning and setting up the project\n**1º step: clone the repository to your machine from GitHub.**\n```bash\ngit clone https://github.com/Marlinsk/tmaior-test-marlon-backend-application.git\n```\n\n**2º step: Navigate to the project folder.**\n```bash\ncd tmaior-test-marlon-backend-application\n```\n\n**3º step: Create .env file before run npm install in the terminal.**\n```bash\nDATABASE_URL=mongodb+srv://USERNAME:PASSWORD@HOST/DATABASE\n```\n**Note:** After creating the file, insert the credentials to connect to the MongoDB Atlas database. \n\n**4º step: Run the command in the terminal to install the project dependencies.**\n```bash\nnpm install\n```\n\n**5º step: Run the command in the terminal to generate prisma client.**\n```bash\nnpx prisma generate\n```\n\n**6º step: Run the command in the terminal to connect to MongoDB ATLAS.**\n```bash\nnpx prisma db push\n```\n\n**7º step: Execute the command to build the application.**\n```bash\nnpm run build\n```\nWithout the **dist file** generated by the build, the application will not work.\n\n**8º step: Run the command in the terminal to start the application, and feel free to test and play around.**\n```bash\nnpm run start\n```\n\nNow, you just need to access it using a request tool or consume it; the application is running on **localhost:5000.**\n\n## Creating a Docker image of the application\n**Note**: You need to have Docker on your machine and have a basic understanding of terminal commands. Having all of that, let's get started.\n\n**1º step: Inside the project folder, run the following command in the terminal to create the Docker image.**\n```bash\ndocker build -t backend-app:latest .\n```\n\n**2º step: Run the command in the terminal for list your images.**\n```bash\ndocker images\n```\nAfter that, look for the **IMAGE ID** of your image name and copy it.\n\n**3º step: Run the command in the terminal for app works.**\n```bash\ndocker run -p 5000:5000 --name app-container backend-app:latest\n```\n\n### Other docker commands\nCommand to list the running containers\n```bash\ndocker ps\n```\n\nTo stop a specific container\n```bash\ndocker stop app-container\n```\n**Note:** To stop all running containers, you can simply use **docker stop.**\n\nTo remove specific container\n```bash\ndocker rm app-container\n```\n\nTo remove specific image\n```bash\ndocker rmi backend-app:latest\n```\n\n## Run aplication in Cloud with docker-composer\n**Note:** Must have knowledge of creating cloud environments.\n\nTo run the application using Docker in Cloud, create and open the **docker-compose.yml** in environment, copy this example file and modify the variables. Add the name of the **Docker image** you created along with its version. Additionally, include the same **MongoDB Atlas connection URL** from your **.env file** in the environment section.\n\n```bash\n\nversion: '3'\n\nservices:\n  app:\n    container_name: simple-api\n    image: backend-app:latest\n    ports:\n      - '5000:5000'\n    environment:\n      DATABASE_URL: 'mongodb+srv://USERNAME:PASSWORD@HOST/DATABASE'\n```\n\n**Note:** During the build process using github actions, the environment variable is not copied into the container during the process, so in docker-compose the value of the environment variable is passed.\n\nAfter doing this, run the following command to bring up the container. Make sure everything is done according to the step-by-step before proceeding.\n\nTo start the services defined in your docker-compose.yml file:\n```bash\ndocker-compose up \n```\n\nor\n\nTo start the services defined in your docker-compose.yml file:\n```bash\ndocker-compose up -d\n```\n\nNow, you have an application running in a Docker container. You just need to access it using a request tool or consume it; the application is running on **localhost:5000.**\n\n### Other docker commands\nTo start and rebuild the containers, forcing them to be rebuilt (useful when you make changes to your Dockerfile or application code):\n```bash\ndocker-compose up --build\n```\n\nTo stop and remove the containers defined in your docker-compose.yml file:\n```bash\ndocker-compose down\n```\n**Note:** To stop all running containers, you can simply use **docker stop.**\n\nTo start all stopped containers defined in your docker-compose.yml file, you can use the following command:\n```bash\ndocker-compose start\n```\n\nTo view the logs of the services:\n```bash\ndocker-compose logs\n```\n\n## Application Routes\nDocumentation for the API request routes.\n\n**POST** Create a post: \n\nCreate a post.\n\n**Example request body:**\n```\n{\n    \"title\": \"Hello world!\",\n    \"text\": \"hello world!\"\n}\n```\n\n\u003e /posts\n\n**GET** Find post by ID:\n\nGet the post by ID specified.\n\n\u003e /posts/:id\n\n**GET** Find all posts:\n\nList all posts\n\n\u003e /posts\n\n**PUT** Update post:\n\nUpdate post by specified ID\n\n**Example request body:**\n```\n{\n  \"title\": \"Hello world!\",\n  \"text\": \"hello world!\"\n}\n```\n\n\u003e /posts/:id\n\n**DELETE** Remove post:\n\nRemove post by specified ID\n\n\u003e /posts/:id\n\n## See also the front end application\nThis application is divided into two parts back end and front end, to access the front end repository, the link below takes you to the front end application repository.\n\n**Link:** https://github.com/Marlinsk/tmaior-test-marlon-frontend-application\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarlinsk%2Ftmaior-test-marlon-backend-application","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarlinsk%2Ftmaior-test-marlon-backend-application","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarlinsk%2Ftmaior-test-marlon-backend-application/lists"}