Frontend for Slightly Techie CRM built with Next.js
This is the frontend for the Slightly Techie CRM system. It's a modern web application built with Next.js, TypeScript, and Tailwind CSS that provides an intuitive interface for managing CRM operations.
- Node.js: v18.0.0 or higher
- npm or yarn: Package manager (npm comes with Node.js)
- Git: For cloning the repository
- Backend API: The crm-api running locally or deployed (see crm-api README)
git clone https://github.com/Slightly-Techie/crm-web.git
cd crm-webOr with GitHub CLI:
gh repo clone Slightly-Techie/crm-webyarn install
# or
npm installCreate a .env.local file in the project root and add:
# Backend API URL (point to your crm-api instance)
NEXT_PUBLIC_API_URL=http://localhost:8000
# Optional: NextAuth configuration (if using authentication)
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your_nextauth_secret_hereNote:
NEXT_PUBLIC_prefix makes variables available in the browser. Sensitive secrets should NOT use this prefix.
yarn dev
# or
npm run devOpen http://localhost:3000 with your browser to see the application.
The page auto-updates as you edit files. Any changes to src/app/page.tsx will be reflected immediately.
crm-web/
βββ public/ # Static assets (images, fonts, etc.)
βββ src/
β βββ app/ # Next.js app directory (pages, layouts, API routes)
β β βββ api/ # API route handlers
β β βββ (admin)/ # Admin dashboard routes
β β βββ (root)/ # Public-facing routes
β β βββ login/ # Login page
β β βββ signup/ # Signup page
β β βββ users/ # User management pages
β β βββ layout.tsx # Root layout
β βββ components/ # React components
β β βββ admin/ # Admin-specific components
β β βββ Feed/ # Feed components
β β βββ layout/ # Layout components (header, sidebar, etc.)
β β βββ org-chart/ # Organization chart components
β β βββ projects/ # Project-related components
β β βββ ... # Other feature components
β βββ hooks/ # Custom React hooks
β β βββ useAxiosAuth.ts # Authenticated axios requests
β β βββ useApplicantsHook.ts # Applicant-related logic
β β βββ ... # Other hooks
β βββ lib/ # Utility libraries
β β βββ axios.ts # Axios configuration
β β βββ auth.ts # Authentication setup
β βββ context/ # React Context for state management
β βββ services/ # API service calls
β βββ types/ # TypeScript type definitions
β βββ utils/ # Utility functions
β βββ assets/ # Images, fonts, icons
β β βββ fonts/
β β βββ icons/
β β βββ images/
β βββ constants/ # Application constants
βββ tests/ # Test files and test utilities
βββ vitest.config.ts # Vitest configuration
βββ playwright.config.ts # E2E testing configuration
βββ next.config.js # Next.js configuration
βββ tailwind.config.js # Tailwind CSS configuration
βββ tsconfig.json # TypeScript configuration
yarn build
# or
npm run buildThis creates an optimized production build in the .next folder.
yarn start
# or
npm startStarts the server on http://localhost:3000
# Build the Docker image
docker build -t crm-web .
# Run the container
docker run -p 3000:3000 \
-e NEXT_PUBLIC_API_URL=http://your-api-url \
crm-web# Run all tests
yarn test
# or
npm test
# Run tests in watch mode
yarn test:watch
npm run test:watch
# Run tests with coverage
yarn test:coverage
npm run test:coverage# Run E2E tests
yarn test:e2e
# or
npm run test:e2e
# Run E2E tests in UI mode (interactive)
yarn test:e2e:ui
npm run test:e2e:ui
# Run E2E tests in headed mode (see browser)
yarn test:e2e:headed
npm run test:e2e:headedTest files are located in:
src/tests/- Vitest unit/component teststests-examples/- Playwright E2E test examples
We welcome contributions! Please follow these guidelines:
- Clone the project to your local machine.
- Create a new branch with a descriptive name:
git checkout -b <your-initials>/<feature-or-issue>-
Make your changes and ensure code quality:
- Follow the existing code style and patterns
- Write clear, well-documented code
- Ensure tests pass before pushing
-
Commit your changes with clear messages:
git commit -m "feat: add new feature"
# or
git commit -m "fix: resolve issue with component"- Push your branch to the repository:
git push -u origin <branch-name>- Open a pull request with:
- Clear description of changes
- Reference to related issues
- Screenshots if UI changes are involved
yarn build to ensure the production build succeeds.
- Follow the existing code architecture and patterns
- Use TypeScript for type safety
- Write meaningful variable and function names
- Add comments for complex logic
- Keep components focused and reusable
- Use Tailwind CSS for styling
<type>: <description>
<optional body>
<optional footer>
Types: feat, fix, docs, style, refactor, test, chore
Example: feat: add user profile page
- Next.js - React framework for production
- TypeScript - Type-safe JavaScript
- React - UI library
- Tailwind CSS - Utility-first CSS framework
- Axios - HTTP client
- NextAuth.js - Authentication
- Vitest - Unit testing framework
- Playwright - E2E testing framework
- Redux - State management (optional)