This project is a full-stack chat management system built with a React frontend and an Express backend, along with MongoDB for data storage.
- Node.js (v20.6.0 or higher) installed on your system (required to support the
--env-file
and--watch
options in your backend scripts) - MongoDB instance or MongoDB Atlas setup
- npm or yarn package manager
You can clone this repository from GitHub using the following command:
git clone https://github.com/deividas-butkus/galutinis-projetas-CA.git
After cloning the repository, follow the setup instructions below for both the frontend and backend.
- React
- React Router DOM
- Material UI
- Styled Components
- Vite (for development)
-
Navigate to the
client
directory:cd client
-
Install dependencies:
npm install
-
Run the development server:
npm run dev
-
The app will run by default at
http://localhost:5173
unless otherwise configured.
- Express
- MongoDB
- CORS
- Environment variables
- Node.js v20.6.0 or higher: This version is required to support the
--env-file
and--watch
options in the development script.
-
Navigate to the
server
directory:cd server
-
Install dependencies:
npm install
-
Copy the provided
.env.example
file and rename it to.env
:cp .env.example .env
-
Change the provided
.env.example
file to.env
and update it with your configuration details:SERVER_PORT=5001 CLIENT_PORT=5173 DB_USER=<your_db_username> DB_PASSWORD=<your_db_password> DB_CLUSTER=<your_cluster_name> DB_NAME=<your_database_name>
Ensure that your MongoDB credentials and cluster information are filled in correctly.
-
Run the backend server:
npm run dev
-
The backend server will run on
http://localhost:5001
by default.
-
client/src/components
:atoms
: Contains reusable components likeAvatar
,Button
,Counter
and others.molecules
: Contains reusable components likeChatCard
,MessageCard
,InputWithLabels
and others.organisms
: Contains specific main components likeChat
,Chats
,Contacts
, and others, which are wrapped withFooter
, andHeader
inApp
routes usingtemplates
folder containingLayout
.
-
server/src/routes
: Contains Express routes likeusers.js
,chats.js
,messages.js
for handling API requests.
-
Ensure both frontend and backend servers are running:
- Frontend at
http://localhost:5173
- Backend at
http://localhost:5001
- Frontend at
-
The client communicates with the server for book-related data using REST APIs.
npm run dev
: Runs the Vite development server.npm run build
: Builds the production-ready files.
npm run dev
: Runs the Express backend server using the.env
configuration.
This project is licensed under the ISC License.