MCPcopy Index your code
hub / github.com/gothinkster/node-express-realworld-example-app

github.com/gothinkster/node-express-realworld-example-app @main sqlite

repository ↗ · DeepWiki ↗
44 symbols 120 edges 39 files 0 documented · 0%
README

Node/Express/Prisma Example App

Build Status

Example Node (Express + Prisma) codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld API spec.

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

Extension points exported contracts — how you extend this code

RegisteredUser (Interface)
(no doc)
src/app/routes/auth/registered-user.model.ts
Global (Interface)
(no doc)
src/prisma/prisma-client.ts
Request (Interface)
(no doc)
src/app/routes/auth/user-request.d.ts
CustomNodeJsGlobal (Interface)
(no doc)
src/prisma/prisma-client.ts
RegisterInput (Interface)
(no doc)
src/app/routes/auth/register-input.model.ts
User (Interface)
(no doc)
src/app/routes/auth/user.model.ts
Profile (Interface)
(no doc)
src/app/routes/profile/profile.model.ts

Core symbols most depended-on inside this repo

profileMapper
called by 8
src/app/routes/profile/profile.utils.ts
createUser
called by 7
src/app/routes/auth/auth.service.ts
login
called by 6
src/app/routes/auth/auth.service.ts
articleMapper
called by 5
src/app/routes/article/article.mapper.ts
generateToken
called by 4
src/app/routes/auth/token.utils.ts
getProfile
called by 3
src/app/routes/profile/profile.service.ts
followUser
called by 3
src/app/routes/profile/profile.service.ts
unfollowUser
called by 3
src/app/routes/profile/profile.service.ts

Shape

Function 31
Interface 10
Class 2
Method 1

Languages

TypeScript100%

Modules by API surface

src/app/routes/article/article.service.ts13 symbols
src/app/routes/auth/auth.service.ts5 symbols
src/prisma/seed.ts4 symbols
src/app/routes/profile/profile.service.ts3 symbols
src/app/models/http-exception.model.ts3 symbols
src/prisma/prisma-client.ts2 symbols
src/app/routes/tag/tag.service.ts1 symbols
src/app/routes/tag/tag.model.ts1 symbols
src/app/routes/profile/profile.utils.ts1 symbols
src/app/routes/profile/profile.model.ts1 symbols
src/app/routes/auth/user.model.ts1 symbols
src/app/routes/auth/user-request.d.ts1 symbols

Dependencies from manifests, versioned

@ngneat/falso7.1.1 · 1×
@nx/esbuild17.2.6 · 1×
@nx/eslint17.2.6 · 1×
@nx/eslint-plugin17.2.6 · 1×
@nx/jest17.2.6 · 1×
@nx/js17.2.6 · 1×
@nx/node17.2.6 · 1×
@nx/workspace17.2.6 · 1×
@prisma/client4.16.1 · 1×
@swc-node/register1.6.7 · 1×
@swc/core1.3.85 · 1×
@types/bcryptjs2.4.6 · 1×

For agents

$ claude mcp add node-express-realworld-example-app \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact