This project is a simple Node.js application designed to experiment with GraphQL API designs. It is not intended for production use but rather serves as a learning and experimentation platform.
- GraphQL API: Implemented using Apollo Server and GraphQL.
- User Authentication: Basic user authentication with JWT.
- MongoDB Integration: Uses Mongoose for MongoDB interactions.
- TypeScript: Written in TypeScript for type safety and better development experience.
- Validation: Input validation using
validator
library. - Environment Configuration: Managed using
dotenv
.
- src/graphql: Contains GraphQL schema and resolvers.
- src/Models: Mongoose models for MongoDB collections.
- src/utils: Utility functions for database connection and validation.
- src/server.ts: Entry point of the application.
- Node.js
- MongoDB
- Clone the repository:
git clone https://github.com/yourusername/nodets-graphql.git
cd nodets-graphql
- Install dependencies:
npm install
- Set up environment variables:
Create a
.env
file in the root directory and add your MongoDB URI:
MONGODB_URI=mongodb://127.0.0.1:27017/graphql
- Start the server:
npm start
- The server will be running at
http://localhost:4000/graphql
.
To import test data, run the following command:
ts-node src/utils/testData.ts --import
This project is for learning and experimenting with GraphQL API designs. It is not intended for production use.