https://github.com/asfer-dev/full-stack-test-backend
https://github.com/asfer-dev/full-stack-test-backend
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/asfer-dev/full-stack-test-backend
- Owner: Asfer-dev
- Created: 2024-12-01T14:40:55.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-02T07:37:55.000Z (over 1 year ago)
- Last Synced: 2025-04-06T05:33:04.359Z (about 1 year ago)
- Language: JavaScript
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Node.js WebSocket and MongoDB Server
This is a Node.js server that integrates WebSocket functionality, MongoDB for database storage, and RESTful API endpoints for managing submissions. The server is built with Express and uses Mongoose for interacting with MongoDB.
## Features
- WebSocket server for real-time communication
- RESTful API to handle CRUD operations for submissions
- MongoDB integration for storing and retrieving data
- Middleware for handling CORS and JSON requests
## Prerequisites
Ensure you have the following installed:
- [Node.js](https://nodejs.org/) (v14.18.0 or higher)
- [MongoDB](https://www.mongodb.com/)
- [npm](https://www.npmjs.com/) or [Yarn](https://yarnpkg.com/)
## Getting Started
### 1. Clone the Repository
Clone this repository to your local machine:
```bash
git clone https://github.com/Asfer-dev/full-stack-test-backend.git
cd full-stack-test-backend
```
### 2. Install Dependencies
Install the required dependencies:
```bash
npm install
```
### 3. Set Up Environment Variables
Create a .env file in the root directory and add your MongoDB connection string:
```env
MONGO_URI=your_mongo_connection_string
PORT=5000
```
### 4. Start the Server
Start the server:
```bash
npm start
```
The server will start and listen on the port defined in your .env file or default to 5000.