A simple RESTful API to manage products in a store. It's a containerized app built with Typescript, Express.js and MongoDB and other libraries such JWT for authentication, Zod for input validation.
- User registration and login with JWT authentication
- User logout
- User profile retrieval
- Product management with CRUD operations
- Protected product route
- Node.js - JavaScript runtime environment
- TypeScript - Typed superset of JavaScript
- Express.js - Web framework
- MongoDB - NoSQL database for user data storage
- JWT - For token-based authentication
- bcrypt - Password hashing
- Zod - Input validation
- Jest - For unit testing
- Docker - Containerization
- Clone this repository to your local machine:
git clone https://github.com/oneharry/store-app.git
cd store-app-
Install NPM packages
npm install
-
Enter the MongoDB variable in an
.envfileMONGODB_USERNAME="your username" MONGODB_USER_PASSWORD="user pass" MONGODB_DATABASE="db name" MONGODB_CLUSTER="cluster name" JWT_SECRET="your jwt secret key" -
Start the app
npm run dev
Or run in the container
docker-compose up
See the complete usage [Documentation](https://documenter.getpostman.com/view/16000236/2sAYX2N4VW)
- Run unit test
npm test
You can contribute to the project
- Fork the repository.
- Create a new branch (git checkout -b feature/feature-name).
- Commit your changes (git commit -am 'Add new feature').
- Push your branch (git push origin feature/feature-name).
- Open a pull request.
Please add tests for new functionalities.