micronation
micronation copied to clipboard
An online micronation based on r/place that had 120k user
Required tools
To run micronation, you will need :
Installation
First, clone the repository with :
git clone https://github.com/Sorikairox/micronation
Install all dependencies by using yarn install in back and front folders.
Copy .env.example content to a .env, .env.test.integration and .env.test.e2e file with your own configuration for each case.
Running the apps
The entire project is meant to be considered as an experiment, thus is made to be visited from the Fouloscopie plateform.
As a result, expose the front server on port 3500 and the back one on port 3000 and then visit https://preprod.fouloscopie.com/experiment/1
Back
Microservices are built with NestJS framework and use their scripts.
Before running, library must be built at least once with tsc --build library/tsconfig.json (or cd library && yarn tsc).
yarn start:devto run and watch for changesyarn startto run the appyarn testto run base testsyarn test:integrationto run integration testsyarn test:e2eto run end-to-end tests
Front
The Nuxt environnement is being used for the front integration, in addition with yarn scripts.
Go to the front folder and enter yarn to install all the dependencies.
Then, start the dev mode with yarn dev or build the entire project with yarn build.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
Naming conventions
We use DDD (Domain Driven Design) principles.
Ground rules
- The entrypoint is named
main.ts. - Every class must be defined in its own file.
- Files are named after the class they define (PascalCase). Example:
FlagRepository.tsis expected to contain the definition of theFlagRepositoryclass. - Files are sorted in folders that make a domain structure. Example:
flag/pixel/Pixel.tsis located in the domainpixelwhich is a subdomain of the domainflag.
Tests
- Test files are named after the class (PascalCase) or domain (kebab-case) they test and end with
.spec.ts,.spec-integration.tsor.spec-e2e.ts. Example:FlagService.spec-integration.tsis expected to contain all integration tests of theFlagServiceclass. - Test files are located in a
specfolder inside the domain folder they relate to. Example: all tests of stuff in the domainflagare located inflag/spec/. - End to end tests are located in the
testfolder at the root of the module.