This is a template Node.js application built with Express and MongoDB, providing API endpoints for authentication.
Before running the application, make sure you have the following software installed on your system:
- Node.js (v14 or higher)
- MongoDB (running locally or accessible remotely)
- Docker (see the docker-instructions.md file)
git clone https://github.com/Maxzurek/node-docker-nginx-template.git
cd node-docker-nginx-template
npm install
- Create a
.env.prod
and.env.dev
file in the project root directory. - Copy the content of
.env.example
into.env.prod
and.env.dev
. - Update the values of the environment variables according to your configuration.
This project is using OAuth2 with nodemailer to send confirmation emails. Make sure you (Setup OAuth2) and to update the values of the .env.* OAUTH2_ variables accordingly.
- // TODO s were added throughout the application files. Make sure to check them out to ensure that the application is working properly.
- If you are using VSCode, you can use an extension like (Todo Tree) to spot them easily
npm run dev
This will start the server at http://localhost:<port-number-from.env.dev>.
POST /auth/register
: Register a new user.POST /auth/login
: Log in with existing credentials.GET /auth/verify-email/:verificationCode
: Verify user email address.POST /auth/resend-verification-email
: Resend verification email.
Refer to the docker-instructions.md file to run or configure docker.
This project is licensed under the (MIT License.)