Skip to content

Slightly-Techie/crm-web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

488 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Slightly Techie CRM - Web Frontend

Status GitHub issues GitHub pull requests License


Frontend for Slightly Techie CRM built with Next.js

πŸ“ Table of Contents

About

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.

🏁 Getting Started

Prerequisites

  • 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)

Installation

Step 1: Clone the repository

git clone https://github.com/Slightly-Techie/crm-web.git
cd crm-web

Or with GitHub CLI:

gh repo clone Slightly-Techie/crm-web

Step 2: Install dependencies

yarn install
# or
npm install

Step 3: Set up environment variables

Create 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_here

Note: NEXT_PUBLIC_ prefix makes variables available in the browser. Sensitive secrets should NOT use this prefix.

Step 4: Run the development server

yarn dev
# or
npm run dev

Open 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.

βš™οΈ Project Structure

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

πŸ—οΈ Building & Deployment

Build for Production

yarn build
# or
npm run build

This creates an optimized production build in the .next folder.

Start Production Server

yarn start
# or
npm start

Starts the server on http://localhost:3000

Docker Deployment

# 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

πŸ§ͺ Testing

Unit & Component Tests (Vitest)

# 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

End-to-End Tests (Playwright)

# 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:headed

Test files are located in:

  • src/tests/ - Vitest unit/component tests
  • tests-examples/ - Playwright E2E test examples

✏️ Contributing

We welcome contributions! Please follow these guidelines:

How to Contribute

  1. Clone the project to your local machine.
  2. Create a new branch with a descriptive name:
git checkout -b <your-initials>/<feature-or-issue>
  1. Make your changes and ensure code quality:

    • Follow the existing code style and patterns
    • Write clear, well-documented code
    • Ensure tests pass before pushing
  2. Commit your changes with clear messages:

git commit -m "feat: add new feature" 
# or
git commit -m "fix: resolve issue with component"
  1. Push your branch to the repository:
git push -u origin <branch-name>
  1. Open a pull request with:
    • Clear description of changes
    • Reference to related issues
    • Screenshots if UI changes are involved

⚠️ Important: Test your changes locally before pushing. Run yarn build to ensure the production build succeeds.

Code Style Guidelines

  • 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

Commit Message Format

<type>: <description>

<optional body>
<optional footer>

Types: feat, fix, docs, style, refactor, test, chore

Example: feat: add user profile page

⛏️ Built Using

πŸš€ Learn More

Packages

 
 
 

Contributors

Languages