Skip to content

A robust and scalable backend solution designed for managing articles, authors, and related content on a publishing platform. It provides a RESTful interface to enable seamless content creation, editing, deletion, and retrieval of articles, as well as managing user accounts and interactions with content.

Notifications You must be signed in to change notification settings

PeterImade/Content-Management-API

Repository files navigation

Content Management API (Express + Typescript + Prisma) containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to industry standards.

Getting Started

Prerequisites

Run the following command to install dependencies:

npm install

Environment variables

This project depends on some environment variables. If you are running this project locally, create a .env file at the root for these variables. Your host provider should included a feature to set them there directly to avoid exposing them.

Here are the required ones:

DATABASE_URL=
JWT_SECRET=
NODE_ENV=production

Generate your Prisma client

Run the following command to generate the Prisma Client which will include types based on your database schema:

npx prisma generate

Apply any SQL migration script

Run the following command to create/update your database based on existing sql migration scripts:

npx prisma migrate deploy

Run the project

Run the following command to run the project:

npx nx serve api

Seed the database

The project includes a seed script to populate the database:

npx prisma db seed

Deploy on a remote server

Run the following command to:

  • install dependencies
  • apply any new migration sql scripts
  • run the server
npm ci && npx prisma migrate deploy && node dist/api/main.js

About

A robust and scalable backend solution designed for managing articles, authors, and related content on a publishing platform. It provides a RESTful interface to enable seamless content creation, editing, deletion, and retrieval of articles, as well as managing user accounts and interactions with content.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published