A RESTful API for managing users, addresses, and posts built with Node.js, TypeScript, Express, and SQLite with Sequelize ORM.
Access the deployed API at https://user-mgt-sys-el0o.onrender.com
- RESTful API endpoints for users, addresses, and posts
- TypeScript for type safety and better developer experience
- Sequelize ORM for database interactions
- SQLite database for development and testing
- Winston logger for logging
- Robust error handling and validation
- Comprehensive test suite
- Node.js
- TypeScript
- Express.js
- SQLite
- Sequelize ORM
- Winston Logger
- Express Validator
GET /users- Returns a paginated list of usersGET /users/count- Returns the total number of usersGET /users/{id}- Returns details of a specific user, including their addressPOST /users- Creates a new user
GET /addresses?userId={userId}- Returns the address associated with a userPOST /addresses- Creates an address for a userPATCH /addresses/{userID}- Modifies the address associated with a user
GET /posts?userId={userId}- Returns all posts for a specific userPOST /posts- Creates a new post for a userDELETE /posts/{id}- Deletes a post by its ID
- Node.js (v14 or higher)
- npm or yarn
-
Clone the repository:
git clone https://github.com/johnayinde/user-management-system.git cd user-management-system -
Install dependencies:
yarn install
-
Create a
.envfile in the root directory:NODE_ENV=development PORT=3000 -
Start the development server:
npm run dev # or yarn dev
npm run build
# or
yarn buildnpm start
# or
yarn startRun all tests:
npm test
# or
yarn testRun specific test suites:
npm run test:user
npm run test:address
npm run test:post
# or
yarn test:user
yarn test:address
yarn test:postGenerate test coverage:
npm run test:coverage
# or
yarn test:coverage