Link to the website: blog.alexfangsw.com
A opportunity to practice GO while creating something I could use.
This project started around when GO 1.22 was released.
At that time I was choosing which framework or libraries I sould use.
In the release notes, one thing caught my eye:
Enhanced routing patterns.
This improved net/http.ServeMux
quite a lot, adding features such as path params, restrict methods to routes...etc.
After seeing this plus a video on YouTube by Dreams of Code: The standard library now has all you need for advanced routing in Go, I thought, 'why not give the standard library a try ?' After than, this project was created.
I enjoy using my own editor, and I also want to seperate my content from the source code.
- Deploy the server, and create a user with UserRegister CLI tool.
- Write blogs, organize it like dummyData directory and store it in a separate repository.
- When pushed, it triggers a CI/CD pipeline that uses SyncTool to sync data to the server.
This project is separated into frontend, backend and CLI tools for me to sync my data to the server.
.
├── backend <--- Backend and CLI tools are both in this folder
├── frontend
└── README.md
This part is mostly made with the GO standard library, not just routing, but also database related stuff.
- Language: GO
- Server: net/http ( Routing is done with
net/http.ServeMux
) - ORM: None, this project uses
database/sql
with raw SQL queries. - Database: SQLite
- Database Migration: goose
- API documentation: generated with swaggo
For more documentation on the backend, please refer to the backend directory.
Inspired by Stack Overflow's URL design, slug is shown at the end of the url.
Ex:
https://<domain>/blogs/<id>/<slug>
https://notes.alexfangsw.com/blogs/1/a-dummy-blog-post
- Language: Javascript
- Framework: NextJS
- UI Libraries:
- UserRegister
- SyncTool
Documentation are at CLI tools section.