an upcoming CMS backend system created using Typescript, NodeJs, MySQL.
- Introduction
- Getting Started
- Technology Stack
- Authentication and Authorization
- API Reference
- Database Diagram
The CMS System is a powerful content management system that enables users to manage job listings, educational institutions, user profiles, and social interactions. It provides a robust platform for companies, educational institutions, and users to connect and engage in a seamless manner.
To set up the CMS System, follow these steps:
- Clone the project repository from GitHub.
- Install the required dependencies using
npm install
. - Configure the environment variables by creating a
.env
file. - Set up the database connection by configuring the
sequelize.config.js
file.
To run the CMS System locally, use the following command:
npm run dev
The CMS System utilizes Sequelize migrations for managing the database schema. To run the migrations, use the following command:
npm run db:migrate
The CMS System relies on environment variables for configuration. Ensure that you have a .env
file in the project root directory and specify the required variables.
DATABASE_NAME = ""
DATABASE_PASSWORD = ""
DATABASE_HOST = ""
DATABASE_USER = ""
DATABASE_DRIVER = ""
PORT =
DATABASE_PORT =
SALT_ROUNDS =
TOKEN_SECRET = ""
The CMS System is built using the following technologies:
- Node.js
- Express.js
- Sequelize (ORM)
- MySQL (Database)
The authentication system relies on JWT (JSON Web Tokens) for secure and stateless authentication. Users receive a JWT upon login, which they include in their requests authorization header to access protected resources. The JWT is verified by the authentication/authorization middleware to ensure the user's identity and authorization.
his middleware is responsible for verifying the validity and authenticity of an access token provided by the client. It checks if the access token is properly signed and has not expired.
This middleware validates the access token and extracts the relevant user information from it. It ensures that the access token is valid and associated with an existing user.
It checks if the authenticated user has administrative privileges. 4. #### checkOwnership: This middleware is used to verify the ownership of a resource, such as a post. It ensures that only the user who owns the post has permission to delete or edit it.
For the API Documentation, Enter the following url in your browser: http://localhost:{your_port}/api-docs to interact with the APIs within your browser.
b. Model Definitions: