Skip to content

A simple CRUD API for managing person records using Go (backend), PostgreSQL (database), React (frontend), and Docker for containerization, with full CORS support and error handling.

Notifications You must be signed in to change notification settings

dagimgetaw/person-management-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Writing the README content to a markdown file

readme_content = """

User Management System

This project is a simple user management system built using Go, GORM, and PostgreSQL for the backend, and React for the frontend.

Features

  • Create new users
  • View user details
  • Delete users
  • Store user information in a PostgreSQL database

Technologies Used

  • Backend: Go, GORM, Gin
  • Frontend: React
  • Database: PostgreSQL

Setup Instructions

Backend

  1. Install Go dependencies:

    go get github.com/githubnemo/CompileDaemon
    go install github.com/githubnemo/CompileDaemon
    go get github.com/joho/godotenv
    go get -u github.com/gin-gonic/gin
    go get -u gorm.io/gorm
    go get -u gorm.io/driver/postgres
    go get github.com/jackc/pgx/v5
    go get github.com/lib/pq
    go get github.com/gin-contrib/cors
  2. Create a .env file in the root directory with the following variables:

    DB_HOST=localhost
    DB_PORT=5432
    DB_USER=your_db_user
    DB_PASSWORD=your_db_password
    DB_NAME=your_db_name
    
  3. Run the Go server:

    go run main.go

Frontend

  1. Install Node.js dependencies (in the frontend directory):

    npm install
  2. Run the React application:

    npm start

API Endpoints

  • GET /person: Retrieve all users
  • POST /person: Create a new user
  • GET /person/:id: Retrieve user details by ID
  • DELETE /person/:id: Delete a user by ID

License

This project is licensed under the MIT License.

About

A simple CRUD API for managing person records using Go (backend), PostgreSQL (database), React (frontend), and Docker for containerization, with full CORS support and error handling.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published