Blog
Development
- Frontend: Typescript (Next.js)
- Backend: Go (gqlgen)
- Database: PostgreSQL
Despite Next.js being a full-stack framework, I still decided to adopt a separate front-end and back-end architecture for this blog project. I believe that this separation makes the project cleaner, reduces coupling, and aligns with modern development practices. Furthermore, I wanted to practice developing a purely back-end API.
As for the more detailed development approach, I plan to use Clean Architecture for the overall structure and ATDD for testing. Of course, such a small project may not necessarily require such complex design patterns, but I want to give myself an opportunity to practice them.
These will allow me to become more proficient in these modern development practices and leave a lot of flexibility and room for adjustments in the future.
Environment
Database Instance
Using docker to run a database instance.
podman run -d -p 127.0.0.1:5432:5432 -e POSTGRES_HOST_AUTH_METHOD=trust --rm --name postgres --replace postgres:alpine
For more infomation, please refer to PostgreSQL Docker Hub.
Database Migration
Using golang-migrate to manage database migration.
-
Create a new migration file
migrate create -ext sql -dir backend/internal/framework/db/postgres/migration -seq migration
-
Run migration
migrate -path db/migrations -database "postgresql://postgres@localhost:5432/postgres?sslmode=disable" up
For more information, please refer to golang-migrate GitHub.
License
This project uses a combination of the MIT License and a custom license. Based on the MIT License, anyone is permitted to use the code. However, before deploying the code, they must first replace any information belonging to "me" or any content that could identify "me," such as logos, names, and "about me" sections.