Table of Contents
- Frontend Repository: https://github.com/hoanglechau/meganote-frontend
- Backend Repository: https://github.com/hoanglechau/meganote-backend
- Deployed Frontend: https://meganote.vercel.app/
- Deployed Backend: https://meganote.up.railway.app/
Meganote is an app that aims to solve a problem that companies often have - how to manage employees' tasks efficiently.
This app acts like the traditional sticky note board system in which users stick notes that contain the tasks need to be done on a board and then proceed to complete them one-by-one.
Challenges: Designing logical schema models for the API, implementing authentication and authorization, designing an easy-to-use user interface, making the app responsive.
Features for the future: Making a mobile version of the app for iOS and Android.
- As a user, I can sign in with my username and password
- As a user, I can choose to stay signed in after refreshing the page
- As a user, I can edit my own username, full name, avatar, email, and password
- As a user, I can sign out from the system
- As an admin, I can view a list of all the notes in the system
- As an admin, I can edit the information of all existing notes
- As an admin, I can delete my own notes, and the notes of managers and employees, but I cannot delete the notes of other admins
- As an admin, I can create new notes and assign them to myself, other admins, and any users
- As an admin, I can view a list of all the users in the system
- As an admin, I can create new users with username, avatar URL, password, and role (admin, manager, or employee)
- As an admin, I can edit the information of all existing users
- As an admin, I can delete all users from the system
- As a manager, I can view a list of all the notes in the system except the notes of admins
- As a manager, I can edit the information of all existing notes except the notes of admins
- As a manager, I can delete my own notes, and the notes employees, but I cannot delete the notes of other managers. I cannot delete admins' notes
- As a manager, I can create new notes and assign them to myself, other managers, and employees. I cannot assign notes to admins
- As a manager, I can view a list of all the users in the system except admins
- As an employee, I can view a list of the notes assigned to me
- As an employee, I can edit the information of the notes currently assigned to me
- As an employee, I can create new notes and assign them to myself or other employees. I cannot assign notes to admins or managers
- Persistent login sessions for users
- Users can switch between dark and light modes
- Users can upload their own avatars from their computers (stored on Firebase)
- If users forgot their password, they can click "Forgot Password" and receive a password reset email with a reset token
- Whenever a user's account information or notes get updated, the app will send them a notification email
- Admins can search for users by their name or role
- Admins can choose to hide inactive users
- Users can search for notes by ticket number, title, or user's name
- Users can choose to hide completed notes
- Debounced search input
/**
* @route POST /auth
* @description Log in with username and password
* @body {username, passsword}
* @access Public
*/
/**
* @route POST /auth/register
* @description Register new user (for demo purposes only)
* @body {username, fullname, email, password, role}
* @access Public
*/
/**
* @route GET /users
* @description Get users with search query, filter, and paginations
* @query {page, limit, fullname, role, active}
* @access Private - only for Admins
*/
/**
* @route GET /users/all
* @description Get all users
* @access Private - only for Admins
*/
/**
* @route GET /users/:id
* @description Get a single user by their id
* @params {id}
* @access Private - only for Admins
*/
/**
* @route POST /users
* @description Create a new user
* @body {username, fullname, email, password, role}
* @access Private - only for Admins
*/
/**
* @route PATCH /users/:id
* @description Update an existing user
* @body {id, username, fullname, email, role, active}
* @access Private - only for Admins
*/
/**
* @route DELETE /users/:id
* @description Soft delete an existing user
* @params {id}
* @access Private - only for Admins
*/
/**
* @route GET /account/:id
* @description Get the currently logged-in user's account by their id
* @params {id}
* @access Private - for all users
*/
/**
* @route PATCH /account/:id
* @description Update the currently logged-in user's account settings
* @body {id, username, email, password}
* @access Private - for all users
*/
/**
* @route PUT /account/:id
* @description Update the currently logged-in user's profile
* @body {id, fullname, avatarUrl}
* @access Private - for all users
*/
/**
* @route GET /notes/all
* @description Get all notes
* @access Private - for all users
*/
/**
* @route GET /notes/
* @description Get notes with search query, filter, and paginations
* @query {page, limit, ticket, title, status}
* @access Private - for all users
*/
/**
* @route GET /notes/:id
* @description Get a single note by its id
* @params {id}
* @access Private - for all users
*/
/**
* @route POST /notes
* @description Create a new note
* @body {user, title, text, status}
* @access Private - for all users
*/
/**
* @route PATCH /notes/:id
* @description Update an existing note
* @body {id, user, title, text, status}
* @access Private - for all users
*/
/**
* @route DELETE /notes/:id
* @description Soft delete an existing note
* @params {id}
* @access Private - only for Admins and Managers
*/
- Check your version of Node.js and npm
node -v npm -v
- Install Node.js and npm if needed at https://nodejs.org/en/download
- Clone the repo
git clone https://github.com/hoanglechau/meganote-be-v2.git cd meganote-be-v2
- Install NPM packages
npm install
- Create an
.env
file with the following contentsMONGO_URI = your_mongodb_uri PORT = your_preferred_port // default: 5000 NODE_ENV = development ACCESS_TOKEN_SECRET = your_access_token_secret REFRESH_TOKEN_SECRET = your_refresh_token_secret EMAIL_SERVICE=your_email_service EMAIL_USERNAME=your_email_username EMAIL_PASSWORD=your_email_password EMAIL_FROM=your_email_address FRONTEND_URL=https://meganote-fe-v4.vercel.app
- Generate two different secret keys for
ACCESS_TOKEN_SECRET
andREFRESH_TOKEN_SECRET
using the built-incrypto
module ofnode
node require('crypto').randomBytes(64).toString('hex')
- Replace the default values with your own values for
PORT
(optional),MONGO_URI
,ACCESS_TOKEN_SECRET
,REFRESH_TOKEN_SECRET
,EMAIL_SERVICE
,EMAIL_USERNAME
,EMAIL_PASSWORD
,EMAIL_FROM
in the.env
file - Start the server
npm start
- Clone the repo
git clone https://github.com/hoanglechau/meganote-fe-v4.git cd meganote-fe-v4
- Install NPM packages
npm install
- Create an
.env
file with the following contentsVITE_NODE_ENV = development; VITE_API_URL = your_api_url; // default: http://localhost:5000 VITE_FIREBASE_API_KEY = your_firebase_api_key;
- Replace the value of
VITE_FIREBASE_API_KEY
with your own Firebase API Key. Optional: Replace the value ofVITE_API_URL
with the URL of your deployed API - Build the app
npm run build
- Run the app
npm run dev