Skip to content

A production-ready todo application backend built with TypeScript, GraphQL, Prisma, and JWT authentication, Jest, Docker and CI / CD with Github Actions

License

Notifications You must be signed in to change notification settings

0xprathamesh/todo_backend

Repository files navigation

🚀 Advanced Scalable Todo Application Backend

NodeJs TypeScript GraphQL Prisma PostgreSQL Docker Supabase

📋 Table of Contents

  1. 🤖 Introduction
  2. ⚙️ Tech Stack
  3. 🔋 Features
  4. 🤸 Quick Start
  5. 🕸️ API Documentation
  6. 🔗 Links
  7. 🚀 More

🤖 Introduction

Build a production-ready Todo Management System API that handles user authentication, task management, and real-time updates. This scalable backend is built with modern technologies and follows best practices for enterprise-grade applications.

The system provides a robust GraphQL API that allows users to:

  • Create, read, update, and delete todos
  • Manage user authentication and authorization
  • Organize tasks with categories and priorities
  • Track task completion status

⚙️ Tech Stack

  • Backend Framework: Node.js with Express
  • API: GraphQL with Apollo Server
  • Database: PostgreSQL with Prisma ORM
  • Authentication: JWT (JSON Web Tokens)
  • Testing: Jest
  • Containerization: Docker
  • Language: TypeScript

🔋 Features

👉 GraphQL API: Flexible and efficient data querying with Apollo Server

👉 Authentication & Authorization: Secure user management with JWT tokens

👉 Database Integration: Robust data modeling with Prisma ORM

👉 Type Safety: Full TypeScript support for better development experience

👉 Testing: Comprehensive test suite with Jest

👉 Docker Support: Easy deployment with containerization

👉 API Documentation: Auto-generated GraphQL schema documentation

🤸 Quick Start

Follow these steps to set up the project locally on your machine.

Prerequisites

Make sure you have the following installed on your machine:

Cloning the Repository

git clone <your-repo-url>
cd todo_backend

Installation

Install the project dependencies:

npm install

Set Up Environment Variables

Create a new file named .env in the root of your project and add the following content:

# Server Configuration
PORT=4000
NODE_ENV=development

# Database
DATABASE_URL="postgresql://user:password@localhost:5432/todo_db"

# JWT
JWT_SECRET=your_jwt_secret
JWT_EXPIRES_IN=1d

Database Setup

# Generate Prisma client
npm run db:generate

# Run migrations
npm run db:migrate

# Seed the database (optional)
npm run db:seed

Running the Project

Development mode:

npm run dev

Production mode:

npm run build
npm start

Using Docker:

docker-compose up

The GraphQL playground will be available at http://localhost:4000

🕸️ API Documentation

Example GraphQL Query

query {
  todos {
    id
    title
    description
    completed
    createdAt
    user {
      id
      name
    }
  }
}

Example GraphQL Mutation

mutation {
  createTodo(
    input: {
      title: "Learn GraphQL"
      description: "Master GraphQL with Apollo Server"
    }
  ) {
    id
    title
    description
    completed
  }
}

🔗 Links

🚀 More

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

If you need help or have questions, please open an issue in the repository.

👨‍💻 Author

Prathamesh Patil - GitHub

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


Built with ❤️ by Prathamesh Patil

About

A production-ready todo application backend built with TypeScript, GraphQL, Prisma, and JWT authentication, Jest, Docker and CI / CD with Github Actions

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages