.Kepler - Task Tracking Management App is designed to help users register, log in, manage their profiles, and track tasks efficiently in each app in your organization. It is built using Node.js, Express.js, MongoDB, and JWT for authentication. The application provides a RESTful API to handle users and task-related actions.
-
User Authentication:
- Register new users.
- Login users with JWT-based authentication.
- Logout users and invalidate sessions.
- Change password for authenticated users.
- Update profile for authenticated users.
-
Manage projects:
-
Manage human resources:
- Backend: Node.js, Express.js
- Database: MongoDB with Mongoose ODM
- Authentication: JWT (JSON Web Tokens)
- Middleware: Express Middleware (Authentication, CORS, Logging)
- Logging: Morgan for HTTP request logging
- Validation: Joi for request data validation
- Environment Variables: Managed using Dotenv
Make sure you have the following installed:
- Clone the repository:
git clone --depth 1 https://github.com/Khanhhungtran23/.Kepler-Task-Tracking-App-Server.git cd .Kepler-Task-Tracking-App-Server
- Install dependencies:
npm install or npm i
- Set up environment variables:
create an .env file
- Run the application:
- Run locally:
npm run dev
- Run in production:
npm run start
- Commit changes:
git acpt "message"
- Testing:
# Run all tests npm run test # run TypeScript tests npm run test:ts # run JS tests npm run test:js # run all tests in watch mode npm run test:watch # run test coverage npm run coverage
- Linting:
# run ESLint npm run lint # fix ESLint errors npm run lint:fix # run prettier npm run prettier # fix prettier errors npm run prettier:fix
- The application will start running on http://localhost:3000.
- API Endpoints:
Link swagger: https://kepler.up.railway.app/api-docs/
- Permanent Tokens Account:
- Description: This provides details about two fixed test accounts (Admin and User) with permanent tokens. Tokens are generated using a script and do not expire.
email: dev@gmail.com
password: 123456
role: admin
permanentToken: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NzJmNTQ4N2Q0ZWExMTczZTg5ZWQxNDAiLCJpc0FkbWluIjp0cnVlLCJpYXQiOjE3MzE3Njc2OTN9.7ZoSP8-vJgvf7bX3PmZaohNfv2JwoSksHdxkMtgOxMc
email: tester@gmail.com
password: 123456
role: user
permanentToken: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NzM4YTdlOGNlNjAzOTIyN2Q5Y2FiYmMiLCJpc0FkbWluIjpmYWxzZSwiaWF0IjoxNzMxNzY3NjkzfQ.EqYf8Mw--t-2Lx5Kyrle1a0FQvtf_-NWFrT1FBW7qvA
- Config Husky: npx husky install
- Tạo Git Hook với Husky : npx husky add .husky/pre-commit "npm test"
- pre-push: Hook này chạy trước khi bạn push code lên remote repository. Để thêm hook này: npx husky add .husky/pre-push "npm run test"
- Run command :
git add .
git commit -m "Test commit"
Add the following settings to your .vscode/settings.json
:
{
"testing.openTesting": "neverOpen",
"jest.runMode": "on-demand",
"jest.outputConfig": {
"revealOn": "run",
"revealWithFocus": "none",
"clearOnRun": "none"
}
}