This project is basically a web application in which there is google authentication using next auth and simple CRUD operations of content in a Rich Text Editor (react-quill). Also I'm using mongo db for database and storing the collections - user and content.
The files and folder structure is not very complicated because this is an next js application -
- There is a main src directory in which app folder is there containig all routes.
- Inside the app folder there is a folder for auth in which handler is implmented by creatino of auth options.
- Then there is a content folder in which contains API endpoints for managing the content - dynamic routing is there for updation and deletion of specific content via id's
- There is a editor folder which is a /editor route in which we are doing our CRUD operation of content from a rich text editor.
- Component folder contains a error page component and Navbar component for easily signing in and signing out.
- There is also a lib folder inside the src directory which has a file responsible for database connection.
- models folders in the src contains the User and Contentt schema.
- GOOGLE ID and GOOGLE SECRET for Oauth.
- MONGODB_URI - this is a connection string to connect your cluster with the database.
- NEXTAUTH_URL can be http://localhost:3000
- Down the .zip or clone this repository.
- Navigate to the project directory.
- Install dependencies:
npm install
- Make an .env file in the root directory with keys as MONGODB_URI, GOOGLE_ID, GOOGLE_SECRET and NEXTAUTH_URL and the values would be their respective keys
- Run the development server:
npm run dev
- Open your browser and navigate to
http://localhost:3000
to view the application :)
Contributions are welcome!
For major changes or bugs or have suggestions for improvement, please open an issue first to discuss what you would like to change.