Frontend repository for the Online Madrasah Project. This project is developed using a monorepo structure with Turborepo.
- Next.js 14 - React framework with App Router
- TailwindCSS - Utility-first CSS framework
- Shadcn/ui - Reusable components built with Radix UI and Tailwind CSS
- TypeScript - Type safety
- Turborepo - Build system and monorepo management
- ESLint - Code linting and formatting
- Commitlint - Conventional commit message linting
- Husky - Git hooks
- Node.js 18+
- npm 8+
- Install dependencies:
npm install
- Start the development server:
npm run dev
To ensure a consistent and productive development experience, it is highly recommended to install the recommended VS Code extensions for this codebase. Search @recommended
in the Extensions Marketplace, and install all.
- Build all packages:
npm run build
npm run dev
- Starts development servers for all applicationsnpm run build
- Builds all packages and applicationsnpm run lint
- Lints all packagesnpm run lint:fix
- Lints and fixes all packages automaticallynpm run check-types
- Type checks all packagesnpm run clean
- Cleans all build filesnpm run prepare
- Sets up Husky git hooks
This project is organized as a monorepo. Each independent frontend application is located in the apps/
directory, while shared code is in the shared/
directory.
To add new Shadcn/ui components to the shared UI package:
- Add the component file to
shared/ui/src/components/
directory - Export it from
shared/ui/src/index.ts
file - Import from
@madrasah/ui
package in applications
Example:
import { Button, Card } from "@madrasah/ui";
.
├── apps/ # Independent frontend applications
│ ├── keycloak-theme/ # Keycloak theme application
│ └── tedris/ # Main frontend application (Next.js)
│ ├── app/ # App Router structure
│ ├── components/ # Project-specific components
│ ├── lib/ # Local helpers and utilities
│ └── ...
│
├── shared/ # Shared code between frontend applications
│ ├── ui/ # Shared UI components (wrappers or common UI)
│ ├── hooks/ # Shared React hooks
│ ├── utils/ # Shared utility functions
│ ├── types/ # Shared TypeScript types
│ ├── icons/ # Shared icon components
│ ├── tokens/ # Design tokens
│ └── ...
│
├── .env # Base environment variables (can be overridden per app)
├── turbo.json # Turborepo configuration
├── package.json # Root level dependencies and scripts
├── commitlint.config.js # Commitlint configuration
└── tsconfig.base.json # Shared TypeScript configuration
This project uses Conventional Commits specification. All commit messages are validated using commitlint.
<type>: <description>
[optional body]
[optional footer(s)]
- feat: A new feature
- fix: A bug fix
- docs: Documentation only changes
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
- refactor: A code change that neither fixes a bug nor adds a feature
- perf: A code change that improves performance
- test: Adding missing tests or correcting existing tests
- build: Changes that affect the build system or external dependencies
- ci: Changes to our CI configuration files and scripts
- chore: Other changes that don't modify src or test files
- revert: Reverts a previous commit
- Type: Must be lowercase and one of the allowed types
- Description: Must be present and not end with a period
- Case: Subject must not be in start-case, pascal-case, or upper-case
✅ Good commits:
feat: add user authentication
fix: resolve login redirect issue
docs: update installation instructions
refactor: simplify user service logic
❌ Bad commits:
Add new feature # Missing type
feat: Add New Feature # Wrong case
fix: fixed the bug. # Ends with period
FEAT: new feature # Wrong type case
- Clone the repository
- Install dependencies:
npm install
- Create a feature branch:
git checkout -b feat/your-feature-name
- Make your changes
- Follow commit conventions when committing
- Run tests and linting:
npm run lint
andnpm run check-types
- Push your branch and create a pull request
- Follow the conventional commit format
- Ensure all linting passes before submitting PR
- Add appropriate tests for new features
- Update documentation as needed
For more information about the project structure and development guidelines, please refer to the individual package README files.