This project is a Calendar Event Management System that allows users to create, view, and delete training events. The system is built using React for the frontend and Node.js with Express for the backend. It also includes user authentication using JSON Web Tokens (JWT).
- User authentication (login and signup)
- View calendar with events
- Create new events
- Delete events
- Persist data in a MySQL database
- Node.js
- MySQL
- React
- Ant Design
-
Clone the repository:
git clone https://github.com/your-username/your-repo-name.git cd your-repo-name
-
Install the backend dependencies:
cd backend npm install
-
Create a
.env
file in thebackend
directory with the following content:DATABASEHOST=your_database_host DATABASEUSER=your_database_user DATABASEPASSWORD=your_database_password USERSECRETKEY=your_jwt_secret_key
-
Start the backend server:
node server.js
-
Navigate to the frontend directory:
cd ../frontend
-
Install the frontend dependencies:
npm install
-
Start the frontend server:
npm start
server.js
: Main server file, defines API endpoints.package.json
: Contains backend dependencies and scripts..env
: Environment variables for database and JWT.
src/CalendarView.js
: Main React component for the calendar view.src/CreateEventModal.js
: React component for creating new events.src/App.js
: Main application file.src/index.js
: Entry point for the React application.src/CalenderView.css
: CSS file for styling the calendar view.package.json
: Contains frontend dependencies and scripts.
POST /login
: Authenticates a user and returns a JWT token.POST /signup
: Registers a new user and returns a JWT token.
POST /GetEvent
: Retrieves events for the authenticated user.POST /CreateEvent
: Creates a new event for the authenticated user.POST /RemoveEvent
: Deletes an event for the authenticated user.
- Navigate to the login page.
- Enter your username and password to log in.
- If you don't have an account, go to the signup page to create a new account.
- Right-click on a date in the calendar to open the event creation modal.
- Fill in the event details and click "OK" to save the event.
- Click on an event card to view the event details.
- Click the delete button to remove an event.
- Fork the repository.
- Create your feature branch (
git checkout -b feature/your-feature
). - Commit your changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature/your-feature
). - Open a pull request.
This project is licensed under the MIT License.
Feel free to reach out if you have any questions or suggestions!