RepoProvas API, a system for sharing tests between students, built with Typescript, Node.js, Express, Prisma and Postgres.

Overview

Repoprovas

Built With

📋 Description

RepoProvas API, a system for sharing tests between students, built with Typescript, Node.js, Express, Prisma and Postgres.

💻 Features

  • Register a new user;
  • Login a user;
  • Add a new test;
  • View tests by disciplines;
  • View tests by teachers.

🚀 Routes

Register a new user

POST /signup

Request:

Body Type Description
email string Required. User mail.
password string Required. User password.
repeatPassword string Required. Repeat user password.

Login a user

POST /signin

Request:

Body Type Description
email string Required. User mail.
password string Required. User password.

Response:

{
  "token": 11111111111
}

Add a new test

POST /tests

Request:

Headers Type Description
Authorization string Required. User token.

The Authorization field must have the following format: Bearer ${token}

Body Type Description
name string Required. Test name.
pdfUrl string Required. Valid pdf url.
categoryName string Required. Category name.
disciplineName string Required. Discipline name.
teacherName string Required. Teacher name.

View tests by discipline

GET /tests/disciplines

Request:

Headers Type Description
Authorization string Required. User token.

The Authorization field must have the following format: Bearer ${token}

Response

[
  {
    "id": 1,
    "number": 1,
    "disciplines": [
      {
        "id": 1,
        "name": "Discipline name",
        "categories": [
          {
            "id": 1,
            "name": "Category name",
            "tests": [
              {
                "id": 1,
                "name": "Test name",
                "pdfUrl": "https://...",
                "teacher": {
                  "id": 1,
                  "name": "Teacher name",
                }
              }
            ]
          }
        ]
      }
    ]
  },
  {
    ...
  }
]

View tests by teacher

GET /tests/teachers

Request:

Headers Type Description
Authorization string Required. User token.

The Authorization field must have the following format: Bearer ${token}

Response

[
  {
    "id": 1,
    "name": "Teacher name",
    "categories": [
      {
        "id": 1,
        "name": "Category name",
        "tests": [
          {
            "id": 1,
            "name": "Test name",
            "pdfUrl": "https://...",
            "discipline": {
                "id": 1,
                "name": "Discipline name",
            }
          }
        ]
      }
    ]
  },
  {
    ...
  }
]

Environment Variables

To run this project, you will need to add the following environment variables to your .env file

PORT = number Recommended:5000

DATABASE_URL = postgres://UserName:Password@Hostname:5432/DatabaseName

JWT_SECRET = any string

🏁 Run Locally

Clone the project

  git clone https://github.com/lugablima/projeto20-repoprovas

Go to the project directory

  cd projeto20-repoprovas/

Install dependencies

  npm install

Start the server

  npm run dev

The API deploy link is: https://back-projeto20-repoprovas.herokuapp.com/

You might also like...

The Frontend of Escobar's Inventory Management System, Employee Management System, Ordering System, and Income & Expense System

The Frontend of Escobar's Inventory Management System, Employee Management System, Ordering System, and Income & Expense System

Usage Create an App # with npx $ npx create-nextron-app my-app --example with-javascript # with yarn $ yarn create nextron-app my-app --example with-

Jan 2, 2023

SAP Community Code Challenge: This repository contains an empty OpenUI5 application and end-to-end tests written with wdi5. Take part in the challenge and develop an app that passes the tests.

SAP Community Code Challenge - UI5 The change log describes notable changes in this package. Description This repository is the starting point for the

Oct 24, 2022

Projeto 20° da Driven Education - RepoProvas (front)

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

Sep 26, 2022

Projeto 20° da Driven Education - RepoProvas (Back)

Projeto 20° da Driven Education - RepoProvas (Back)

RepoProvas 20th Project of Driven Education An API to manage and storage yout tests Built With Project Guide Features Auth (sign-in/sign-up) Create te

Sep 26, 2022

TypeScript + Prisma + Express API Server 系统

