This repository contains a RESTful API built with Go to facilitate CRUD operations for managing dayscholars in a college setting.
- Create: Add new dayscholars to the system.
- Read: Retrieve information about dayscholars.
- Update: Modify existing dayscholar details.
- Delete: Remove dayscholars from the system.
-
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)
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)
-
Clone this repository:
git clone https://github.com/your-username/your-repo.git cd your-repo
-
Install dependencies:
go mod download
-
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
-
Run the API:
go run main.go
-
To Test: Download Postman and import all the files and run.
- 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.
-
Use TablePlus or any preferred database management tool to view and manage the database.
-
Use Postman to test the API endpoints. Import the provided Postman collection for convenience.
-
Integrate this API into your frontend application to manage dayscholars seamlessly.
(Create using (Visula Paradigm))