Backend for LinkUni
This repository contains the backend API for LinkUni, which powers the core functionalities such as authentication, database interactions, email notifications, file storage, and more.
-
Clone the Repository:
git clone https://github.com/chhavikant-01/link-uni-backend.git
-
Install Dependencies:
npm install
-
Set Up Environment Variables:
Create a
.env
file in the root of your project and configure the following variables:# Database Configuration MONGO_URL=<your_mongo_db_connection_string> # Server Configuration PORT=<port_number_for_backend> LOCAL_PORT=<local_port_for_testing> # JWT Configuration JWT_SECRET=<your_jwt_secret_key> JWT_EXPIRES=<jwt_expiration_time> # URL Configurations BASE_URL=<backend_base_url> FRONTEND_BASE_URL=<frontend_base_url> # Email SMTP Configuration SMTP_HOST=<your_smtp_host> SMTP_PORT=<your_smtp_port> SMTP_SERVICE=<your_smtp_service_provider> SMTP_MAIL=<your_email_address> SMTP_PASSWORD=<your_email_password> # AWS S3 Configuration S3_SECRET_ACCESS_KEY=<your_aws_secret_access_key> S3_ACCESS_KEY_ID=<your_aws_access_key_id> AWS_REGION=<your_aws_region> S3_BUCKET_NAME=<your_s3_bucket_name> # Email Domain Restriction EMAIL_ALLOWED_DOMAIN=<allowed_email_domain>
-
Run the Backend Server:
nodemon index.js
- Create an S3 bucket in your AWS account.
- Configure IAM user permissions for programmatic access.
- Add the bucket name, access key, and secret key to your
.env
file.
- Use an email service provider like Gmail, SendGrid, or others.
- Enable "less secure app access" or configure OAuth for security.
- Add your SMTP details to the
.env
file.
We welcome contributions! Follow these steps to set up the project locally:
- Fork this repository.
- Create a feature branch:
git checkout -b feature/your-feature-name
- Commit your changes:
git commit -m "Add your message"
- Push to your fork:
git push origin feature/your-feature-name
- Create a pull request!
This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License.
If you have questions, feel free to reach out: Chhavikant Mahobia