.
├── bin # express.js app
├── server # di and middlewares are set up
├── .env # env varibles
├── .eslintrc.js # ESlint config file
├── .babelrc.js # Babel config file
├── .gitignore # .gitignore file
├── .travis.yml # Travis CI config file
├── package.json
├── package-lock.json
├── README.md # <-- you are here
└── app.js # the nodejs server
- Install all packages:
npm install
- Create Database (PostgresQL):
createdb notes_test
- Run
npm run test
- Create Database (PostreSQL):
createdb notes_dev
- Run DB migrations using Sequelize:
sequelize db:migrate
- Run Redis server for caching
sudo redis-server /etc/redis/redis.conf --port 6379
- Run
npm start:dev
- Registration
- Route: /api/user/signup
- Method: POST
- Data params: username, password
- Auth required : No
- Response: user object, token
- Login
- Route: /api/user/login
- Method: POST
- Data params: username, password
- Auth required : No
- Response: user object, token
- Logout
- Route: /api/user/logout
- Method: POST
- Auth required : Yes
- Create Note
- Route: /api/note/create
- Method: POST
- Data params: title, text
- Auth required : Yes
- Response: note object
- Get all user notes
- Route: /api/note/
- Method: GET
- Auth required : Yes
- Response: list of note objects
- Edit Note
- Route: /api/note/edit/:id
- Method: PUT
- Path param: id
- Data params: title, text
- Auth required : Yes
- Response: note object
- Delete Note
- Route: /api/note/delete/:id
- Method: DELETE
- Path param: id
- Auth required : Yes
- Create sharable link
- Route: /api/note/share/:id
- Method: GET
- Path param: id
- Auth required : Yes
- Response: link
- View the Note by sharable link
- Route: /api/note/:shared_token [included into sharable link]
- Method: GET
- Path param: shared_token
- Auth required : No
- Response: note object
Postman Collection with all request examples are at the top of README.md