OpenFabricAPI is a RESTful API built with TypeScript, Express, and MongoDB, designed to provide a scalable and modular structure for developing APIs with a focus on maintainability and reusability.
- TypeScript for static typing and better development experience
- Express for handling HTTP requests and responses
- MongoDB with Mongoose for schema-based data modeling
- JWT authentication and middleware for secure endpoints
- Error handling and validation using Joi validators
- Rate limiting to prevent abuse
- Pagination for large data sets
- Caching using Redis
- API documentation with Swagger
- Logging using Winston
- Pagination support
- Security best practices with Helmet
- Swagger for API documentation
- Environment-based configuration
- express
- mongoose
- joi
- jsonwebtoken
- helmet
- cors
- express-rate-limit
- winston
- swagger-ui-express
- swagger-jsdoc
src
- Contains the main source code for the APIcomponents
- Contains the different components (or modules) of the API, such as products and usersproducts
- Contains the products component, split into multiple versionsv1
- Contains version 1 of the products componentdata
- Contains the data layer, including models, repositories, and interfacesservices
- Contains the business logic for the products componentweb
- Contains the web layer, including controllers, routes, and validators
auth
- Contains the users component, split into multiple versionsv1
- Contains version 1 of the users componentdata
- Contains the data layer, including models, repositories, and interfacesservices
- Contains the business logic for the users componentweb
- Contains the web layer, including controllers, routes, and validators
config
- Contains configuration files for various parts of the APIhelpers
- Contains helper functions for common tasksinterfaces
- Contains shared interfaces for the APImiddleware
- Contains middleware functions for the APIrepositories
- Contains base repository classes and interfacesutils
- Contains utility functions for the APIapp.ts
- Contains the main Express app setupindex.ts
- Contains the entry point for the APIserver.ts
- Contains the HTTP server setup
bin
- Contains the executable script for starting the server.env
- Contains environment variables.gitignore
- Contains a list of files and directories to be ignored by gitpackage.json
- Contains the project's dependencies and scriptstsconfig.json
- Contains the TypeScript configuration for the projectREADME.md
- Contains the documentation for the project
- Clone the repository and navigate to the project root directory.
- Run
npm install
to install the dependencies. - Create a
.env
file with the required environment variables. - Run
npm run dev
to start the development server.
Please read the contributing guidelines for the project before making any changes or submitting pull requests.
- Ephrem Bayru
- Email: [email protected]