gagigante / EColeta-NLW1

Ecoleta is a marketplace to help people to find garbage collection points efficiently

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ecoleta

Ecoleta

GitHub language count Repository size GitHub last commit Repository issues License

Technologies   |    How to run   |    Project   |    How to contribute   |    License


Frontend

πŸš€ Technologies

This project was developed with the following techs:

πŸ’» Project

Ecoleta is a marketplace to help people to find garbage collection points efficiently.

πŸƒ How to run

BACKEND:

So access the fold server and run:

To install dependencies

  $ yarn
  
  or

  $ npm install

To run the migrations

  $ yarn knex migrate:latest

  or

  $npm knex migrate:latest

You need to update some files with your current IP address:

server/src/controllers/ItemsController.ts

  const serializedItems = items.map(item => {
    return {
      id: item.id,
      title: item.title ,
      image_url: `http://YOUR_IP_ADDRESS:3333/uploads/${item.image}`,
    };
  });

server/src/controllers/PointsController.ts

  const serializedPoints = points.map(point => {
    return {
      id: point.id,
      title: point.title ,
      image_url: `http://YOUR_IP_ADDRES:3333/uploads/${point.image}`,
    };
  });
  const serializedPoint = {
    ...point,
    image_url: `http://YOUR_IP_ADDRES:3333/uploads/${point.image}`,
  };

So you can run the api:

To start the server

  $ yarn dev

  or

  $ npm dev

WEB:

Just access the fold web and run:

To install dependencies

  $ yarn
  
  or

  $ npm install

To start the server

  $ yarn start

  or

  $ npm start

MOBILE:

First you need to edit the file api.js with your current IP address.

mobile/src/services/api.js

import axios from 'axios';

const api = axios.create({
  baseURL: 'http://YOUR_IP_ADDRESS:3333',
});

export default api;

So access the fold mobile and run:

To install dependencies

  $ yarn
  
  or

  $ npm install

To start the server

  $ yarn start

  or

  $ npm start

πŸ€” How to contribute

  • Fork this repo;
  • Create a branch for your new feature: git checkout -b my-feature;
  • Commit your changes: git commit -m 'feat: My brand new feature';
  • Push it to your branch: git push origin my-feature.

After merge of your pull request, you can delete your branch.

πŸ“ License

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


About

Ecoleta is a marketplace to help people to find garbage collection points efficiently

License:MIT License


Languages

Language:TypeScript 75.6%Language:CSS 22.5%Language:HTML 1.6%Language:JavaScript 0.2%