Code Monkey home page Code Monkey logo

malvarisco_admin's Introduction

Malva-Risco Adminpage

Web admin for Malva-Risco farm, in Tenerife island. πŸ’š

0. Roadmap

  • βœ… Getting started: (20%)
    • βœ… Upload your project to GitHub (1/20 %)
    • βœ… Write a README.md (1/20 %)
    • βœ… Add your postman documentation in the readme. (2/20 %)
    • βœ… Postman - GET. (2/20 %)
    • βœ… Postman - POST. (2/20 %)
    • βœ… Postman - DELETE. (2/20 %)
    • βœ… Postman - PUT. (2/20 %)
    • βœ… Ionic - GET. (2/20 %)
    • βœ… Ionic - POST. (2/20 %)
    • βœ… Ionic - DELETE. (2/20 %)
    • βœ… Ionic - PUT. (2/20 %)
  • βœ… Frontend (20%)
  • βœ… Photos (10%)
    • βœ… Take photos with device's camera. (5/10 %)
    • βœ… Handle photos from frontend (CRUD). (2,5/10 %)
    • βœ… Store the photo in the backend (CRUD). (2,5/10 %)
  • ⬜ Auth (10%)
    • ⬜ Implement basic authentication (10/10 %)
      • 🚧 WIP in feature-auth branch

πŸƒπŸ»β€β™€οΈ 1. Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

πŸ‘β€πŸ—¨ See deployment for notes on how to deploy the project on a live system.

πŸƒπŸ»β€β™€οΈπŸ“ 1.1 Prerequisites and installing

1️⃣ If you haven't Git installed in your local machine, I hardly encorage you to install it. Then you could clone the whole repository.

git clone https://github.com/iremaru/malvarisco_admin.git

2️⃣ You will need Node >16.13.0 to run the server either in the backend (api to database) as in the frontend (web).

If you are a window user, you should download it at nodejs.org.

If, instead, you are a linux user, you would download it from terminal.

apk add nodejs npm

Finally, if you are an IOS user, you can buy it in the app-store. 🀑

Sorry, it's a bad joke. You can download it at nodejs.org, like any other window user.

3️⃣ It's not mandatory to install Angular Cli globally, but you will need it at least in the project.

Install globally:

npm i -g @angular/cli

Install locally:

cd frontend/
npm i @angular/cli

4️⃣ Install ionic

npm install -g @ionic/cli

5️⃣ Create an local database

You can use wamp, xampp, or whatever tool of your preference.

❗❗ Your database must be named 'malvariscoDB' in order to be recognized by the backend.

If you are going to enter data in spanish, I recomend you to use utf8_spanish_ci in ordert to save text with "Γ±".

New Database

6️⃣ Make a new file inside the backend directory called db.config.js:

new-item ./backend/config/db.config.js

If you are using Visual Studio Code, you can create and edit the file at once writing in your terminal:

code ./backend/config/db.config.js

7️⃣ Inside the file include the following info:

module.exports = {
    HOST: 'localhost',
    USER: 'userName', //❗❗ Fill it with your database user
    PASSWORD: 'userPassword', //❗❗ Fill it with your database user password
    DB: 'malvariscoDB', //❗❗ If you prefer to change your database name, then you must change it here too.
    dialect: 'mysql',
    pool: {
        max: 5,
        min: 0,
        acquire: 30000,
        idle: 10000,
    }
};

8️⃣ Create an .env in your backend root;

JWT_SECRET=Y0u_4r3-mY~L0v3lyS3cr3t!4r3ntY0u? #πŸ‘ˆ Here your secret

MYSQL_DATABASE=malvariscoDB     #πŸ‘ˆ Your DB
MYSQL_USER=root                 #πŸ‘ˆ Your user
MYSQL_PASSWORD=                 #πŸ‘ˆ Your password
MYSQL_ROOT_PASSWORD=            #πŸ‘ˆ Your super admin password, without steroids

DB_HOST=localhost

NODE_ENV=development

9️⃣ Install node modules in the backend and in the frontend

cd backend/
npm install
cd ../frontend/
npm install

πŸƒπŸ»β€β™€οΈπŸ”§ 1.2 Testing the API

You can test the backend is running, and the API is live with Postman.

Run in Postman

Link to the API documentation

🚚 3. Deployment

Now, I'm sure you want to see the webpage by your own.

First, we are going to raise the API:

If it's first time running the project, you need to set the development mode in order to create the database tables.

❗❗ Whenever you need to drop the database data, repeat this step. Avoid if you do not want to lose your data.

cd ./backend/ # <= if you are in root directory
npm start devmode # <= if this is your fist time running the project or you want to drop your data.

Next time you want to run the database server:

cd ./backend/ # <= if you are in root directory
npm start

If you terminal print an error like this:

DB connection refused

Maybe you haven't run your db server. So, if you are using Wamp Server, Xamp or whatever tool of your preference, run it.

‼️ If you want to stop the backend, you must press "ctrl + c" in the terminal.

Now you will need to run the frontend. To do this, you will need other terminal. If you are using Visual Studio Code, you can have as much as you want, and named it to identify it clearly.

Example:

VSC Terminals

Now, in your frontend terminal you have to run the frontend:

cd ./frontend/ # <= if you are in root directory
npm start

There is it. You have had to wait a little bit, but it will be done finally, and in the terminal you will see the port where your website will be running.

Compiled successfully

Go on and try it out in your preferred web browser:

Home page screenshot

In order to see the data you need to click over the eye icon.

How to see data

🚧 4. Built With

Frontpage image: Farm Vectores, by Vecteezy.

πŸ‘©πŸ»β€πŸŒΎ 7. Authors

  • Iremaru - Initial work - GitHub

πŸ“ƒ 8. License

This project is licensed under the MIT License.

🧾 9. Acknowledgments

  • This project is the result of "Multimedia and Mobile development" subject's activity, as part of DAM course (Cross-platform development training course) given by Tiburcio Cruz, aka Tcrurav from I.E.S. El RincΓ³n, in Canary Islands.
  • This project was inpired by my mom's vegetable garden, πŸ’šMalva-riscoπŸ’š and her needs for an admin system.

malvarisco_admin's People

Contributors

iremaru avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.