What is used:
- .Net 6
- React 18
- CQRS + MdeiatR
- Polly and Retry
- Caching
- Logging with Serilog
- Exception Handling
- MediatR Pipelines
- AutoMapper
- NUnit / FluentAssertions / AutoFixture / Moq / MockHttp
To Do:
- Polly
- Unit tests
- Authentication
- Rate limiting
- Api versioning
- Upgrade to SpaceX api v4
How to run:
git clone https://github.com/moslem-hadi/SpaceX-Launches.git
Then go to the folder:
cd SpaceX-Launches
And run docker compose:
docker-compose up -d
Make sure that ports 3000 and 7034 are free
Another approach is to:
- open the backend solution and run the SpaceXLaunches.WebApi project on port 7034
- open frontend project in cmd and run
npm i
npm start
I used .Net 6 and I have 4 projects:
This structure is based on a clean architecture solution. the Infrastructure layer is responsible for implementing the Application layer.
I used MediatR to make my controllers cleaner. used Polly to retry calling the SpaceX API. (e.g. in SpaceXApiService.GetLaunches)
I used MemoryCache to cache some data(e.g. GetOneLaunchQuery.Handle)
I used Serilog for logging and I have a performance logging and a global exception handler that logs errors.
I used AuthoMapper to map Models to DTOs.
For testing, I used NUnit, FluentAssertions, AutoFixture, Moq, and MockHttp
For the frontend, I used React. I called the app SpaceXplorer(SpaceX + explorer) 😁
And I have a few components and a service to call my API.
I used pagination and Infinite scroll, so as you scroll down, new data will be fetched.
For the View page, I just used my design from the first page to save some time.