CODEIT is a course-selling web platform where users can browse and purchase educational courses, managed and operated by an admin. It provides a robust interface for users to buy courses and for the admin to manage course listings and user activities.
- Users can browse and purchase courses.
- Admin can manage course listings, user roles, and view sales reports.
- Passwords are securely hashed using
bcrypt. - JWT-based authentication for secure user sessions.
- MongoDB as the primary database for storing users, courses, and transactions.
- Node.js: Backend runtime environment.
- Express.js: Web framework for handling HTTP requests and routing.
- MongoDB & Mongoose: NoSQL database and ODM for managing data.
- bcrypt: Password hashing for secure user authentication.
- JWT (jsonwebtoken): For handling user authentication via tokens.
- Nodemon: Development tool for automatic server restarts on file changes.
- dotenv: For managing environment variables.
-
Clone the repository:
git clone cd -
Install the dependencies:
npm install
-
Create a
.envfile in the root of your project and add the following environment variables:touch .env
Sample content for the
.envfile:PORT=5000 MONGO_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret
-
Start the server:
npm start
The server will start and can be accessed at
http://localhost:5000.
-
start: This will run the project using
nodemonto automatically restart the server when file changes are detected.npm start
Nodemon will watch the project for changes, making development easier.
The application relies on a few key environment variables, which should be added to a .env file:
- PORT: The port on which the server will run (e.g., 5000).
- MONGO_URI: Your MongoDB connection URI.
- JWT_SECRET: The secret key for signing JSON Web Tokens (JWT).
Example .env file:
PORT=5000
MONGO_URI=mongodb://localhost:27017/codeit
JWT_SECRET=mysecretkey-
User Features:
- Users can register and log in.
- Browse available courses.
- Purchase courses via secure payment methods.
- Leave reviews and feedback for purchased courses.
-
Admin Features:
- Manage the course catalog (add, edit, remove courses).
- Manage users (view, edit, remove users).
- Access sales and performance reports.
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create your feature branch (
git checkout -b feature/new-feature). - Commit your changes (
git commit -m 'Add some feature'). - Push to the branch (
git push origin feature/new-feature). - Open a Pull Request.
This project is licensed under the ISC License.