Skip to content

Commit 272b814

Browse files
update readme and route.go
1 parent 13bea28 commit 272b814

File tree

3 files changed

+60
-1
lines changed

3 files changed

+60
-1
lines changed

README.md

+59
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,67 @@
22

33
QuizIslamicAI is a Golang-based project that aims to revolutionize the learning experience by combining personalization and automated content creation using the latest AI technology.
44

5+
## Running the Golang Application Locally
6+
7+
To run the Golang application locally, follow these steps:
8+
9+
1. Make sure you have Go installed and have correctly configured the Go environment on your computer.
10+
11+
2. Open a terminal and navigate to your Golang project directory.
12+
13+
3. Run the following command to execute the application:
14+
```
15+
go run main.go
16+
```
17+
Alternatively, if you are using [Air](https://github.com/cosmtrek/air) as a runner for hot reload:
18+
```
19+
air -c .air.toml
20+
```
21+
22+
4. Your Golang application will be running and accessible at `http://localhost:8080/`.
23+
24+
## Postman Documentation
25+
26+
The Postman API documentation can be accessed at the following link: [Postman Documentation](https://documenter.getpostman.com/view/6565461/2s946icBSw)
27+
28+
## Deploying to the Public Server
29+
30+
This Golang application has been deployed to a public server with the IP address: `http://44.206.239.176:8080/`. You can access the application using this link.
31+
32+
## CI/CD with GitHub Actions
33+
34+
In this repository, we utilize GitHub Actions for Continuous Integration/Continuous Deployment (CI/CD) of the Golang application.
35+
36+
### CI/CD Process
37+
38+
Every time there is a push to the `main` branch, GitHub Actions will perform the following steps:
39+
40+
1. Checkout the source code from the repository.
41+
42+
2. Set up the SSH private key and allow access to the AWS server using webfactory/ssh-agent.
43+
44+
3. Pull from the repository on the AWS server to get the latest changes.
45+
46+
4. SSH to the AWS server, build a Docker image from the Golang code in the `/var/www/be-alta-quizislamic-ai/` directory, and run the Docker container using the newly created Docker image.
47+
48+
### GitHub Actions Configuration
49+
50+
The GitHub Actions configuration can be found in the `.github/workflows/go-push-docker.yml` file. You can customize the necessary steps for CI/CD according to your project's requirements.
51+
52+
Make sure you have set up the SSH_PRIVATE_KEY as a secret in your repository for successful SSH access to the AWS server.
53+
54+
Note: Ensure you have properly configured and set up the AWS server before performing CI/CD with GitHub Actions.
55+
56+
---
57+
558
## Table of Contents
659
- [Project Golang: QuizIslamicAI](#project-golang-quizislamicai)
60+
- [Running the Golang Application Locally](#running-the-golang-application-locally)
61+
- [Postman Documentation](#postman-documentation)
62+
- [Deploying to the Public Server](#deploying-to-the-public-server)
63+
- [CI/CD with GitHub Actions](#cicd-with-github-actions)
64+
- [CI/CD Process](#cicd-process)
65+
- [GitHub Actions Configuration](#github-actions-configuration)
766
- [Table of Contents](#table-of-contents)
867
- [Pertemuan 1](#pertemuan-1)
968
- [Pertemuan 2](#pertemuan-2)

route/route.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ func New() *echo.Echo {
195195
g.POST("/change-password", controller.ChangePasswordController)
196196

197197
// Testing
198-
e.GET("/test", func(c echo.Context) error {
198+
e.GET("/test-1", func(c echo.Context) error {
199199
return c.JSON(200, "Hello World")
200200
})
201201

tmp/main

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)