Skip to content

This repository contains a RESTful API built with Go to facilitate CRUD operations for managing dayscholars in a college setting.

Notifications You must be signed in to change notification settings

palash0216/Non-Boarders

Repository files navigation

Screenshot 2023-12-09 202610

Non-Borders

This repository contains a RESTful API built with Go to facilitate CRUD operations for managing dayscholars in a college setting.

Features

  • Create: Add new dayscholars to the system.
  • Read: Retrieve information about dayscholars.
  • Update: Modify existing dayscholar details.
  • Delete: Remove dayscholars from the system.

Technologies Used

  • GIN Framework: Fast and lightweight HTTP web framework for Go (gin-gonic/gin)

  • DaemonCompile: DaemonCompile You can use the go tool to install CompileDaemon:

go get github.com/githubnemo/CompileDaemon

To run Your Code use:

$ CompileDaemon -command="./MyProgram -my-options"
  • Gorm: An ORM library for Golang, used here with PostgreSQL (go-gorm/gorm) To install Gorm in your system use:
go get -u gorm.io/gorm
go get -u gorm.io/driver/"your DB"
  • Godotenv: A Go port of the Ruby dotenv library, used for loading environment variables from a .env file (joho/godotenv) To install use the command:
go get github.com/joho/godotenv
  • TablePlus: A modern, native app with an elegant UI for database management (TablePlus)

  • Postman: API development and testing made simple (Postman)

Getting Started: Prerequisites

Before running the API, make sure you have the following tools installed:

  • Go (Latest Version)
  • DaemonCompile (Latest Version)
  • PostgreSQL - Elephant Sql (E-SQL)
  • Godotenv
  • TablePlus (optional, for database visualization)
  • Postman (optional, for testing and documentation)

Setup

  1. Clone this repository:

    git clone https://github.com/your-username/your-repo.git
    cd your-repo
  2. Install dependencies:

    go mod download
  3. Create a .env file in the root directory and configure your environment variables:

    DB_USER=your_database_user
    DB_PASSWORD=your_database_password
    DB_NAME=your_database_name
    DB_URL="URL"
    PORT=PortNumber
  4. Run the API:

    go run main.go
  5. To Test: Download Postman and import all the files and run.

API Endpoints

  • GET /Student: Retrieve a list of all student.
  • GET /student/{id}: Retrieve details of a specific student.
  • POST /student: Add a new student to the system.
  • PUT /student/{id}: Update information for a specific student.
  • DELETE /student/{id}: Remove a student from the system.

Usage

  1. Use TablePlus or any preferred database management tool to view and manage the database.

  2. Use Postman to test the API endpoints. Import the provided Postman collection for convenience.

  3. Integrate this API into your frontend application to manage dayscholars seamlessly.

Screenshot 2023-12-11 182259


Sequence Diagram

(Create using (Visula Paradigm))

Screenshot 2023-12-13 110605

About

This repository contains a RESTful API built with Go to facilitate CRUD operations for managing dayscholars in a college setting.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages