Skip to content

About

Clean modular starter for building GraphQL & REST APIs with Node.js, TypeScript and SQLite

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

Repository files navigation

GraphQL & REST API Server

A lightweight backend project built with Node.js and TypeScript, featuring both REST and GraphQL APIs.

Node.js TypeScript GraphQL REST API SQLite

Features • Tech Stack • Getting Started • API Docs


Overview

This project is an example of a backend server that exposes the same application through REST and GraphQL. It includes user authentication, post management, pagination, and several measures to help protect the API from abuse.

Features

  • Authentication — user registration and cookie-based sessions
  • Post management — create, retrieve, and delete posts
  • Pagination — retrieve posts in configurable pages
  • Rate limiting — limit repeated requests
  • GraphQL query depth protection — guard against deeply nested queries
  • Input validation — request validation with Zod
  • API documentation — interactive REST documentation with Swagger UI

Tech Stack

Technology Purpose
Node.js JavaScript runtime
Express HTTP server and REST endpoints
TypeScript Static typing
GraphQL & Apollo Server GraphQL API
SQLite Database
Zod Input validation
Swagger / OpenAPI REST API documentation

Getting Started

Prerequisites

  • Node.js
  • npm

Installation

git clone <your-repository-url>
cd <repository-folder>
npm install

Create a .env file with the environment variables required by the project, then start the server using the appropriate script from package.json.

API Documentation

Once the server is running, open Swagger UI:

Open Swagger UI

Local URL: http://localhost:3000/api-docs

Project Structure

src/
├── doc/       # OpenAPI configuration
├── graphql/   # GraphQL server and context
├── http/      # API routing
├── modules/   # Auth and posts modules
└── shared/    # Shared utilities and errors

Built as a hands-on project to explore REST, GraphQL, and backend API security.

About

Clean modular starter for building GraphQL & REST APIs with Node.js, TypeScript and SQLite

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages