Skip to main content

Todo Application

Github StackBlitz

image

This Todo application is a full-stack project built using Sveltekit, Tailwind CSS, Fiber, Entgo, and SQLite. It showcases the construction of a monolithic architecture for a full-stack application.

Run the Project

To run the project, follow these steps:

  1. Execute the following command to run all the necessary commands for building and running the application:
go run ./bin all
  1. Once the build process is complete, you can start the application by running:
./app

Available Commands

The following commands are available to manage the project:

CommandDescription
go-runRun the Golang project.
go-buildBuild the Golang project.
go-testRun tests for the Golang project.
svelte-runRun the SvelteKit project.
svelte-buildBuild the SvelteKit project.
generate-entGenerate entity files.
allRun all commands (generate-ent, svelte-build, go-test, go-build).

Usage

To use this application, run the following command:

go run ./bin <command>

API Routes

The Go Fiber application provides the following API routes:

MethodEndpointHandler FunctionDescription
GET/api/v1/todo/listtodoHandler.GetAllTodosGet a list of all todos
GET/api/v1/todo/get/:idtodoHandler.GetTodoByIDGet a specific todo by its ID
POST/api/v1/todo/createtodoHandler.CreateTodoCreate a new todo
PUT/api/v1/todo/update/:idtodoHandler.UpdateTodoByIDUpdate an existing todo by its ID
DELETE/api/v1/todo/delete/:idtodoHandler.DeleteTodoByIDDelete a todo by its ID

Go Dependencies

  • Go Modules: Go's built-in package manager used to manage dependencies for Go projects.
  • Entgo: A Golang Object Relational Mapping (ORM) tool used to define and generate database schemas.
  • Fiber: A fast and minimalist web framework for Golang.
  • Sqlite: A small, lightweight, embedded SQL database engine.

Npm Dependencies

  • SvelteKit: A JavaScript framework used to build modern web applications.
  • Tailwind CSS: A fast and customizable CSS styling library. Can be used in SvelteKit projects.

Author: @ugurkorkmaz