Skip to content

tam-sal/notes_management

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Notes@v1

Project Overview

Full-stack application with Go backend and React.js frontend. Includes authentication, note management, and filtering.

Requirements

Backend

  • Go v1.23.0
  • PostgreSQL v16.3
  • Prometheus v3.2.1

Frontend

  • Node.js v22.13.1
  • npm v10.9.2

Running the Project Locally

  1. Clone repository
  2. Navigate to root-directory where run-project.sh appears.
  3. Run the project chmod +x run-project.sh && ./run-project.sh
  4. Fornt End expected local url http://localhost:5173
  5. Back End expected local url http://localhost:8025

Deployed Version

Live URL: https://note-it-quick.vercel.app/

  • Backend: AWS EC2
  • Frontend: Vercel

Preset Credentials

Username: superuser
Password: superuser

API Documentation

Swagger: SWAGGER DOCS

Metrics

Prometheus: PROMETHEUS LIVE MERICS SCRAPPING
Grafana: GRAFANA LIVE METRICS GRAPHING
Grafana CREDENTIALS AND DASHBOARD DIRECT ACCESS:

  • Credentials: user: admin | password: notes
  • Dashboard: NOTES_APP

Postman Collection

NOTES_POSTMAN_COLELCTION

App Technologies and Features

Backend

  • Language & Framework: Golang | Gorilla Mux
  • Database: PostgreSQL with GORM
  • Architecture: Follows a layered architecture similar to a Spring Boot project, with Repository, Service, and Handlers (Controllers) layers
  • Authentication: JWT-based authentication, with tokens sent via cookies
  • Middleware: Custom middleware for request validation, authentication, and route protection
  • Rate Limiting: Implements a rate limiter middleware to prevent abuse
  • Logging: Access logging with Go-coded feature for better tracking
  • Metrics: Built-in metrics using Go along with Prometheus, both are consumed by Grafana for live graphing
  • Response Structure: Consistent structured response across the application
  • API Documentation: Swagger for API documentation

Frontend

  • Library & Framework: React with Vite, deployed on Vercel and synced via git push
  • Styling: Tailwind CSS with DaisyUI preset
  • State Management: React Context API
  • Notifications: Toast notifications using react-hot-toast
  • Theme & Responsiveness: Responsive design with dark and light mode, utilizing standard dark/light themes

Deployment

  • EC2: Backend is fully deployed on AWS EC2 t2.micro free tier Linux AMI instance with setup of security group and role.
  • Elastic IP: Secured static public IP avioding rotation
  • Containerization: Dockerized backend and services
  • Orchestration: Docker Compose for managing multi-container setup and resource consuption of each service
  • Persistence:
    • PostgreSQL data stored in a named Docker volume (postgres-data)
    • Prometheus data persisted in a bind mount (./backend/deploy/prometheus-data directory)
    • Grafana data persisted in a bind mount (./backend/deploy/grafana-data directory)
  • HTTP to HTTPS Redirection / SSL-TLS Termination:
  • Automation:
    • EC2 instance has an automated script that runs docker-compose up -d on machine restart, ensuring all services restart automatically

Documentation and Monitoring

Swagger

Image

Prometheus

Image

Grafana

Image Image Image

User Story

  1. Sign Up or Log In
    πŸ” Create an account or sign in to access your notes.

  2. Create & Manage Notes

    • ✏️ Add: Write notes with titles and content.
    • πŸ“ Edit/Delete: Update or remove notes anytime.
  3. Organize with Categories
    🏷️ Assign labels (e.g., Work, Personal) for quick filtering.

  4. Archive/Unarchive
    πŸ“‚ Toggle notes between active and archived states.

  5. Filter Notes
    πŸ” Search by:

    • Status (Active/Archived)
    • Categories
    • Status and Categories at the same time

Application Flow

Log in or Register
Image

Create
Image

List and access notes' functionalities
Image

Advanced Filters
Image Image

BACKEND STRUCTURE

