Welcome to the frontend for Aftermath Archive, an Incident Management web application.
This backend is hosted on Render and integrates with the frontend hosted on Netlify.
It utilizes a MongoDB database, managed through MongoDB Atlas, to store and retrieve application data.
- Frontend URL:
aftermath-archive.xyz
- Backend URL:
api.aftermath-archive.xyz
https://github.com/Aftermath-Archive/backend
https://github.com/Aftermath-Archive/docker-deployment
For students, or teachers who are viewing this repo in the context of the Coder Academy final assignment I have created a separate branch 'project-submission' available here.
This branch captures the projects state at time of submission while future work is undergone on the project.
This guide outlines the steps to deploy the frontend of the Aftermath Archive application to a production environment. The guide assumes you are using a modern hosting platform like Netlify, Vercel, or a custom hosting provider that supports static websites built with React/Vite.
-
Node.js: Ensure you have Node.js (version 16.x or higher) installed on your machine.
-
NPM/Yarn: A package manager like npm or yarn.
-
Frontend Source Code: Access to this GitHub repository containing the frontend code.
-
Environment Variables: Make sure you have all necessary environment variables (e.g., API keys) defined for the build and runtime.
git clone https://github.com/Aftermath-Archive/frontend
cd frontend
Run the following command to install the required dependencies:
npm install
Create a .env file in the root directory based on the existing .env.example
and define the required variables:
VITE_API_URL=your-backend-api-url
Note: Replace your-backend-api-url
with actual values.
Generate a production build of the application:
npm run build
This will create a dist/ folder containing the optimized static files.
-
Log in to your Netlify account and create a new site.
-
Connect your GitHub repository or drag and drop the dist/ folder into the Netlify dashboard.
-
Set the Build Command to:
npm run build
-
Set the Publish Directory to:
dist
-
Add any required environment variables in the “Environment” section of your site settings.
-
Deploy the site.
- Upload the contents of the dist/ folder to your custom hosting service (e.g., AWS S3, Firebase Hosting, or Nginx).
- Configure your web server to serve index.html for all routes (for React single-page applications).
- Add environment variables via the hosting provider’s dashboard (if applicable).
-
Confirm Docker Installed Download available for Docker for Mac, Windows, and Linux.
-
Cloud Hosting (Optional)
If deploying to a cloud service, ensure you have an instance/server on platforms such as:
- AWS EC2
- Azure Virtual Machine
- Google Cloud Platform Compute Engine
- Digital Ocean
- Render
- Railway
- etc
-
Build the Docker Image
Run the` following command in the root of the backend project:
docker build -t aftermath-archive-frontend .
-
Run the container locally
To test the container on your local machine, run:
docker run --env-file .env -p 8080:80 aftermath-archive-frontend
--env-file .env
: Loads the environment variables from .env.-p 8080:4000
: Maps port 80 of the container to 8080 on your local machine.
For easier setup, a docker-compose.yml
file for both front and backend is available here.
- Visit the deployed URL and test all major features to ensure everything is functioning as expected.
- Verify API integration, UI responsiveness, and environment-specific configurations.
- Ensure VITE_API_URL is correctly set and accessible from the deployed environment.
- Configure your server to fallback to index.html for non-root routes.
- Verify that all environment variables are correctly set in your hosting service.
By following this guide, you will have the Aftermath Archive frontend successfully deployed and running in a production environment.