This repository is used to learn software engineering concepts and create proof of concepts (POC) using multiple programming languages. It uses NX as the monorepo management tool.
This repository follows the conventional NX monorepo structure:
apps/go-hello/: Go application exampleapps/java-hello/: Java application exampleapps/node-hello/: Node.js application exampleapps/ocaml-hello/: OCaml application exampleapps/python-hello/: Python application example
libs/go-hello-libs/: Go library examplelibs/java-hello-libs/: Java library examplelibs/node-hello-libs/: Node.js library examplelibs/ocaml-hello-libs/: OCaml library examplelibs/python-hello-libs/: Python library example
- Node.js (Latest LTS version recommended)
- It is recommended to use Volta for Node.js version management
- npm or yarn
- Go (1.21 or later)
- Java (JDK 21)
- OCaml (4.14.x)
- Python (3.12 or later)
- Poetry (for Python package management)
- Maven (for Java builds)
- OPAM (for OCaml package management)
- Clone the repository:
git clone https://github.com/wahidyankf/swe-learn.git
cd swe-learn- Install dependencies:
# Install Node.js dependencies
npm install
# Install Python dependencies
cd apps/python-hello && poetry install && cd ../..
cd libs/python-hello-libs && poetry install && cd ../..
# Install OCaml dependencies
opam install . --deps-only --with-test
opam install dune dream yojson re alcotest
# Install Java dependencies (Maven will handle this automatically during build)- Run a specific project:
# Node.js
npx nx serve node-hello
# Python
npx nx serve python-hello
# Java
npx nx serve java-hello
# Go
npx nx serve go-hello
# OCaml
npx nx serve ocaml-hello# Install dependencies
npm install
# Test affected projects
npm run test:affected # Run tests for affected projects
npm run test:affected:parallel # Run tests in parallel (faster)
# Build affected projects
npm run build:affected
# Lint and type check
npm run lint:affected # Lint affected projects
npm run typecheck:affected # Type check affected projects
# Visualize affected projects
npm run affected:graph # Show dependency graph of affected projects
# OCaml specific commands
npm run apps:ocaml-hello:build # Build OCaml application
npm run apps:ocaml-hello:test # Test OCaml application
npm run apps:ocaml-hello:dev # Run OCaml application in development mode
npm run libs:ocaml-hello-libs:build # Build OCaml library
npm run libs:ocaml-hello-libs:test # Test OCaml library- Install dependencies:
npm install - Make your changes
- Before committing:
- Run
npm run affected:graphto see which projects are affected - Run
npm run test:affected:parallelto test affected projects - Run
npm run typecheck:affectedto check types - Git hooks will automatically:
- Format your code using Prettier (JavaScript/TypeScript)
- Format Python code (when Python files are staged)
- Format Go code
- Format Java code
- Format OCaml code
- Validate your commit message (see Commit Convention below)
- Run
The project uses various formatters for different languages:
- JavaScript/TypeScript: Prettier
- Python: Black
- Go:
go fmt - Java:
google-java-format - OCaml:
ocamlformat
These are automatically run via pre-commit hooks when you stage files.
This repository follows the Conventional Commits specification. Commit messages must follow this pattern:
type(scope): subject
body
Types:
feat: A new featurefix: A bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code changes that neither fix a bug nor add a featureperf: Performance improvementstest: Adding or updating testschore: Changes to build process or auxiliary toolsci: Changes to CI configuration files and scripts
Examples:
feat(auth): add login functionality
fix(api): handle null response from server
docs(readme): update installation instructions
The project uses GitHub Actions for continuous integration. The CI pipeline:
- Runs on every push and pull request
- Tests all affected projects
- Builds all affected projects
- Runs linting and type checking
- Ensures code formatting is consistent
This project is licensed under the MIT License - see the LICENSE file for details.