Aim is to develop a mail inbox applica?on
there is the api layer and frontend layer, api layer is done with nodejs while the frontend layer is done with reactjs.
The api_layer
folder contains the backend code responsible for handling API requests and serving data to the frontend application. It acts as the server-side component of the project. The API layer provides the following routes and endpoints:
/login
: Handles user authentication and login./messages/:userId
: Retrieves all messages belonging to a specific user./messages/inbox/:messageId
: Retrieves a specific message from the user's inbox.
To start using the API, follow these steps:
-
Copy the
.env.example
file and rename it to.env
. This file contains the environment variables required for the API configuration. inside the database url should be provided -
Install the necessary dependencies by running the following command:
npm install
-
to start server:
node server.js
-
the server would be listening on port 3001
For detailed information about the API's routes, endpoints, request/response formats, and error handling, please refer to the API Documentation.
The frontend
folder contains the client-side code responsible for the user interface and interaction with the API. It represents the frontend or user-facing component of the project. The frontend code is written using React.js
The frontend application includes the following main components:
- login: displays an interface to input a name
- Home: Displays a welcome message and a summary of the user's messages.
- Inbox: Shows a list of messages for the entered user.
- MessageView: Displays the detailed content of a selected message.
To start using the API, follow these steps:
-
Copy the
.env.example
file and rename it to.env
. This file contains the environment variables required for the frontend which is the api url -
Install the necessary dependencies by running the following command:
npm install
-
to start server:
npm start
-
the frontend would be started on port 3000