This is the repository for the new ASPC website.
Haram Yoon, Cole Uyematsu, Vadym Musiienko, Kartika Santoso, Abrar Yaser
-
Clone the repository:
git clone https://github.com/yourusername/aspc-website-v2.git cd aspc-website-v2
-
Navigate to the frontend folder and install dependencies:
cd frontend npm install
-
Start the frontend development server:
npm run dev
-
Open a new terminal, navigate to the backend folder and install dependencies:
cd backend npm install
-
Start the backend server:
npm run dev
-
Open your browser and go to
http://localhost:3000
to see the website.
-
Build the container:
cd backend docker build -t aspc-backend .
-
Run your new container, you can change the port from 5001 to any port available. This will be the port your docker container connects to. Make sure to insert the correct environment variables.
docker run -p 5001:5000 \ -e MONGODB_URI="mongodb+srv://{user}:{password}@aspc.qm4l8.mongodb.net/school-platform?retryWrites=true&w=majority&appName=ASPC" \ -e NEXT_PUBLIC_TINYMCE_API_KEY="{key}" \ aspc-backend
-
Clear all previous builders:
docker buildx rm mybuilder || true
-
Create a new builder, you can name it anything:
docker buildx create --use --name mybuilder
-
Build the container and push it to dockerhub:
docker buildx build \ --platform linux/amd64 \ -t aspcsoftware/aspc-backend:latest \ --push \ .
-
Check architecture (has to be linux amd64 for Amazon Lightsail):
docker manifest inspect aspcsoftware/aspc-backend:latest
-
Deploy on lightsail using this image reference:
docker.io/aspcsoftware/aspc-backend:latest