Welcome to the server side of Foogle! This Node.js application serves as the backend for foogle.foo, handling various functionalities such as web scraping, user authentication, and interaction with the database.
-
Web Scraping: The server uses Puppeteer to scrape listings from Craigslist, eBay, and Facebook Marketplace. These listings provide up-to-date product information for users.
-
User Authentication: The application supports user authentication through endpoints for user registration (signup) and user login, implementing jwt.
-
Product Management: Users can retrieve and post products they are interested in. These products are saved in the database and can be accessed through relevant endpoints.
- Node.js
- Express
- Puppeteer
- MongoDB
- Mongoose
- JWT
- nodeMailer
- bcrypt
- Clone the repository:
git clone https://github.com/jmedina21/Foogle-Server.git
- Install dependencies:
npm install
- Set up your database configurations in a
.env
file:
- PORT = ???
- MONGODB_URI = ???
- JWT_SECRET = ???
- EMAIL = ???
- EMAIL_PASSWORD = ???
-
To create a accounts you need to configure the transporter body from nodeMailer, line 9 in signup.js. Documentation in - https://github.com/nodemailer/nodemailer
-
Run the server:
node server
- GET /listings/craigslist?search=???? Get listings from Craigslist
- GET /listings/ebay?search=???? Get listings from ebay
- GET /listings/facebook?search=???? Get listings from facebook marketplace
- POST /signup: Register a new user.
- POST /login: Authenticate a user.
- GET /products: Retrieve saved products for a user.
- POST /products: Save a new product for a user.
- DELETE /products: Delete a saved product.
- GET /validate: Account verification
The application uses MongoDB as the database to store user information, saved products, and other relevant data. Mongoose is used as a query builder to interact with the database.
-
Create a free MongoDB account in - https://www.mongodb.com/
-
Create a database and get the URI - https://www.mongodb.com/docs/guides/atlas/account/
Contributions to this project are welcome! If you find a bug or want to add a new feature, feel free to open an issue or submit a pull request.