It fetches markdown content from the GitHub repository and converts it to required HTML and sends the response to the /GET request.
It also has the dashboard in HTMX which supports adding the list of blogs, projects and see website analytics for the prosamik nextjs app.
The instructions on how to write the Markdown content that it can understand are here
To understand the project in-depth click here
- Go 1.22.0 (with toolchain 1.23.1)
- Docker (for containerized deployment)
- PostgreSQL
- Git
-
Clone the repository:
git clone [email protected]:proSamik/prosamik-golang-server.git cd prosamik-golang-server
-
Install Go dependencies:
go mod tidy
- Create a
.env
file in the root directory with the following configuration:# SMTP Configuration # I have used gmail, you can all aso use your own gmail id and app password of it SMTP_HOST=<your-smtp-host> SMTP_PORT=<your-smtp-port> SMTP_USER=<your-smtp-email> SMTP_PASSWORD=<your-smtp-password> FEEDBACK_RECIPIENT_EMAIL=<recipient-email> # Authentication JWT_SECRET_KEY=<your-secret-token> ADMIN_PASSWORD=<admin-password> # GitHub Integration GITHUB_TOKEN=<your-github-token> # Database Configuration DB_HOST=<your-database-host> DB_PORT=<your-database-port> DB_USER=<your-database-username> DB_PASSWORD=<your-database-pwd> DB_NAME=<your-database-name> # Application Port PORT=10000
-
Ensure PostgreSQL is running and accessible with the configured credentials
-
Run the application:
go run cmd/server/main.go
-
Build the Docker image:
docker build -t <your-image-name> -f Dockerfile .
-
Run the container:
docker run -p 10000:10000 --env-file .env <your-image-name>
- The application runs on port 10000 by default
- Make sure to set up proper SMTP credentials for email functionality
- Database migrations are automatically handled by the application
- Ensure all environment variables are properly set before running the application
- For
JWT_SECRET_KEY
: Use a strong, random string (minimum 32 characters) - For
ADMIN_PASSWORD
: Use a strong password with mixed case, numbers, and special characters - For
GITHUB_TOKEN
: Create a personal access token with appropriate permissions - For
DB_NAME
: Choose a meaningful name for your database
If you encounter any issues:
- Verify all environment variables are correctly set
- Ensure PostgreSQL is running and accessible
- Check if port 10000 is available
- Verify Go version compatibility
Instructions for contributing:
- First open the issue
- Solve the issue and open pull request
- Assign me as the reviewer