https://github.com/dxtaner/movie-app-graphql
Movie-App-Graphql
https://github.com/dxtaner/movie-app-graphql
apollo-server-express cors express graphql mongoose node-cron
Last synced: about 2 months ago
JSON representation
Movie-App-Graphql
- Host: GitHub
- URL: https://github.com/dxtaner/movie-app-graphql
- Owner: dxtaner
- Created: 2024-03-06T13:23:07.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-07-18T12:13:58.000Z (11 months ago)
- Last Synced: 2025-07-18T16:50:47.870Z (11 months ago)
- Topics: apollo-server-express, cors, express, graphql, mongoose, node-cron
- Language: JavaScript
- Homepage:
- Size: 54.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Express GraphQL Server with Cron
================================
This project sets up an Express server with GraphQL integration and cron jobs for periodic tasks. It utilizes Node.js, Express.js, GraphQL, and Cron.
Features
--------
* **GraphQL API:** Exposes a GraphQL API endpoint for querying and mutating data.
* **Cron Jobs:** Configures cron jobs for executing periodic tasks.
* **Database Connectivity:** Establishes a connection to the database.
* **CORS:** Implements Cross-Origin Resource Sharing for handling requests from different origins.
Installation
------------
1. Clone the repository:
git clone
2. Install dependencies:
npm install
3. Set up environment variables:
Create a `.env` file in the root directory and specify the required environment variables:
PORT=5000
DATABASE_URL=
Usage
-----
1. Start the server:
npm start
The server will be running on `http://localhost:5000` by default.
2. Access the GraphQL Playground:
Open a web browser and navigate to `http://localhost:5000/graphql` to access the GraphQL Playground. Here, you can interact with the GraphQL API, explore the schema, and execute queries and mutations.
Configuration
-------------
* **Port:** You can specify a custom port by setting the `PORT` environment variable.
* **Database:** Update the `DATABASE_URL` environment variable with your database connection URL.
* **Cron Jobs:** Define your cron job configurations in the `cron.js` file.
Folder Structure
----------------
* `schema/`: Contains the GraphQL schema definitions.
* `helpers/`: Includes helper functions, such as database connection setup.
* `cron.js`: Configures cron jobs.
* `server.js`: Entry point for the Express server.
Dependencies
------------
* `express`: Web framework for Node.js.
* `express-graphql`: Middleware for integrating GraphQL with Express.
* `cors`: Middleware for enabling Cross-Origin Resource Sharing.
* `cron`: Library for scheduling cron jobs.
Contributing
------------
Contributions are welcome! Feel free to submit issues or pull requests.
License
-------
[MIT License](LICENSE)