This application retrieves the comics from the XKCD API, stores them in the database and then, displays the comics on UI.
This project is a fullstack web application built using Golang. The frontend is rendered using Go Templates, and the backend is powered by Go with SQLite3 as the database. The application retrieves and displays comics from the XKCD API.
- Retrieve and display XKCD comics on the UI.
- Store fetched comics in an SQLite3 database.
- Simple, clean UI generated using Go Templates.
- Delete comics from the UI and from the database.
- Backend: Golang
- Frontend: Go Templates
- Database: SQLite3
- External API: XKCD API
Before you begin, ensure you have the following installed on your system:
- Go (version 1.22.1 or higher)
Follow the steps below to set up the project locally.
git clone https://github.com/PatrickDiallo23/XKCD_Project.git
cd XKCD_Project
Install the necessary Go modules:
go mod tidy
Start the application using the Go command:
go run main.go
Note: This command will run the Terminal application where the comics are stored in memory and retrieved sequentially. You can run this application can be run using flags.
- To run in sequential mode
go run main.go -mode sequential
- To run in concurrent mode
go run main.go -mode concurrent
- To run the fullstack application (xkcd mode)
go run main.go -mode xkcd
The application will be accessible at http://localhost:8080.
- Visit http://localhost:8080 to see the latest XKCD comic.
- Use the navigation buttons to browse through previous comics.
- The comics are stored locally in the SQLite3 database after they are fetched from the XKCD API.
Contributions are welcome! Please follow the standard GitHub workflow:
- Fork the repository.
- Create a new branch.
- Make your changes.
- Submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.