TypeScript + Prisma + Express API Server 系统 一键化使用 Docker的应用 Graphql 基于Express的一键搭建模板 Makefile docker husky eslint lint-staged prettier TypeScript ts-n

Jul 13, 2022

This is a library to alternate and self-host the Prisma Data Proxy (cloud.prisma.io)

This is a library to alternate and self-host the Prisma Data Proxy (cloud.prisma.io)

Alternative Prisma Data Proxy This is a library to alternate and self-host the Prisma Data Proxy (cloud.prisma.io). In order to deploy your project to

Dec 28, 2022

Express.js framework boilerplate with TypeScript, Prisma, ESLint, Husky and Jest

Express.js framework boilerplate with TypeScript, Prisma, ESLint, Husky and Jest

Setup a Node.js project with Typescript, Prisma ESLint, Prettier, Husky Node.js boilerplate with Express.js, TypeScript, Prisma, ESLint, Prettier, Hus

Dec 12, 2022

Prisma +2 generator to emit Yup schemas from your Prisma schema

Prisma +2 generator to emit Yup schemas from your Prisma schema

Prisma Yup Generator Automatically generate Yup schemas from your Prisma Schema, and use them to validate your API endpoints or any other use you have

Dec 24, 2022
Comments
  • Feat tests

    Feat tests

    • Implementei a rota POST '/tests' para adicionar uma prova;
    • Implementei a rota GET '/tests/disciplines' para buscar todos os testes agrupados por disciplina;
    • Implementei a rota GET '/tests/teachers' para buscar todos os testes agrupados por professor.
    opened by lugablima 0
  • Feat authentication

    Feat authentication

    • Implementei a rota POST /signup para cadastrar um novo usuário;
    • Implementei a rota POST /signin para logar um usuário;
    • Implementei os testes de integração da rota POST /signup;
    • Implementei os testes de integração da rota POST /signin.
    opened by lugablima 0
Owner
Lucas Lima
Full-Stack development student
Lucas Lima
A NestJS module that allows you use Prisma, set up multiple Prisma services, and use multi-tenancy in each Prisma service.

NestJS Prisma Module Installation To use this package, first install it: npm i @sabinthedev/nestjs-prisma Basic Usage In order to use this package, yo

Sabin Adams 39 Dec 2, 2022
An API built for an invoices manager app using TypeScript and Prisma with Node and Express.

Invoices App API An API built for the invoices manager app using TypeScript and Prisma with Node and Express. Run locally To run locally, you need to

Waleed Alfaifi 4 Oct 17, 2022
My-portfolio - Built with Namecheap, Digital Ocean, Nginx, PM2, SSL, NextJs, Tailwind 3, Graphql, NexusJS, Prisma, Postgres, Passion and Love

Current Implementation technologies Nextjs with Typescript. Static pages/ Server side rendering. Easy peasy state management (Might not need it with i

Samrood Ali 1 Jan 10, 2022
A map for 1337 Khouribga's new labs clusters. This tool will help 1337 students find available posts, and search for other students in the cluster by name or login.

1337KH Labs Clusters Map Hellow. This tool is made by 1337 Khouribga students for 1337 Khouribga students to help make their lives at the school easie

Oussama 18 Aug 8, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
🐘 instantly stand up full Postgres databases in your AVA tests

ava-postgres ava-postgres is a test fixture for AVA that provides you with nearly-instant access to a fresh Postgres database for every test. Installa

Seam 2 Dec 22, 2022
An on-demand peer tutoring platform by students, for students.

OURFinals An on-demand peer tutoring platform by students, for students. Database The prisma/ folder contains: migrations/: Past database migrations (

Aditya Banerjee 3 Jan 6, 2022
A file sharing service, where you can upload files and provide a download link for anyone on the internet by sharing the link 🔗 or via mail ✉️ which remains active for 24hours 🕙.

eShare | File Sharing App A file sharing service, where you can upload files and provide a download link for anyone on the internet by sharing the lin

Akhil Bhalerao 7 Nov 20, 2022