Skip to content

Commit 7d11ce4

Browse files
committed
Project initialized: nextJs, Typescript, DaisyUi, Redux, MongoDB, Jest, Cypress, Eslint, Prettier, Dockerized
0 parents  commit 7d11ce4

File tree

90 files changed

+2623
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+2623
-0
lines changed

.dockerignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Dockerfile
2+
.dockerignore
3+
node_modules
4+
npm-debug.log
5+
README.md
6+
.next
7+
docker
8+
.git

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
MONGODB_URI=mongodb://mongo:27017/_rest_of_the_uri

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.css
2+
*.svg

.eslintrc.json

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"commonjs": true,
5+
"jest": true,
6+
"es6": true
7+
},
8+
"extends": ["eslint:recommended", "next", "prettier"],
9+
"plugins": ["eslint-plugin-prettier", "unused-imports"],
10+
"ignorePatterns": ["node_modules/", ".next/"],
11+
"settings": {
12+
"react": {
13+
"pragma": "React",
14+
"version": "18"
15+
}
16+
},
17+
"parserOptions": {
18+
"sourceType": "module",
19+
"project": "./tsconfig.json",
20+
"ecmaFeatures": {
21+
"experimentalObjectRestSpread": true,
22+
"jsx": true
23+
}
24+
},
25+
"rules": {
26+
"no-undef": "error",
27+
"no-unused-vars": 0,
28+
"unused-imports/no-unused-imports": "error",
29+
"indent": [
30+
"off",
31+
2,
32+
{
33+
"SwitchCase": 1,
34+
"flatTernaryExpressions": true
35+
}
36+
],
37+
"linebreak-style": ["error", "unix"],
38+
"quotes": [
39+
"error",
40+
"single",
41+
{
42+
"avoidEscape": true,
43+
"allowTemplateLiterals": false
44+
}
45+
],
46+
"semi": ["error", "never"],
47+
"react/prop-types": 0,
48+
"react/no-unknown-property": 0,
49+
"no-mixed-spaces-and-tabs": 0,
50+
"no-console": 0,
51+
"no-irregular-whitespace": 0,
52+
"prettier/prettier": [
53+
"error",
54+
{
55+
"arrowParens": "avoid",
56+
"bracketSpacing": true,
57+
"htmlWhitespaceSensitivity": "css",
58+
"insertPragma": false,
59+
"bracketSameLine": false,
60+
"jsxSingleQuote": false,
61+
"parser": "typescript",
62+
"printWidth": 110,
63+
"proseWrap": "preserve",
64+
"requirePragma": false,
65+
"semi": false,
66+
"singleQuote": true,
67+
"tabWidth": 2,
68+
"trailingComma": "es5",
69+
"useTabs": false
70+
}
71+
]
72+
}
73+
}

.gitignore

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# package
16+
package-lock.json
17+
18+
# production
19+
/build
20+
21+
# misc
22+
.DS_Store
23+
*.pem
24+
25+
# debug
26+
npm-debug.log*
27+
yarn-debug.log*
28+
yarn-error.log*
29+
30+
# local env files
31+
.env
32+
.env*.local
33+
.env.production
34+
35+
# vercel
36+
.vercel
37+
38+
# typescript
39+
*.tsbuildinfo
40+
next-env.d.ts
41+
42+
# husky
43+
/.husky/

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.css
2+
*.svg
3+
*.json
4+
5+
README.md

.prettierrc.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"arrowParens": "avoid",
3+
"bracketSpacing": true,
4+
"htmlWhitespaceSensitivity": "css",
5+
"insertPragma": false,
6+
"bracketSameLine": false,
7+
"jsxSingleQuote": false,
8+
"parser": "typescript",
9+
"printWidth": 110,
10+
"proseWrap": "preserve",
11+
"requirePragma": false,
12+
"semi": false,
13+
"singleQuote": true,
14+
"tabWidth": 2,
15+
"trailingComma": "es5",
16+
"useTabs": false
17+
}

.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"editor.codeActionsOnSave": {
3+
"source.fixAll.eslint": true
4+
}
5+
}
6+

Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Use the official Node.js runtime as a parent image
2+
FROM node:18
3+
4+
# Set the working directory in the container
5+
WORKDIR /usr/src/app
6+
7+
# Copy package.json and package-lock.json to the working directory
8+
COPY package*.json ./
9+
10+
# Install project dependencies
11+
RUN npm install
12+
13+
# Copy the rest of your app's source code
14+
COPY . .
15+
16+
# Expose the port that your Next.js app will run on
17+
EXPOSE 3000
18+
19+
# Define the command to start your Next.js app
20+
CMD ["npm", "run", "dev"]

README.md

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
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

Comments
 (0)