Typescript-GraphQL-MongoDB-MikroORM Starter
A starter project for building GraphQL APIs with Node.js, Typescript, MongoDB, and MikroORM. It provides a basic folder structure and starter files to help you get started with your own GraphQL API quickly and easily.
Features
- Typescript for type safety
- GraphQL for building APIs
- MongoDB for data storage
- MikroORM for ORM
- GraphQL Playground for testing the API
Getting Started
Prerequisites
- Node.js (v14 or later)
- MongoDB
Installation
- Initialize the project:
npm install typescript-graphql-mongodb-starter
- Install dependencies:
npm install
Setting Up Environment Variables
create a .env file in the root folder and add :
DATABASE_URL = 'your_mongodb_url'
PORT : ---
Running the Application
- Start the server: npm start
- Open GraphQL Playground at http://localhost:4000/graphql
Testing
- Run tests: npm test
Folder Structure
src
folder contains the source codeentities
folder contains MikroORM entitiesresolvers
folder contains GraphQL resolversutils
folder contains utility functionsindex.ts
file contains the main application entry point
- tests folder contains the unit tests
License
This project is licensed under the MIT License - see the LICENSE file for details.