Skip to content
Mihir Parmar edited this page Aug 29, 2024 · 4 revisions

Enlighten Project Wiki

Table of Contents

Introduction

Enlighten is a comprehensive platform designed to provide an all-in-one solution for content creators and learners. The platform includes features such as content upload, interactive learning, progress tracking, and community collaboration.

Project Structure

The project is divided into two main components: the frontend and the backend. Below is an overview of the directory structure.

Frontend

The frontend is responsible for the user interface and interaction.

enlighten/ │ ├── frontend/ │ ├── app/ │ │ ├── pages/ # Directory containing different pages │ │ │ ├── creatorpage.tsx # Creator page component │ │ │ ├── discoverpage.tsx # Discover page component │ │ │ ├── landingpage.tsx # Landing page component │ │ ├── components/ # Reusable UI components │ │ │ ├── ui/ # UI-related components (e.g., Button, Input) │ │ │ │ ├── button.tsx │ │ │ │ ├── input.tsx │ │ │ │ ├── avatar.tsx │ │ │ ├── TypeWriter.tsx # TypeWriter component │ │ │ ├── AnimatedLogo.tsx # AnimatedLogo component │ │ ├── layout/ # Layout components │ │ │ ├── header.tsx # Header component │ │ │ ├── footer.tsx # Footer component │ │ ├── api/ # API routes │ │ │ ├── auth.tsx # Authentication API routes │ │ ├── page.tsx # Main entry point for the Home page │ ├── public/ # Public assets │ │ ├── images/ # Images and icons │ │ └── favicon.ico # Favicon │ ├── styles/ # Global and component-specific styles │ │ └── globals.css # Global styles │ ├── .env.local # Environment variables for frontend │ ├── package.json # Project dependencies and scripts for frontend │ ├── tailwind.config.js # Tailwind CSS configuration │ ├── postcss.config.js # PostCSS configuration │ └── README.md # Frontend documentation │ ├── backend/ │ ├── src/ # Source files │ │ ├── controllers/ # Route controllers │ │ │ ├── authController.js # Authentication controller │ │ │ ├── contentController.js # Content management controller │ │ ├── models/ # Database models │ │ │ ├── User.js # User model │ │ │ ├── Content.js # Content model │ │ ├── routes/ # API routes │ │ │ ├── authRoutes.js # Authentication routes │ │ │ ├── contentRoutes.js # Content management routes │ │ ├── middleware/ # Middleware functions │ │ │ ├── authMiddleware.js # Authentication middleware │ │ ├── config/ # Configuration files │ │ │ ├── db.js # Database configuration │ │ ├── server.js # Main entry point for the server │ ├── .env # Environment variables for backend │ ├── package.json # Project dependencies and scripts for backend │ ├── README.md # Backend documentation │ ├── jest.config.js # Jest configuration for testing │ ├── nodemon.json # Nodemon configuration for development │ ├── .gitignore # Git ignore file for backend │ └── .prettierrc # Prettier configuration for code formatting │ └── README.md # Overall project documentation

Installation

Follow these steps to set up the project locally.

Frontend Setup

  1. Navigate to the frontend directory: cd enlighten/frontend

markdown Copy code 2. Install the dependencies: npm install

markdown Copy code 3. Create a .env.local file with the necessary environment variables.

Backend Setup

  1. Navigate to the backend directory: cd enlighten/backend

markdown Copy code 2. Install the dependencies: npm install

markdown Copy code 3. Set up the environment variables in a .env file. 4. Start the MongoDB server if it’s not already running.

Usage

Running the Frontend

  1. Navigate to the frontend directory: cd enlighten/frontend

markdown Copy code 2. Start the development server: npm run dev

markdown Copy code

Running the Backend

  1. Navigate to the backend directory: cd enlighten/backend

markdown Copy code 2. Start the backend server: npm start

markdown Copy code

API Endpoints

Authentication

  • POST /api/auth/login - User login
  • POST /api/auth/signup - User signup

Content Management

  • GET /api/content - Get all content
  • POST /api/content - Create new content
  • GET /api/content/:id - Get content by ID

Deployment

To deploy the project, follow these steps:

  1. Set up environment variables on the server.
  2. Build the frontend and backend: npm run build

markdown Copy code 3. Start the servers on your hosting environment.

Contributing

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Commit your changes (git commit -am 'Add new feature').
  4. Push to the branch (git push origin feature-branch).
  5. Open a Pull Request.

License

This project is licensed under the MIT License. See the LICENSE file for details.