Welcome to this project, created by two students from Ironhack. This is a webpage created with the idea of serving a very big community: The players of Magic. Its made to search for magic cards through a connected API, you can choose your favourite cards, add them to your user, and create decks with them.
Here comes the fun.
You can find the project deployed here: Heroku
If you wish, you can clone this repo and test it. Any improvements are welcome!
1. First, you must have npm installed in your computer in order to download the dependencies used in this project. After that write in the console, in the project folder:
npm i
2. Create a .env file with the global parameters needed for this project at root. It should be like this for the port of the localhost, local and remote databases:
PORT=3000
DB_LOCAL=mongodb://localhost/---any-name---
DB_REMOTE=---your-remote-DB-here---
3. Make sure to change mongoose.config.js from DB_LOCAL to DB_REMOTE. And you are good to go!
This project has the following endpoints:
ID | Routes | Method | Description | Protected with auth |
---|---|---|---|---|
1 | / | GET | Main view. | No |
2 | /signup | GET | Renders the view to create a user. | No |
3 | /signup | POST | Sends the data from the view to create the user in the DB. | No |
4 | /login | GET | Renders the view to log in. | No |
5 | /login | POST | Sends the data to log in with passport. | Yes |
6 | /logout | GET | User logout. | No |
7 | /main/cardlist | GET | Renders the view to search cards after logging in. | Yes |
8 | /main/cardlist | POST | Sends the data to the API to search for cards. | Yes |
9 | /main/cardlist/:id | GET | Renders the view to see the details for each card. | Yes |
10 | /main/cardlist/:id/selected | GET | Card is added to the user personal list. | Yes |
11 | /profile | GET | Renders the view of the user. | Yes |
12 | /profile/createdeck | GET | Renders the view to create a deck. | Yes |
13 | /profile/createdeck | POST | Sends the data to create the deck. | Yes |
14 | /profile/deletedeck/:id | GET | Eliminates the deck. | Yes |
15 | /profile/deletecard/:id | GET | Eliminates a card from the user personal list. | Yes |
16 | /profile/carddetails/:id | GET | Renders the view to see the details of a card from the user. | Yes |
17 | /profile/setedit/:id | GET | Renders the view to add and delete cards from the Deck. | Yes |
18 | /profile/setedit/add/:id | POST | Adds a card to the deck. | Yes |
19 | /profile/setedit/deletecard/:id | POST | Deletes a card from the deck. | Yes |
This project is built with:
- Node.
- Express.
- MongoDB.
- Mongoose.
- Handlebars.
- Sass.
- Bcrypt.
- mtgsdk (the heart of this).
- Magic API.
You can fork this repo and push your changes to us. Please indicate your name, and a few instructions of what you did. We will follow closely your updates and keep in touch with you!
Two Ironhackers:
- Thanks to all the team of Ironhack, to our teachers and TAs to make this project possible! 📢
- Thanks to all those who want to keep up developing this app! 🤓