diff --git a/.dockerignore b/.dockerignore index d4d8f0e..047eb2c 100644 --- a/.dockerignore +++ b/.dockerignore @@ -23,4 +23,4 @@ **/dist LICENSE README.md -**/public/__env.js \ No newline at end of file +**/public/__env.js diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..0b25239 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,2 @@ +# These owners will be the default owners for everything in the repo. +* @muriukialex @effiecancode diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..35c1043 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,5 @@ +## Contributing Guide + +- Fork the application, add your changes and make a [PR/MR](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) + +Contributions are highly welcome! \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 8644b9a..57ce3a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,5 @@ FROM node:18-alpine as base -RUN apk add --no-cache g++ make py3-pip libc6-compat - WORKDIR /app COPY package*.json ./ @@ -22,10 +20,7 @@ WORKDIR /app ENV NODE_ENV=production # Install only production dependencies -RUN npm ci --only=production - -# Install pm2 process manager -RUN npm install pm2@latest -g +RUN npm ci --omit=dev RUN addgroup -g 1001 -S nodejs RUN adduser -S nextjs -u 1001 @@ -38,7 +33,8 @@ COPY --from=builder --chown=nextjs:nodejs /app/next.config.mjs ./ COPY --from=builder /app/node_modules ./node_modules COPY --from=builder /app/package.json ./package.json COPY --from=builder /app/public ./public -COPY --from=builder /app/.env.production ./.env +COPY --from=builder /app/.env.local ./.env +COPY --from=builder /app/entrypoint.sh ./entrypoint.sh EXPOSE 3000 diff --git a/Makefile b/Makefile index 669e4c0..ad05635 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,8 @@ -SERVICE_NAME = aws-rstart-labs - start-app: docker-compose up tear-app: - docker-compose down --rmi $(SERVICE_NAME) + docker-compose down --rmi all # Phony targets to avoid conflicts with file names -.PHONY: start-app tear-app \ No newline at end of file +.PHONY: start-app tear-app diff --git a/README.md b/README.md index c04f6b0..5c0db35 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,36 @@ -This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). +# Keep Track of AWS r/Start Labs + +- This application is designed to help AWS r/Start students to keep track of their AWS r/Start Labs. + +## Overview + +### Sign In +- Sign In with Google + +### Track Labs as Completed + +### Update Lab Completed Status + ## Getting Started -First, run the development server: +1. Clone the project + ```bash + git clone https://github.com/muriukialex/aws-rstart-labs.git +``` + +2. Install dependencies +```bash +npm install +``` + +3. Update your `.env.local` file with your enviroment variables which also includes a [MONGODB_URI](https://www.mongodb.com/basics/mongodb-connection-string#:~:text=How%20to%20get%20your%20MongoDB,connection%20string%20for%20your%20cluster.) +```bash +cp .env.example .env.local +``` +NB: Ensure you update your environent variables before starting the server + +3. Run the development server: ```bash npm run dev @@ -14,31 +42,21 @@ pnpm dev bun dev ``` +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. + If you are using Docker: +Ensure you have [make](https://www.gnu.org/software/make/manual/make.html) installed `make --version` +- Build and run the Docker container ```bash -docker build -t . - -docker run --name -p 3000:3000 -d +make start-app ``` -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. - -You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. - -This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. - -## Learn More - -To learn more about Next.js, take a look at the following resources: - -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. -- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. - -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! - -## Deploy on Vercel +- Tear down the Docker container +```bash +make tear-app +``` -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. +## Contributing +- See [CONTRIBUTING.md](https://github.com/muriukialex/aws-rstart-labs/blob/main/CONTRIBUTING.md) instructions on how to contribute. -Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/entrypoint.sh b/entrypoint.sh index 555270e..598d887 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,7 +1,7 @@ #!/bin/sh -# run npm run dev through pm2 -pm2 start npm -- run dev +# run npm run start through pm2 +pm2 start npm -- run start # show logs -pm2 logs \ No newline at end of file +pm2 logs