Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/2color/real-world-grading-app
An example of a real-world REST API backend built with TypeScript, Hapi, Prisma, and PostgreSQL.
https://github.com/2color/real-world-grading-app
database-schema hapi orm postgresql prisma rest-api typescript
Last synced: 7 days ago
JSON representation
An example of a real-world REST API backend built with TypeScript, Hapi, Prisma, and PostgreSQL.
- Host: GitHub
- URL: https://github.com/2color/real-world-grading-app
- Owner: 2color
- Created: 2020-07-15T15:15:40.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-08-09T22:38:04.000Z (about 2 years ago)
- Last Synced: 2024-10-22T05:10:22.411Z (16 days ago)
- Topics: database-schema, hapi, orm, postgresql, prisma, rest-api, typescript
- Language: TypeScript
- Homepage:
- Size: 406 KB
- Stars: 303
- Watchers: 9
- Forks: 89
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Real-world class grading backend
## ⚠️ Warning
This repo is no longer actively maintained, however it's still a [great educational](https://www.prisma.io/blog/backend-prisma-typescript-orm-with-postgresql-data-modeling-tsjs1ps7kip1) resource for building REST APIs in Node.js.
## Intro
A real-world class grading application built with Prisma.
The grading application is used to manage enrollment in online classes, tests (as in exams) for classes, and test results.
The goal if this application is to showcase a real-world scenario of an application using Prisma. the following aspects of Prisma
- Data modeling
- CRUD
- Aggregations
- API layer
- Validation
- Testing
- Authentication
- Authorization
- Integration with other APIs
- DeploymentCheck out the [**associated tutorial**](https://www.prisma.io/blog/modern-backend-1-tsjs1ps7kip1/) to learn more about how the backend was built.
## Data model
The development of this project is driven by the database schema (also known as the data model).
The schema is first designed to represent the following concepts:- **User**: this can be a student or a teacher, or both. The role of the user is determined through their association with a course.
- **Course**: represent a course that can have multiple students/teachers. Each user can be associated with multiple courses either as a student or as a teacher.
- **CourseEnrollment**:
- **Test**: Each course can have many tests
- **TestResult**: Each Test can have many TestReusults that is associated with a studentThese are defined in the [Prisma schema](./prisma/schema.prisma).
The database schema will be created by Prisma Migrate.## Tech Stack
- Backend:
- PostgreSQL
- Node.js
- Prisma
- TypeScript
- Jest
- Hapi.js## How to use
Install npm dependencies:
```
npm install
```