A problem solving platform where you can practice questions for Online Assessments and Interviews
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.
Install the following
-
Clone this repository:
git clone https://github.com/YashvardhanKumar/coderacer.git cd coderacer -
Run the following commands from the root directory
cd client/user && yarncd client/contributor && yarncd server && yarn
-
Start all services with a single command:
docker-compose up -d
This will start all containers in detached mode.
-
Access the application:
http://localhost
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
# 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 -fdocker-compose downdocker-compose build
docker-compose up -dThe application can be configured through environment variables in the docker-compose.yml file.
To make changes to the application:
- Install dependencies:
npm install(from root directory) - Install app-specific dependencies:
- User app:
cd client/user && npm install - Contributor app:
cd client/contributor && npm install - Server:
cd server && npm install
- User app:
- Start development servers:
- User app:
npm run dev:user - Contributor app:
npm run dev:contributor - Server:
npm run dev:server
- User app:
Alternatively, use Docker for development:
- Modify the source code
- Rebuild the containers with
docker-compose build - Restart with
docker-compose up -d
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes
- Stage changes:
git add . - Commit with conventional message:
git commit -m "feat: Add your feature" - Push and create a pull request
Follow the Conventional Commits specification:
feat:- New featuresfix:- Bug fixesdocs:- Documentation changesstyle:- Code style changes (formatting, missing semicolons, etc)refactor:- Code changes that neither fix bugs nor add featurestest:- Adding or updating testschore:- Maintenance tasks
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
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 -vfollowed bydocker-compose up -d
This project is licensed under the MIT License - see the LICENSE file for details.