Skip to content

YashvardhanKumar/coderacer

Coderacer

A problem solving platform where you can practice questions for Online Assessments and Interviews

Precommit Checks

This project has automated precommit checks enabled using Husky and lint-staged:

  • ESLint: Code quality checks for all TypeScript/JavaScript files
  • Prettier: Automatic code formatting
  • Commitlint: Ensures commit messages follow conventional standards

The checks run automatically before each commit to maintain code quality.

Prerequisites

Install the following

Quick Start

  1. Clone this repository:

    git clone https://github.com/YashvardhanKumar/coderacer.git
    cd coderacer
  2. Run the following commands from the root directory

    • cd client/user && yarn
    • cd client/contributor && yarn
    • cd server && yarn
  3. Start all services with a single command:

    docker-compose up -d

    This will start all containers in detached mode.

  4. Access the application:

    http://localhost
    

Components

This application uses several Docker containers:

  • Frontend: User interface for the coding platform
  • Backend API: Handles user requests and business logic
  • Database: Stores user data, challenges, and results
  • Nginx: Acts as a reverse proxy and serves static files

Common Commands

View logs

# View logs for all services
docker-compose logs

# View logs for a specific service
docker-compose logs [service_name]

# Follow logs in real-time
docker-compose logs -f

Stop the application

docker-compose down

Rebuild containers after file changes

docker-compose build
docker-compose up -d

Configuration

The application can be configured through environment variables in the docker-compose.yml file.

Development

Local Development Setup

To make changes to the application:

  1. Install dependencies: npm install (from root directory)
  2. Install app-specific dependencies:
    • User app: cd client/user && npm install
    • Contributor app: cd client/contributor && npm install
    • Server: cd server && npm install
  3. Start development servers:
    • User app: npm run dev:user
    • Contributor app: npm run dev:contributor
    • Server: npm run dev:server

Docker Development

Alternatively, use Docker for development:

  1. Modify the source code
  2. Rebuild the containers with docker-compose build
  3. Restart with docker-compose up -d

Development Workflow

  1. Create a feature branch: git checkout -b feature/your-feature
  2. Make your changes
  3. Stage changes: git add .
  4. Commit with conventional message: git commit -m "feat: Add your feature"
  5. Push and create a pull request

Commit Message Format

Follow the Conventional Commits specification:

  • feat: - New features
  • fix: - Bug fixes
  • docs: - Documentation changes
  • style: - Code style changes (formatting, missing semicolons, etc)
  • refactor: - Code changes that neither fix bugs nor add features
  • test: - Adding or updating tests
  • chore: - Maintenance tasks

Quality Assurance

This project enforces code quality through:

  • Precommit hooks: Prettier formatting and linting run automatically
  • CI/CD pipeline: GitHub Actions verify all changes
  • Squash merge only: Keeps commit history clean

Troubleshooting

If you encounter any issues:

  • Check the logs with docker-compose logs
  • Ensure all required ports are available
  • Try restarting with docker-compose restart
  • For persistent problems, try docker-compose down -v followed by docker-compose up -d

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •