Skip to content

Commit

Permalink
Docs(README.md): Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur-Poffo committed Feb 26, 2024
1 parent 107d683 commit 9fbfaee
Showing 1 changed file with 42 additions and 46 deletions.
88 changes: 42 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<h1 align="center">
<a href="#">CodeSpark - Entra21 TCC 💻</a>
</h1>
# CodeSpark - Entra21 TCC 💻

<h3 align="center">
CodeSpark API
Expand All @@ -13,28 +11,28 @@
<p align="center">
<a href="#about">About</a> •
<a href="#potential-refactoring-or-updates">Potential Refactoring or Updates</a> •
<a href="#separation-of-initial-requirements">Separation of initial requirements</a> •
<a href="#separation-of-initial-requirements">Separation of Initial Requirements</a> •
<a href="#api-routes">API Routes</a> •
<a href="#how-it-works">How it works</a> •
<a href="#how-it-works">How It Works</a> •
<a href="#tech-stack">Tech Stack</a> •
<a href="#author">Author</a>
</p>

## About

CodeSpark API - CodeSpark API is an API that follows good practices such as: DDD and clean architecture, it is an API responsible for a course platform, it contains a file upload system for Cloudflare R2 (it uses AWS S3 under the hood) and a class evaluation system
CodeSpark API - The CodeSpark API adheres to industry best practices such as Domain-Driven Design (DDD) and clean architecture. It serves as the backbone for a course platform, featuring a file upload system integrated with Cloudflare R2 (powered by AWS S3) and a comprehensive class evaluation system.

