A full-stack web application designed for online teaching, built with a modern technology stack featuring NestJS, Next.js, and PostgreSQL.
- NestJS: A progressive Node.js framework for building efficient, scalable Node.js server-side applications.
- Prisma: Next-generation ORM for Node.js and TypeScript.
- PostgreSQL: Powerful, open source object-relational database system.
- Passport: Simple, unobtrusive authentication for Node.js.
- Next.js: The React Framework for the Web.
- React: A JavaScript library for building user interfaces.
- Tailwind CSS: A utility-first CSS framework for rapid UI development.
- Zustand: A small, fast and scalable bearbones state-management solution.
- Axios: Promise based HTTP client for the browser and node.js.
- Docker: Containerize authentication and application dependencies.
Before you begin, ensure you have the following installed on your machine:
Follow these steps to set up and run the project locally.
Start the PostgreSQL database using Docker Compose:
docker-compose up -dThis will start a PostgreSQL container on port 5432 with the following credentials (defined in docker-compose.yml):
- User:
user - Password:
password - Database:
online_teacher
Navigate to the backend directory:
cd backendInstall dependencies:
npm installCreate a .env file in the backend directory and configure the database connection:
# backend/.env
DATABASE_URL="postgresql://user:password@localhost:5432/online_teacher?schema=public"
JWT_SECRET="your_super_secret_key" # Replace with a secure secret
PORT=3000Run database migrations to set up the schema:
npx prisma migrate devStart the backend server:
npm run start:devThe backend API will be running at http://localhost:3000.
Open a new terminal and navigate to the frontend directory:
cd frontendInstall dependencies:
npm installStart the frontend development server:
npm run devThe frontend application will be running at http://localhost:3001 (if port 3000 is taken by the backend).
onlineteacher/
├── backend/ # NestJS Backend Application
│ ├── src/ # Source code
│ ├── prisma/ # Prisma schema and migrations
│ └── test/ # Tests
├── frontend/ # Next.js Frontend Application
│ ├── app/ # App Router pages and layouts
│ ├── components/ # Reusable UI components
│ ├── lib/ # Utilities (Axios, etc.)
│ ├── services/ # API services
│ └── store/ # Zustand state management
└── docker-compose.yml # Docker services configuration
- API Documentation: Once the backend is running, you can access the API endpoints at
http://localhost:3000. - Frontend Interface: Access the user interface at
http://localhost:3001(or the port shown in your terminal).
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.