|
| 1 | +# Event Manager |
| 2 | + |
| 3 | +Event Manager is a web application for managing events. This application is built using Next.js and React, making it a flexible and efficient tool for handling events. It supports various features like calendar views, recurring events, and more. |
| 4 | + |
| 5 | +## Table of Contents |
| 6 | + |
| 7 | +- [Getting Started](#getting-started) |
| 8 | + - [Installation](#installation) |
| 9 | + - [Run](#run) |
| 10 | +- [Database](#database) |
| 11 | +- [Tools](#tools) |
| 12 | +- [Scripts](#scripts) |
| 13 | + |
| 14 | +## Getting Started |
| 15 | + |
| 16 | +### Docker |
| 17 | +Make sure you have installed Docker in your machine. \ |
| 18 | +With docker you just have to run one command from your terminal to run project.\ |
| 19 | +To persist data to database have to set environment variable in .env file. See .env.example |
| 20 | + |
| 21 | + |
| 22 | +MongoDB local connection issue: |
| 23 | + |
| 24 | +might cause issue: |
| 25 | +```bash |
| 26 | +mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.0.1 |
| 27 | +``` |
| 28 | + |
| 29 | +Replace `127.0.0.1` with `mongo` in URI. |
| 30 | + |
| 31 | +correct: |
| 32 | +```bash |
| 33 | +mongodb://mongo:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.0.1 |
| 34 | +``` |
| 35 | + |
| 36 | + |
| 37 | +```bash |
| 38 | +docker-compose up --build |
| 39 | +``` |
| 40 | + |
| 41 | + |
| 42 | +### Manuel setup |
| 43 | +Before you can use Event Manager, you need to install its dependencies. Follow these steps: |
| 44 | + |
| 45 | +1. Clone this repository to your local machine. |
| 46 | + |
| 47 | +```bash |
| 48 | +git clone <repository-url> |
| 49 | +cd event-manager |
| 50 | +``` |
| 51 | + |
| 52 | +### Installation |
| 53 | + |
| 54 | +First, install dependencies and initial setup: |
| 55 | + |
| 56 | +```bash |
| 57 | +npm i or yarn |
| 58 | + |
| 59 | +# then for setup pre-commit hook |
| 60 | + |
| 61 | +npm run setup:husky |
| 62 | + |
| 63 | +#or |
| 64 | + |
| 65 | +yarn setup:husky |
| 66 | +``` |
| 67 | + |
| 68 | +### Run |
| 69 | + |
| 70 | +Then, run the development server: |
| 71 | + |
| 72 | +```bash |
| 73 | +npm run dev |
| 74 | +# or |
| 75 | +yarn dev |
| 76 | +# or |
| 77 | +``` |
| 78 | + |
| 79 | +## Database |
| 80 | + |
| 81 | +Create a `.env` file in root directory. An example .env.example file added with key. |
| 82 | + |
| 83 | +Add your mongoDB uri in env file. |
| 84 | + |
| 85 | +#### Project is configured with Eslint config, prettier. If use Vscode editor, code will automatically show error on compile time and will format on save |
| 86 | + |
| 87 | + |
| 88 | +## Tools |
| 89 | + |
| 90 | +- [SWR](https://swr.vercel.app/) - Used for http request. SWR is a strategy to first return the data from cache (stale), then send the fetch request (revalidate), and finally come with the up-to-date data. |
| 91 | +- [REDUX-TOOLKIT](https://redux-toolkit.js.org/) - State management |
| 92 | +- [Redux-hook-form](https://react-hook-form.com/) - Form control |
| 93 | +- [ZOD](https://zod.dev/) - Zod is a TypeScript-first schema declaration and validation library. |
| 94 | +- [Recat Icons](https://react-icons.github.io/react-icons/) |
| 95 | +- [Date-fns](https://date-fns.org/) - Date utility |
| 96 | +- [React-big-calendar](https://github.com/jquense/react-big-calendar) |
| 97 | +- [DaisyUI](https://daisyui.com/) - Tailwind Css component library for default styling and theming |
| 98 | +- [React testing library](https://testing-library.com/) - For unit and integration test |
| 99 | +- Typescript |
| 100 | +- Mongoose |
| 101 | +- Husky - a pre-commit hook to run test and lint before commit |
| 102 | + |
| 103 | +## Script |
| 104 | + |
| 105 | +### Test |
| 106 | + To run test |
| 107 | + |
| 108 | + ```bash |
| 109 | + npm run test |
| 110 | + ``` |
| 111 | + |
| 112 | + To clear jest cache |
| 113 | + ```bash |
| 114 | + npm run test:clear |
| 115 | + ``` |
| 116 | + |
| 117 | + ### Prettify |
| 118 | + |
| 119 | + To manully format code |
| 120 | + |
| 121 | + ```bash |
| 122 | + npm run format |
| 123 | + ``` |
| 124 | + |
| 125 | + To check lint issue |
| 126 | + ```bash |
| 127 | + npm run lint |
| 128 | + ``` |
| 129 | + |
| 130 | + ### Other |
| 131 | + |
| 132 | + To find unused files or entrypoints |
| 133 | + ```bash |
| 134 | + npm run find:unused |
| 135 | + ``` |
| 136 | + |
| 137 | + To analyze the bundle size |
| 138 | + ```bash |
| 139 | + npm run analyze |
| 140 | + |
| 141 | + #or |
| 142 | + npm run analyze:server |
| 143 | + |
| 144 | + #or |
| 145 | + npm run analyze:browser |
| 146 | + ``` |
0 commit comments