Skip to content

nicnicknicky/todoapp-gin-astradb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Todo Backend with Gin and AstraDB

Implementation of DataStax BootCamp: Full Stack Apps with Cassandra in Go

Setup

  1. Create AstraDB Token to obtain Client_ID and Client_Secret
  2. Create AstraDB instance
  3. Download the Secure Connect Bundle
  4. Create .env from .env.sample
  5. Using the CQL Console, create the required keyspace and tables
  6. go run main.go

API Endpoints

Verified against TodoBackEnd Specs

/todos

  • GET Retrieve complete list of all todos
  • POST Create a todo
  • DELETE Delete all todos

/todos/:id

  • GET Get a todo
  • DELETE Delete a todo
  • PATCH Modify a todo

Models

Setup via CQL Console

CREATE TABLE todos.todoitems (
    user_id text,
    item_id timeuuid,
    title text,
    url text,
    completed boolean,
    offset int,
    PRIMARY KEY ((user_id), item_id)
) WITH CLUSTERING ORDER BY (item_id ASC);

References

AstraDB

DataStax AstraDB
EasyCass

Gin

Gin Web Framework Docs
Gin PKG Docs
Gin Github
Go Tutorial: Gin

Cassandra

GoCQL
GoCQLx
ScyllaDB Blog: Using GoCQLx

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages