This is the backend for a forum website, built with Node.js, Express, and MongoDB. It provides RESTful APIs for user management, discussions, and chat functionalities.
-
Clone the repository:
git clone https://github.com/yourusername/forum-website-backend.git cd forum-website-backend -
Install dependencies:
npm install
-
Create a
.envfile and add your environment variables:cp .env.example .env
-
Build the project:
npm run build
To start the server in development mode:
npm run devTo start the server in production mode:
To build and run the Docker container:
docker-compose up --buildGET /externalApi/user/ - Retrieve all users
GET /externalApi/user/:id - Retrieve a user by ID
PUT /externalApi/user/:id - Update a user by ID
GET /externalApi/discussion/ - Retrieve all discussions
POST /externalApi/discussion/ - Create a new discussion
GET /externalApi/chat/ - Retrieve all chat messages
POST /externalApi/chat/ - Send a new chat message