BlogExpressGraphQLTS is a TypeScript-based project for creating a feature-rich blog using Express.js and GraphQL, without relying on NestJS. This project aims to provide a flexible and powerful backend solution for managing a blog application through GraphQL queries and mutations.
- GraphQL API: Utilize the power of GraphQL to efficiently query and manipulate data according to your application's needs.
- Express.js: Built on top of Express.js, allowing you to have fine-grained control over your server configuration and middleware setup.
- Type-graph : it is a Modern framework for GraphQL API in Node.js to build schemas more flexible
- Apollo Server : Build a production-ready GraphQL API in Node.js. Fetch and combine results from multiple data sources.
- Full-Featured Blog: Implement a comprehensive set of features for a fully functional blog, including creating, updating, and deleting blog posts, user authentication, comments, tags, and more.
- TypeScript: Leverage TypeScript's static typing to enhance code quality, maintainability, and development experience.
Follow these steps to set up and run the BlogExpressGraphQLTS project on your local machine.
Make sure you have the following installed:
- Node.js (v14 or higher)
- npm (Node Package Manager)
Clone the repository:
git clone https://github.com/BaseMax/BlogExpressGraphQLTS.git
Navigate to the project directory:
cd BlogExpressGraphQLTS
Install dependencies:
npm install
Rename the .env.example
file to .env
in the root directory.
Open the .env file and configure the environment variables:
DATABASE_URI=mongodb://localhost/blog-express-graphql # MongoDB connection URI
SECRET_KEY=your-secret-key # Secret key for JWT authentication
Start the server using the following command:
$ tsc
$ npm run dev
The server should now be running at http://localhost:4000
. You can access the GraphQL playground at http://localhost:4000/graphql
to interact with the API and explore available queries and mutations.
The GraphQL schema and resolvers define the available queries and mutations for the blog application. You can refer to the schema and resolver files in the src/graphql directory to understand the available functionality and customize them according to your needs.
Contributions are welcome! If you find any issues or want to add new features, feel free to submit a pull request. Please make sure to follow the existing code style and guidelines.
This project is licensed under the GPL-3.0 License. See the LICENSE file for details.
Copyright 2023, Max Base