This is the repository for a side project, SGLibReads, which is a free web app for Singapore residents to search, save and more easily view the availability of Singapore library books. If you are a heavy user of the Singapore libraries, consider giving this web app a try.
As of 2023, both the Singapore National Library Board’s (NLB) app and website are great and functional. However, I found it difficult to save and search for book availability on their app and website. Wanting an easier way to hunt down the library books, I hacked out a rudimentary technical solution for my own personal use. As the stars started to align and I learned more technical skills, thanks to NLB and the NLB Udemy Biz account no less, I realised I could develop a solution for the general Singapore public too. I hope to create value for the Singapore public, using skills I learned from public funds.
When I learned about the NLB public APIs, I realise I could use it for this side project. Unfortunately, the NLB API has so far provided a rather subpar developer experience (see my review here). Nonetheless, I do feel this is also a chance to start more conversations on how some of our government agencies are running their tech deployments. I know there are competent government agencies running excellent tech solutions for Singapore too, and I hope this side project can do its part to contribute to the further strengthening of the Singapore technical core. Those interested in this conversation can follow me on Medium, or add me on Linkedin.
This side project is also a way for me to continue to learn and apply more technical skills into a reasonably real-world setting. Some of the possible features I hope to learn and include into this web app includes:
- Availability of eBooks
- Linking to NLB Events from EventBrite
- Recommending books
The following section details the step it takes to start-up a local Supabase and FastAPI server for development purpose.
The Supabase CLI is required to manage the database schema and seed data. Please follow the instructions below:
-
Install Supabase CLI using the official guide in your local machine here.
-
Authenticate Supabase CLI with the following command:
supabase login
- Run supabase start to take note of the local Supabase URL and API Key.
supabase start
- Copy and Update the
.env
file with the Supabase API Key before beginning of any development.
-
Install
uv
in your local machine. Please follow the official guide for more information. -
Update
.env
file with APIKeys from.env.example
template.cp .env.example .env
-
Start-up Supabase server with supabase-cli and docker.
supabase start
-
Start-up FastAPI server with Uvicorn and hot-reloading for development purpose. This command will install create virtual environment in
.venv
and install all dependencies before starting the server.uv run -- uvicorn src.main:app --reload
This project uses ruff as Python code linter and formatter.
To integrate this seamlessly to your development workflow, we recommend using pre-commit to run the formatter and linter before commiting to the repo.
-
run
pre-commit install
to set up the git hook scripts$ pre-commit install pre-commit installed at .git/hooks/pre-commit
-
run
git commit
as usual to commit your changes.