Coder Social home page Coder Social logo

secure-sign's Introduction

Secure Sign

Secure Sign is a Golang-based authentication service that facilitates user registration, login, and retrieval of user details. The project includes REST API endpoints for seamless integration into your applications.

Table of Contents

Getting Started

Prerequisites

Before you start, ensure you have the following installed on your system:

Installation

  1. Clone the repository:

    git clone https://github.com/CHINMAYVIVEK/secure-sign.git
  2. Change into the project directory:

    cd secure-sign
  3. Initialize the Go module:

    go mod init secure-sign
  4. Build the Docker image:

    docker compose up

Usage

API Endpoints

Secure Sign provides the following API endpoints:

  • Register User:

    POST /register

    Example Request:

    curl -X POST http://localhost:8080/register -d '{
      "first_name": "John",
      "last_name": "Doe",
      "gender": "Male",
      "age": 30,
      "email": "[email protected]",
      "phone_number": "9234567892",
      "salary": 50000,
      "password": "1234"}'
  • Login:

    POST /login

    Example Request:

    curl -X POST http://localhost:8080/login -d '{"username": "newuser", "password": "password123"}'
  • Get User Details:

    GET /user/{username}

    Example Request:

    curl http://localhost:8080/user/newuser

Docker Deployment

To deploy the Secure Sign authentication service using Docker:

  1. Build the Docker image as mentioned in the Installation section.

  2. Run the Docker container:

    docker run -p 8080:8080 secure-sign

    The service will be accessible at http://localhost:8080.

Project Structure


├── app
│   ├── health
│   │   └── health.go
│   └── user
│       ├── fetch_user.go
│       ├── login.go
│       ├── registration.go
│       └── user.go
├── config
│   ├── config.go
│   └── postgres.go
├── data
│   ├── data.sql
│   ├── secure-login.postman_collection.json
│   └── test.sql
├── helper
│   ├── helper.go
│   ├── postgres.go
│   ├── validation.go
│   └── zap-logger.go
├── logs
│   └── access.log
├── middleware
│   └── middleware.go
├── server
│   ├── router.go
│   └── server.go
├── test
│   ├── cpu.prof
│   ├── env
│   ├── main_test.go
│   ├── test.test
│   ├── user_test.go
│   └── users.json
├── main.go
├── compose.yaml
├── dockerfile
├── env
├── go.mod
├── go.sum
└── README.md

Profiling :

Benchmark:

go test -run=XXX -bench . -benchmem

CPU Profiling:

go test -run=XXX -cpuprofile cpu.prof -bench .

go tool pprof cpu.prof

secure-sign's People

Contributors

chinmayvivek avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.