This project is a backend service for a calendar application. It provides APIs to manage events, users, and notifications. The backend is built using Node.js and Express, and it uses MongoDB for data storage.
To install and run the project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/yourusername/Calendar_BackEnd.git cd Calendar_BackEnd -
Install the dependencies:
npm install -
Create a
.envfile in the root directory and add your environment variables:
JWT_SECRET=your_jwt_secret
To start the application in development mode, run:
npm run dev
To start the application in production mode, run:
npm start
The application will be available at http://localhost:3000.
app.js: Main application file where the Express app is configured.bin/www: Script for starting the server.routes/: Directory containing route handlers.login.js: Route handler for login and fetching calendar events.marks.js: Route handler for marks.
views/: Directory containing Pug templates for rendering HTML.error.pug: Template for error pages.index.pug: Template for the index page.layout.pug: Template for the layout.
public/stylesheets/: Directory containing CSS files.vercel.json: Configuration file for deploying to Vercel.
- URL:
/login - Method:
POST - Description: Authenticates the user and fetches calendar events.
- Request Body:
{
"data": {
"user": "username",
"pwd": "password",
"fromDate": "YYYY-MM-DD",
"toDate": "YYYY-MM-DD"
}
} - Response:
{
"token": "jwt_token",
"events": [
{
"StartTime": "YYYY-MM-DD",
"EndTime": "YYYY-MM-DD",
"Modulo": "module_name"
} ]
}
- URL:
/marks - Method:
GET - Description: Fetches marks.
- Response:
WIP
This project is configured to be deployed on Vercel. The vercel.json file contains the necessary configuration.
This project is licensed under the MIT License.