This repository contains the source code for the Data API Node.js server. It serves as the backend API using GraphQL and Rest endpoints.
Make sure you have Node.js (v20)
-
Clone the repository:
git clone https://github.com/Sergey-Nag/cms-data-api.git cd cms-data-api
-
Install project dependencies:
npm install
To start the server in production mode:
npm start
To start the server in production mode (without GraphiQl and Swagger documentation)
npm run start:local
To start the server in development mode (with documentation)
- http://localhost:4000/graphql - Graphiql playground and documentation
- http://localhost:4000/api-docs - REST API Swagger documentation
npm run start:dev
To start the server in development mode with nodemon (auto-restart on code changes): (It clears all sessions! You must re-authorize).
npm run dev
To run tests with Jest:
npm test
To run tests in watch mode:
npm run test:watch
This server application relies on several dependencies to provide its functionality. Key dependencies include:
- Express.js for building the API routes and handling HTTP requests.
- GraphQL for querying and manipulating data.
- Bcrypt for password hashing and security.
- JSON Web Tokens (JWT) for user authentication.
- Jest for testing and test coverage.