A Node.js application with Google OAuth, JWT authentication, WebSockets, and deployment on Amazon EC2. public IPv4 : 13.211.211.38
This Node.js application is designed to demonstrate several key features for modern web development:
-
Google OAuth Authentication: Users can # using their Google accounts, ensuring a secure and streamlined login process.
-
JWT Authentication: JSON Web Tokens are used to authenticate users and protect API endpoints, enhancing security.
-
WebSockets: Real-time communication is achieved through WebSockets, enabling instant updates and collaboration within the application.
-
Amazon EC2 Deployment: The application can be easily deployed to Amazon Elastic Compute Cloud (EC2) for scalability and reliability.
- User authentication with Google OAuth.
- JWT-based authentication for API endpoints.
- Real-time updates and messaging using WebSockets.
- Scalable deployment on Amazon EC2.
Before you begin, ensure you have met the following requirements:
- Node.js and npm installed on your local machine.
- A MongoDB database to store application data.
- A Google Developer Console project with OAuth credentials.
To install and run this application locally, follow these steps:
-
Clone the repository:
git clone https://github.com/yourusername/your-repo.git
-
Install dependencies:
cd your-repo npm install
-
Set up your configuration (see Configuration section below).
-
Start the application:
npm start
Before running the application, you need to configure it:
-
Create a
.env
file in the project root with the following environment variables:MONGODB_URI=<Your MongoDB URI> GOOGLE_CLIENT_ID=<Your Google OAuth Client ID> GOOGLE_CLIENT_SECRET=<Your Google OAuth Client Secret> JWT_SECRET=<Your JWT Secret>
-
Configure WebSocket settings in
config/websocket.js
if needed.
-
Access the application by navigating to
http://localhost:3000
in your web browser. -
# with your Google account to access the application's features.
-
Use the real-time messaging and collaboration features provided by WebSockets.
To deploy this application on Amazon EC2, follow these general steps:
-
Provision an EC2 instance and ensure it has Node.js, MongoDB, and other required dependencies installed.
-
Clone your repository onto the EC2 instance.
-
Configure your production environment variables on the EC2 instance.
-
Run the application on the EC2 instance.
For detailed deployment instructions, refer to Amazon EC2 documentation or specific deployment guides.