Technical assessment for GovTech Software Engineer internship using Golang.
- Building a backend API for assessment
- Postman collection(Desktop to Test it locally): https://www.postman.com/kevvvvinn/workspace/govtech/collection/30008705-b10c384c-3def-49f7-b499-c7cf54cdb430?action=share&creator=30008705
- Youtube link: https://youtu.be/j5HYB6SSu9Y
- GO 1.22
- PostgreSQL 15
- Gin Web Framework
- sqlx Package
- pq Package
- (optional) Postman
-
Run git clone https://github.com/mal1ceee/GolangApIGovTech.git
-
After clonning the repo, run go mody tidy in root directory to install dependancies
-
Run CREATE DATABASE postgres
-
Run -U postgres -d postgres -a -f (Path to database_schema.sql)
-
psql -U postgres -d postgres -a -f (Path to seed.sql) to populate table
-
After clonning the repo, run go mod tidy to install dependancies
-
To run the server, cd cmd/server/main.go to start the application (Allow access)
-
(Optional) To do Unit Testing, run go test ./...
- /api/students
- /api/register
- /api/commonstudents
- /api/suspend
- /api/retrievefornotifications
This is a record of all past commits for easy access and documentation.
| Date | Changes |
|---|---|
| 1402024 | 1. Initialize the file structure and added boilerplate 2. Created and Tested the db connections using postgre 15 |
| 15022024 | 1. Testing db connection to extract the the data from the table and printing it |
| 16022024 | 1. Implemented the handler, service and repository code + bug fixes |
| 18022024 | Fixed notifications and register API + refactor and bug fixes 2. Tried to implement unit testing |
- If there is any changes to the username (postgres), password (password1) or port(localhost:8080), the config can be changed in the config.go file.
- Please install the necessary version as there are features that might not be available in older/newer version.
- Unit Testing is still abit iffy and unsure how to go about Unit testing.
- Still new to Go so please dont mind the log messages and weird code (Had to google alot) :D
- Thanks for looking through the code!!