Skip to content

nabilasherif/Secret-noteAPI-SPA-NabilaSherif

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Secret-noteAPI-SPA-NabilaSherif

A full-stack web application that allows users to securely share secret notes. The application features a Go backend using the Gin framework, a Vue.js frontend, and an SQLite database.

Features

  • Users can create an account, login and logout.
  • After logging in, user can create note and view his/her notes without incrementing the views.
  • Secret notes are created with a user-defined expiration time and a maximum view limit.
  • Notes are permanently deleted after either the expiration time is reached or the maximum view count is exceeded.
  • Note views gets incremented when accessing the note via its automatically generated url.
  • A 404 error page is displayed when attempting to access a deleted note or any oother unrecognized url.
  • Rate limiting is applied to prevent abuse

Major Frameworks and Libraries

API Endpoints

  • POST /note: Creates a new note. Requires authorization.
  • GET /note/:note_url: Retrieves a note by URL.
  • POST /users: Creates a new user.
  • POST /login: Logs in a user.
  • GET /notes: Retrieves all notes for the logged-in user. Requires authorization.
  • POST /logout: Logs out the user. Requires authorization.

commands to run front-end

cd frontend
npm run dev

example commands to run back-end

cd backend
go run cmd/main.go -p 8080 -d test.db

on the browser navigate to this url

http://localhost:8080/

docker build and run backend

docker build -t backend -f backend/Dockerfile backend
docker run -p 8080:8080 backend

docker build and run frontend

docker build -t frontend -f frontend/Dockerfile frontend
docker run -p 5173:5173 frontend

build and run docker compose

docker-compose up --build

run docker compose

sudo dockerd &
docker compose up

stop docker compose

docker-compose down

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 45.7%
  • Vue 32.0%
  • TypeScript 14.8%
  • CSS 4.8%
  • Dockerfile 1.4%
  • HTML 1.3%