The Credit Reward App is a full-stack application that allows users to earn and redeem rewards based on their activities. The application includes both a frontend built with Angular and a backend built with Node.js and Express. The system stores data in a MongoDB database and ensures secure user authentication using JWT.
- User Authentication: Secure login and registration using JWT tokens.
- Reward Management: Allows users to create, view, and redeem rewards.
- Admin Dashboard: Admins can manage the rewards and users in the system.
- Responsive UI: Built with Angular and Bootstrap for mobile and desktop compatibility.
- Frontend: Angular, Bootstrap
- Backend: Node.js, Express, MongoDB, Mongoose
- Authentication: JWT, bcrypt
- Styling: Bootstrap
- Database: MongoDB
-
Clone the repository.
git clone https://github.com/yourusername/credit-reward-app.git cd credit-reward-app/frontend
-
Install the dependencies using npm:
npm install
-
Serve the Angular app:
ng serve
This will start the frontend server on
http://localhost:4200
.
-
Clone the repository if you haven't already:
git clone https://github.com/yourusername/credit-reward-app.git cd credit-reward-app/backend
-
Install the backend dependencies:
npm install
-
Set up your MongoDB database (either locally or using a cloud service like MongoDB Atlas).
-
Create a
.env
file in the backend folder to store your environment variables:DB_URI=mongodb://localhost:27017/credit-reward-app JWT_SECRET=your-secret-key
-
Start the backend server:
npm start
The backend will run on
http://localhost:5000
.
-
Clone the repository:
git clone https://github.com/yourusername/credit-reward-app.git
-
Navigate to the frontend and backend directories and run the respective installation commands:
cd frontend npm install cd ../backend npm install
-
Make sure MongoDB is running if using a local database, or update the
.env
file for a cloud database connection. -
Start both the frontend and backend servers.
The following dependencies were installed manually for the frontend:
@angular/core
: The main Angular framework for building the app.@angular/cli
: CLI tool for creating and managing Angular projects.@angular/forms
: Angular's form module for handling form inputs.@angular/router
: Angular's routing module for navigating between pages.bootstrap
: A front-end framework for building responsive websites.rxjs
: A library for reactive programming using observables.
To install these dependencies, run:
npm install @angular/core @angular/cli @angular/forms @angular/router bootstrap rxjs
The following dependencies were installed manually for the backend:
express
: Web framework for Node.js.mongoose
: MongoDB ODM for easier database interactions.jsonwebtoken
: For generating and verifying JWT tokens for authentication.bcryptjs
: For hashing passwords securely.dotenv
: For managing environment variables.cors
: For enabling cross-origin requests between the frontend and backend.
To install these dependencies, run:
npm install express mongoose jsonwebtoken bcryptjs dotenv cors
nodemon
: Automatically restarts the server during development.
To install this dependency, run:
npm install --save-dev nodemon
- Open the Angular frontend in your browser at
http://localhost:4200
to interact with the app. - Use the backend API for managing rewards and user authentication at
http://localhost:5000/api
. - Make sure to sign up or log in to view and manage rewards.
Admins can log in using their credentials to access the admin dashboard and manage users and rewards. Access the dashboard at http://localhost:4200/admin
.
This project is licensed under the MIT License - see the LICENSE file for details.