Education connection is a backend service designed to help teachers perform administrative functions for their students. It's built using the NestJS framework, offering robust API endpoints for clients.
- Overview
- Table Of Content
- Approach
- Tech stacks
- Source structure
- Test coverage
- How to run
- Development
- Production
- How to test
- Note
- Contact
- Teacher can register students.
- Teacher can retrieve a list of students common to a given list of teachers.
- Teacher can suspend a specified student.
- Teacher can retrieve a list of students who can receive a given notification.
- Choose a library or framework to develop APIs.
- There are many options for this such as ExpressJS, NestJS, etc.
- Depend on requirement or project scope, choose a template or structure for this project.
- There are many options such as 3-layers architecture, module architecture, etc.
- Think about TDD (Test-driven development) or TLD (Test-Last development).
- Following the requirements, develop APIs to implement features.
- Write unit test to verify apis.
- Implement security with authentication, authorization.
- Tracing with log.
- Deploy app.
- Backend Framework: NestJS
- Database: MySQL with TypeORM
- Testing: Jest
- Code Formatting and Linting: ESLint, Prettier
...
├── src
│ ├── config
│ ├── constants
│ ├── controllers
│ │ ├── tests
│ │ │ ├── teacher.controller.spec.ts
│ │ ├── teacher.controller.ts
│ ├── database
│ │ ├── migrations
│ │ ├── seeding
│ ├── decorators
│ │ ├── validator
│ ├── dtos
│ │ ├── request
│ │ ├── response
│ ├── entities
│ │ ├── teacher.entity.ts
│ ├── filters
│ │ ├── http-exception.filter.ts
│ ├── modules
│ │ ├── teacher.module.ts
│ ├── pipes
│ │ ├── validation.pipe.ts
│ ├── repositories
│ │ ├── tests
│ │ │ ├── teacher.repository.spec.ts
│ │ ├── teacher.repository.ts
│ ├── services
│ │ ├── tests
│ │ │ ├── teacher.service.ts
│ ├── utils
│ ├── app.module.ts
│ ├── main.ts
- Node.js v18.19.0
- Docker
- Postman
To install the project, follow these steps:
git clone https://github.com/huynhquanhht/education-connection
cd education-connection
To run this project, you will need to set up the following environment variables. You can do this by creating a .env
file in folder education-connection
.
# MySQL Database
#===
MYSQL_PORT_EXPOSE=3307
MYSQL_ROOT_PASSWORD=Root@123
MYSQL_USER=admin
MYSQL_PASSWORD=Admin@123
MYSQL_DATABASE=education_connection
# Server
#===
SERVER_PORT=8080
DB_HOST_MYSQL=mysql-db
DB_PORT_MYSQL=3306
DB_USERNAME_MYSQL=admin
DB_PASSWORD_MYSQL=Admin@123
DB_NAME_MYSQL=education_connection
DB_LOGGING=DISABLED
At folder education-connection
, to build, start and run services:
docker-compose up
After the server is successfully up and running, you can proceed with running the seeding process.
docker exec -it education-connection-api npm run seed:run
To run migrations:
npm run migration:run
To run for seeding:
npm run seed:run
npm run start
To run tests:
npm run test
npm run test:cov
npm run build
Import the content of Postman File to Postman following guide.
Call the first api to get response.
- Following the requirement, I didn't create the API for registering a specific teacher or a specific student. Please run the seeding first to generate data.
- Attach the postman file: Postman File
This project is licensed under the MIT License - see the LICENSE file for details.
- Email: huynhquanhht@gmail.com
- Github: huynhquanhht