It is a TCC project for the [Entra21 training program](https://www.entra21.com.br/) in Vue.js course
This project serves as the TCC (Trabalho de Conclusão de Curso - Course Conclusion Work) for the [Entra21 training program](https://www.entra21.com.br/) Vue.js course.

---

## Potential Refactoring or Updates

> The API scaled more than we thought and that's why some things were left out even of the MVP, but we intend to continue with the project after the presentation
> The API's scope has expanded beyond our initial expectations, necessitating some features to be deferred even from the MVP. Nevertheless, we're committed to further development post-presentation.
- [x] Implement method for course repository.
- [x] Implement a method for the course repository.
- [x] Refactor dependencies in all unit tests.
- [x] Verify the usage of `Promise.all()` and apply destructuring where applicable.
- [x] Optimize the usage of `Promise.all()` and apply destructuring where applicable.
- [x] Review use cases and explore potential improvements.
- [x] Ensure consistent usage of `new UniqueEntityId()` for entity IDs and rectify any inconsistencies.
- [x] Evaluate the Enrollment entity for possible simplifications in managing modules and classes.
Expand All @@ -47,34 +45,34 @@ It is a TCC project for the [Entra21 training program](https://www.entra21.com.b
- [x] Introduce domain events for Prisma repositories.
- [ ] Implement mappers for mapping domain entities to DTOs.
- [ ] Implement pagination.
- [ ] Implement E2E tests.
- [ ] Refactor error handling in controllers
- [ ] Refactor the event handler class instance
- [ ] Implement End-to-End (E2E) tests.
- [ ] Refactor error handling in controllers.
- [ ] Refactor the event handler class instance.

---

## Separation of initial requirements
## Separation of Initial Requirements

## Functional Requirements

- [x] User must be able to register in the system as "Student" or "Instructor."
- [x] User must be able to register in the system as either "Student" or "Instructor."
- [x] User must be able to authenticate after registration.
- [x] Return information about a user.

- [x] Instructors must be able to register courses on the platform.
- [x] Instructors can register modules for a course.
- [x] Instructors can add classes to modules.
- [x] Should be able to register tags
- [x] Responsible instructor can add "tags" to their course to inform students about technologies present in the course.
- [x] Should be able to register tags.
- [x] Responsible instructors can add "tags" to their courses to inform students about technologies present in the course.
- [x] Instructors can create classes and upload videos to them.
- [x] Instructor can upload a certificate template for students upon course completion.
- [x] Instructors can upload a certificate template for students upon course completion.
- [x] Return information of an instructor with their courses.

- [x] Return information about a course.
- [x] Return information about a course with its modules.
- [x] Classes and modules must have a field informing their position, e.g. this class is number one, so this is the first class of the course.
- [x] Classes and modules must have a field informing their position, e.g., this class is number one, so this is the first class of the course.

- [x] Students can "enroll" to participate in the course.
- [x] Students can "enroll" to participate in a course.
- [x] Return information about a course with its students.
- [x] Students can mark classes as completed.
- [x] Mark modules as completed after the student views all its classes.
Expand All @@ -84,7 +82,7 @@ It is a TCC project for the [Entra21 training program](https://www.entra21.com.b

- [x] It should be possible to filter courses by name or "tags."
- [x] Students can evaluate a particular class they are taking with a rating from 1 to 5 to later have an average rating for the course.
- [x] Get course evaluations average
- [x] Get course evaluations average.

- [x] An instructor should be able to retrieve traffic data for one of their courses.

Expand All @@ -102,10 +100,10 @@ It is a TCC project for the [Entra21 training program](https://www.entra21.com.b
- [x] Only instructors can register a course.
- [x] A specific instructor cannot register a course with the same name.
- [x] A student should only be able to rate a class once.
- [x] Should not be able to register a course with the same name in same instructor account.
- [x] Should not be able to register a course with the same name in the same instructor account.
- [x] Should not be able to register a module to a course with the same name twice.
- [x] Should not be able to add a class to a module with the same name twice.
- [x] Should not be able to register a module to a specific course with same name twice.
- [x] Should not be able to register a module to a specific course with the same name twice.
- [x] A student can only issue one certificate per course.
- [x] A student can only enroll for a particular course once.
- [x] There should not be repeated tags in a course.
Expand All @@ -122,7 +120,7 @@ It is a TCC project for the [Entra21 training program](https://www.entra21.com.b

## API Routes

> This is just the initial documentation as we need to speed up development, it will be refactored after the project is presented
> The following documentation provides an initial overview of API routes. Further refinement will be undertaken post-presentation.
### Users
- [x] GET /users/:userId - Get user details
Expand All @@ -134,7 +132,7 @@ It is a TCC project for the [Entra21 training program](https://www.entra21.com.b
- [x] POST /sessions - User authentication

### Students
- [x] GET /courses/:courseId/students - Get students enrolled in course
- [x] GET /courses/:courseId/students - Get students enrolled in a course
- [x] GET /students/:studentId/enrollments - Get student courses with instructor and evaluations

### Instructors
Expand Down Expand Up @@ -179,15 +177,15 @@ It is a TCC project for the [Entra21 training program](https://www.entra21.com.b
### CourseTags
- [x] GET /courses/:courseId/tags - Get course tags
- [x] POST /courses/:courseId/tags/:tagId - Attach tag to course
- [x] POST /courses/:courseId/tags/:tagId - Remove tag to course
- [x] POST /courses/:courseId/tags/:tagId - Remove tag from course

### Evaluations
- [x] GET /courses/:courseId/evaluations/average - Get course evaluation average
- [x] POST /evaluations - Register evaluation
- [x] PUT /evaluations/:evaluationId - Update evaluation

### Enrollments
- [x] POST /courses/:courseId/enroll - Enroll to course
- [x] POST /courses/:courseId/enroll - Enroll in a course
- [x] POST /enrollments/:enrollmentId/modules/:moduleId/complete - Mark module as completed
- [x] POST /enrollments/:enrollmentId/classes/:classId/complete - Mark class as completed
- [x] POST /enrollments/:enrollmentId/complete - Mark enrollment as completed
Expand All @@ -208,48 +206,46 @@ It is a TCC project for the [Entra21 training program](https://www.entra21.com.b

---

## How it works
## How It Works

### Pre-requisites

Before you begin, you will need to have the following tools installed on your machine:
[Git](https://git-scm.com), [Node.js](https://nodejs.org/en/) and [yarn package manager](https://yarnpkg.com/).
In addition, it is good to have an editor to work with the code like [VSCode](https://code.visualstudio.com/) and a REST client like [Insomnia](https://insomnia.rest/)
Before you begin, ensure you have the following tools installed on your machine:
[Git](https://git-scm.com), [Node.js](https://nodejs.org/en/), [Yarn](https://yarnpkg.com/), an editor like [VSCode](https://code.visualstudio.com/), and a REST client such as [Insomnia](https://insomnia.rest/).

You will also need to have [Docker](https://www.docker.com/) installed to run the
postgres database with [Docker Compose](https://docs.docker.com/compose/)
Additionally, Docker is required to run the PostgreSQL database using [Docker Compose](https://docs.docker.com/compose/).

**it is very important that before running the project you configure the environment variables as indicated in the file: .env.example**
**Before running the project, make sure to configure the environment variables as indicated in the `.env.example` file.**

#### Run the app
#### Running the App

```bash
# Clone this repository
$ git clone https://github.com/Artur-Poffo/Code-Spark-API.git

# Access the project folder cmd/terminal
# Navigate to the project directory in your terminal
$ cd Code-Spark-API

# install the dependencies
# Install dependencies
$ yarn

# Inicialize the database
# Initialize the database
$ yarn docker:init
# This script should create and start a docker container with Postgres database
# This script should create and start a Docker container with the PostgreSQL database

# Then when you want to stop running docker, run:
# To stop Docker, run:
$ yarn docker:stop
# Or just press Ctrl+c
# Or press Ctrl+C

# When you want start the container again, run
# To start the container again, run:
$ yarn docker:start

# Remember to create the RSA keys for the JWT, instructions in the .env.example file
# Generate RSA keys for JWT authentication, as instructed in the .env.example file

# Run the application in development mode
$ yarn start:dev

# The server will start at port: 3333 - You can now test in Insomnia or another REST client: http://localhost:3333
# The server will start at port 3333. You can now test it using Insomnia or any other REST client: http://localhost:3333
```

#### Run tests
Expand All @@ -259,7 +255,7 @@ $ yarn start:dev
$ yarn test:unit

# Run unit tests in watch mode
$ pnpm test:unit:watch
$ yarn test:unit:watch

# Run test coverage
$ yarn test:cov
Expand All @@ -282,7 +278,7 @@ The following tools were used in the construction of the project:
- **zod**
- **prisma**
- **vitest**
- **supertest**
- **@aws-sdk/client-s3**
- **Docker**

> See the file [package.json](https://github.com/Artur-Poffo/Code-Spark-API/blob/main/package.json)
Expand Down

0 comments on commit 9fbfaee

Please sign in to comment.