Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/denizedizcan/rest-api-user-management-service

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/denizedizcan/rest-api-user-management-service

  • v0.0.0-20220908190026-512ab8ec754b
  • Source
  • Go
  • Socket score

Version published
Created
Source

REST-API-User-Management-Service

This repository contains the necessary codes & info about REST API which is used to manage a user management service. It has some basic CRUD operations on user system. Using Postgres

About the project

The functions of this service are as follows;

  1. List Users
    • API should be able to list all users.
  2. Add User
    • API can add users.
  3. Show One User
    • API can show one user by id.
  4. Delete User
    • API can remove a user by id.
  5. Update User
    • Users can update their data

Prerequisites and Installation

  • Docker:

    You can install Docker Desktop by following the instructions on the Docker Desktop website.

    If you are using MacOS, you can install Docker by following commands:

    • brew install docker
    • docker run hello-world

  • PostgreSQL:

    Plese refer here for the initialization scripts.


  • Go:

    If you haven't done already, You need to install Go by following the instructions on the Go website.


  • Project:

    You have to clone the project from the Github repository and run the below script to build the project

    git clone https://github.com/denizedizcan/REST-API-User-Management-Service.git


  • Run the Project:

    You have to make sure that you are in the same directory as the project. Then you can run the below script:

    docker build -t {your-desired-image-name} .

    docker run -d --env-file=.env --name {your-desired- container-name} -p {your-desired-port}:8080 {your-desired-image-name}

    Note: Be careful with the port number. You can't run this project as a docker container while DB_HOST is set to 127.0.0.1 in .env file

    Note: If you want to run the project as a docker container, you have to change the DB_HOST to the IP address of the container mentioned in the .env file. Refer here for the .env file.

    You can get the IP address of the container by running the below command by replecing {your-container-name} with a container name you want to inspect

    docker inspect --format '{{ .NetworkSettings.IPAddress }}' {your-container-name}

    Example For docker inspect: docker inspect --format '{{ .NetworkSettings.IPAddress }}' postgres-cnt

    Example for running docker container:

    docker build -t project-rllc-img:1.0 .

    docker run -d --env-file=.env --name project-rllc-cnt -p 8080:8080 project-rllc-img:1.0

    Or you can run the project directly by running the below script from the same directory as the project:

    go run main.go

FAQs

Package last updated on 08 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc