To run the GraphQL API locally, follow these steps:
-
Clone the repository:
git clone https://github.com/AyoubKaz07/b464-back.git
-
Install dependencies
npm install
For local development, you should setup a local instance of the database
- Install MongoDB
npm install mongodb
- Add your connection string into your application code (from MongoDB Atlas) in
.env
mongodb+srv://username:<password>@ProjectsName.6dirvkv.mongodb.net/?retryWrites=true&w=majority
- Install Redis
- Install Redis by following the instructions provided on the official Redis website
- Start the Redis server locally. The default port is 6379.
- In Command line
redis-server
- To use the NewsLetter feature, you should get from Google API
EMAIL_FROM - EMAIL_USERNAME - EMAIL_PASSWORD
- Run
npm run dev
- Access the GraphQL endpoint in your browser or using a tool like GraphQL Playground http://localhost:3000/graphql
The GraphQL API documentation is automatically generated using SpectaQL, providing a comprehensive overview of available queries, mutations, and data models.
You can access the generated documentation by visiting the GitHub Pages for GraphQL API Docs.