backend
β”œβ”€β”€ cmd/
β”‚   └── api/
β”‚       β”œβ”€β”€ main.go
β”‚       β”œβ”€β”€ routes.go
β”‚       β”œβ”€β”€ server.go
β”‚       └── docs/
β”‚           β”œβ”€β”€ docs.go
β”‚           β”œβ”€β”€ swagger.json
β”‚           └── swagger.yaml
β”‚
β”œβ”€β”€ deploy/
β”‚   β”œβ”€β”€ prometheus.yml
β”‚   β”œβ”€β”€ grafana-config/
β”‚   β”‚   └── grafana.ini
β”‚   β”œβ”€β”€ grafana-data/          
β”‚   └── prometheus-data/       
β”‚
β”œβ”€β”€ internal/
β”‚   β”œβ”€β”€ api/
β”‚   β”‚   └── handlers/
β”‚   β”‚       β”œβ”€β”€ categories.go
β”‚   β”‚       β”œβ”€β”€ errors.go
β”‚   β”‚       β”œβ”€β”€ handlers.go
β”‚   β”‚       β”œβ”€β”€ middlewares.go
β”‚   β”‚       β”œβ”€β”€ notes.go
β”‚   β”‚       β”œβ”€β”€ ratelimiter.go
β”‚   β”‚       β”œβ”€β”€ types.go
β”‚   β”‚       β”œβ”€β”€ user.go
β”‚   β”‚       └── metrics/
β”‚   β”‚           └── prometheus.go
β”‚   β”œβ”€β”€ configs/
β”‚   β”‚   └── configs.go
β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”œβ”€β”€ category.go
β”‚   β”‚   β”œβ”€β”€ note.go
β”‚   β”‚   └── user.go
β”‚   β”œβ”€β”€ repositories/
β”‚   β”‚   β”œβ”€β”€ category.go
β”‚   β”‚   β”œβ”€β”€ interface.go
β”‚   β”‚   β”œβ”€β”€ note.go
β”‚   β”‚   └── user.go
β”‚   └── services/
β”‚       β”œβ”€β”€ category.go
β”‚       β”œβ”€β”€ note.go
β”‚       └── user.go
β”‚
β”œβ”€β”€ pkg/
β”‚   β”œβ”€β”€ date/
β”‚   β”‚   └── date.go
β”‚   β”œβ”€β”€ request/
β”‚   β”‚   └── json.go
β”‚   β”œβ”€β”€ response/
β”‚   β”‚   β”œβ”€β”€ json.go
β”‚   β”‚   └── metrics.go
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”œβ”€β”€ auth.go
β”‚   β”‚   └── helpers.go
β”‚   └── validations/
β”‚       └── errors.go
β”‚
β”œβ”€β”€ scripts/
β”‚   └── aws-scripts/
β”‚       β”œβ”€β”€ docker-compose-app.service
β”‚       └── info.md
β”‚
β”œβ”€β”€ .env
β”œβ”€β”€ .env.local
β”œβ”€β”€ docker-compose.yml
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ go.mod
β”œβ”€β”€ go.sum
└── package-lock.json

FRONTEND STRUCTURE

frontend
β”œβ”€β”€ public/
β”‚   └── logo.png
β”‚
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ App.css
β”‚   β”œβ”€β”€ App.jsx
β”‚   β”œβ”€β”€ index.css
β”‚   β”œβ”€β”€ main.jsx
β”‚   β”‚
β”‚   β”œβ”€β”€ assets/
β”‚   β”‚   β”œβ”€β”€ bg-brown-1.png
β”‚   β”‚   β”œβ”€β”€ bg-brown.png
β”‚   β”‚   β”œβ”€β”€ bg-transparent.png
β”‚   β”‚   β”œβ”€β”€ bg.png
β”‚   β”‚   β”œβ”€β”€ logo.png
β”‚   β”‚   β”œβ”€β”€ logo_aux.png
β”‚   β”‚   β”œβ”€β”€ notes-2bg.jpg
β”‚   β”‚   β”œβ”€β”€ notes-bg.jpg
β”‚   β”‚   └── react.svg
β”‚   β”‚
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ toggle-theme.jsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ Fallback/
β”‚   β”‚   β”‚   └── Fallback.jsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ Footer/
β”‚   β”‚   β”‚   └── Footer.jsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ GetStarted/
β”‚   β”‚   β”‚   └── Register.jsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ Header/
β”‚   β”‚   β”‚   β”œβ”€β”€ Header.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ LogoTitle.jsx
β”‚   β”‚   β”‚   └── NavBar.jsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ Landing.jsx/
β”‚   β”‚   β”‚   └── Landing.jsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ Loader/
β”‚   β”‚   β”‚   └── Loader.jsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ Login/
β”‚   β”‚   β”‚   └── Login.jsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ Note/
β”‚   β”‚   β”‚   β”œβ”€β”€ CreateNote.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Note.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Notes.jsx
β”‚   β”‚   β”‚   └── UpdateNote.jsx
β”‚   β”‚   β”‚
β”‚   β”‚   └── Protect/
β”‚   β”‚       └── ProtectedRoute.jsx
β”‚   β”‚
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   └── axios.jsx
β”‚   β”‚
β”‚   └── context/
β”‚       β”œβ”€β”€ AuthContext.jsx
β”‚       β”œβ”€β”€ ThemeContext.jsx
β”‚       └── toast-utils.jsx
β”‚
β”œβ”€β”€ .env
β”œβ”€β”€ eslint.config.js
β”œβ”€β”€ index.html
β”œβ”€β”€ package-lock.json
β”œβ”€β”€ package.json
β”œβ”€β”€ postcss.config.js
β”œβ”€β”€ tailwind.config.js
└── vite.config.js

About

Full Stack APP - Golang/GORM/POSTGRESQL/React - AWS - Docker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages