This is a pet project leveraging GitHub Actions and the MERN stack (MongoDB, Express.js, React.js, Node.js) for API development.
Public Docker Image of this project - 📥Download
The aim of this project is to help understand the usage of GitHub Actions along with the MERN stack to develop a robust API. Docker is used to ensure the application runs seamlessly in any environment.
Ensure you have the following installed on your local machine:
-
Clone the Repository
Start by cloning the repository to your local machine
git clone https://github.com/chamindu36/nasa-pet-project.git cd nasa-pet-project
-
Build the Docker Image
Next, build the Docker image using the following command:
docker build . -t <USERNAME>/nasa-pet-project
Be sure to replace
<USERNAME>
with your DockerHub username. -
Run the Docker Image
Finally, run the Docker image using the following command:
docker run -it -p 8000:8000 <USERNAME>/nasa-pet-project
Again, replace
<USERNAME>
with your DockerHub username. The application will then be accessible athttp://localhost:8000
.
This project has a client-server structure, with each having its own separate dependencies. Below are the npm scripts to manage these dependencies, start the servers, and deploy the project.
To install dependencies for the server, run:
npm run install-server
To install dependencies for the client, run:
npm run install-client
To install dependencies for both client and server, run:
npm run install
To start the server, run:
npm run server
To start the client, run:
npm run client
To start both the server and the client at the same time, run:
npm run watch
To build the client and start the server, run:
npm run deploy
To build the client and start the server in cluster mode, run:
npm run deploy-cluster
To run tests for the server, use:
npm run test
Please replace npm
with yarn
if you're using yarn as your package manager.
Please feel free to fork this repository, make some changes, and submit pull requests. Feedback is welcome and appreciated!