Skip to content

guillaC/NotePrivee

Repository files navigation

NotePrivée

Features

  • Self destructing notes
  • AES256 encryption
  • Expiration times
  • Markdown support, syntax highlighting
  • Admin Panel
  • API

Screenshots

screenshot screenshot image

Configuration

Database

CREATE TABLE `notes` (
  `id` int(11) NOT NULL,
  `contenu` text NOT NULL,
  `nombre_vue` int(11) NOT NULL,
  `date_creation` datetime NOT NULL DEFAULT current_timestamp(),
  `date_expiration` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

CREATE TABLE `users` (
  `Id` int(11) NOT NULL,
  `Username` varchar(50) NOT NULL,
  `Password` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


INSERT INTO `users` (`Id`, `Username`, `Password`) VALUES(1, 'admin', 'd033e22ae348aeb5660fc2140aec35850c4da997'); -- admin/admin
ALTER TABLE `notes` ADD PRIMARY KEY (`id`);
ALTER TABLE `users` ADD PRIMARY KEY (`Id`);
ALTER TABLE `notes` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=48;
ALTER TABLE `users`
  MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;
COMMIT;

API

Create one note

Request

curl -X POST "https://localhost:5001/api/Notes" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"contenu\": \"hey\", \"nombreVue\": 1, \"dateExpiration\": \"2021-02-20T17:35:12.035Z\"}"

{
  "contenu": "hey",
  "nombreVue": 1,
  "dateExpiration": "2021-02-20T17:35:12.035Z"
}

Response

{
  "id": "49",
  "key": "1eccea57eae34e7c8a418347da4d2a"
}

Read one note

Request

curl -X GET "https://localhost:5001/api/Notes?id=49&key=1eccea57eae34e7c8a418347da4d2a" -H "accept: text/plain" https://localhost:5001/api/Notes?id=49&key=1eccea57eae34e7c8a418347da4d2a

Parameters
  • id - integer
  • key - string

Response

{
  "contenu": "hey",
  "nombreVue": 1,
  "dateExpiration": "2022-02-20T17:35:12"
}

Tests

Tests are located in "NotePrivee.Test" directory. They are developed with XUnit Framework.

Authors

Guillaume, Gaëtan, Adrien

Built With