pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/tompston/go-rest-api-example

ea1e66.css" /> GitHub - tompston/go-rest-api-example: Full-stack example, using JWT, SQLC, Cursor Pagination, Vue 3 and Tailwind · GitHub
Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Full-Stack app for creating transactions

vid.mp4
  • Backend
    • Golang, Chi Framework
    • JWT for authentication
    • Rate limiting for registration endpoint
    • Payload validation using validate package
    • Cursor Pagination for Users and Transactions endpoints (using uuids and created_at values)
    • SQLC for getting the data, dbmate for managing migrations.
    • If you want to preview the backend endpoints, just copy gomarvin.json content in the editor (Settings -> Import Tab)
  • Frontend
    • Vue 3 + Vite + Tailwind.
    • Registration and Login views
      • Field validation errors are returned from the database
      • Custom Login error messages if the user does not exist or the password is incorrect
    • Home view is guarded by authentication check. If the user has an invalid token, that route is not accessible.
  • Other
    • Deno and Faker used for seeding the database (using the generated gomarvin client
    • Backend code baseline and frontend fetch functions generated with gomarvin.

DISCLAIMER

A lot of parts are rough around the edges and can be improved to avoid code duplication.

  • JWT Auth flow in the frontend is lacking
    • access_token expiration is 15mins, no flow for re-authentication
  • DB tables can be improved
  • There are endpoints which don't execute any queries.
  • Frontend is as minimal as possible
    • No loading states while fetching the data

Setup

  • Use the db dump to create the db schemas and rows.
  • Edit /backend/.env if needed
# run backend
cd backend
go mod tidy
go mod download
go run main.go

# run frontend
cd frontend
npm i
npm run dev

Other

# seeder (using deno with faker)
deno run --allow-net ./seeder.ts

# dump database info for test_db
sudo pg_dump -U postgres test_db > ./dump.sql

About

Full-stack example, using JWT, SQLC, Cursor Pagination, Vue 3 and Tailwind

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy