An open API service indexing awesome lists of open source software.

https://github.com/batanoffs/crops-info

A comprehensive wiki for plants/crops, that informs users how to manage and grow different spices. The final project for the Angular course at SoftUni.
https://github.com/batanoffs/crops-info

angular18 crops express garden mongodb rest-api

Last synced: about 2 months ago
JSON representation

A comprehensive wiki for plants/crops, that informs users how to manage and grow different spices. The final project for the Angular course at SoftUni.

Awesome Lists containing this project

README

          

# Crops Wiki

[![License: MIT](https://img.shields.io/badge/Licence-MIT-teal)](https://opensource.org/licenses/MIT)
[![styled with: Prettier](https://img.shields.io/badge/styled_with-prettier-purple)](https://github.com/prettier/prettier)

This application serves as a comprehensive wiki for crops, providing users with detailed information on various types of plants and their cultivation, pests, dieses and nutrition. Users can browse through the catalog to find specific crops, and if they are the original creators, they have the ability to modify crop information. They can also add a specific crop to favorites or create a new one.

**Important Notes:**

- *Angular based project with REST api and mongo DB*
- *The project is still in early stage, but the most common CRUD operations are implemented*
- *demo coming soon*

During development, I've learned about:
- fully utilizing the features that the Angular 18 version provides
- configure database in MongoDB and store images to the Cloudinary cloud provider
- build a functional backend API and provide data to the client
- store tokens with cookies
- implementing guards to prevent unauthorized access
- configuring CORS
- encryption methods (salting) and many more.

## Table of Content
- [๐Ÿ”ฌ Technologies used](#๐Ÿ”ฌ-technologies-used)
- [๐ŸŽฌ Features](#๐ŸŽฌ-features)
- [๐Ÿ”ง Installation](#๐Ÿ”ง-installation)
- [๐Ÿ“ Project content](#๐Ÿ“-project-content)
- [๐Ÿ“ Folder Structure](#๐Ÿ“-folder_structure.md)
- [๐ŸŽจ Design and Architecture](#๐ŸŽจ-design-and-architecture)
- [โš™๏ธ Frontend architecture](#โš™๏ธ-frontend-architecture)
- [โš™๏ธ Backend architecture](#๏ธโš™๏ธ-backend-architecture)
- [๐Ÿš€ FUTURE Development:](#๐Ÿš€-future-development)
- [๐Ÿ“Fixes and updates:](#๐Ÿ“-fixes-and-updates)

## ๐Ÿ”ฌ Technologies used

| Category | Technologies |
| -------------- | ------------------------------------------------------ |
| Frontend | `Angular 18`, `TypeScript` |
| Server | `Node`, `Express`, `Cors`, `Cookie-parser`, `Multer`, |
| UI | `SASS`, |
| Forms | `NG forms` |
| Database | `MongoDB`, `Mongoose` |
| Encryption | `bcryptjs` |
| Authentication | `JsonWebToken` |
| API Request | `http module` |
| Tools | `Git`, `Vite`, `ESLint`, `Prettier`, `npm`, `Nodemon`, |

## ๐ŸŽฌ Features

Here are some examples of how to use this project:

- Register and login as a user
- Browse crops in the catalog page
- Create and edit crops
- Add and manage items to the favorites
- Check each crop details in the Details Page

## ๐Ÿ”ง Installation

Follow the instructions below:

1. Clone the repository

```bash
git clone https://github.com/batanoffs/crops-info.git
```

2. Navigate to the project directory: `cd your-project-directory`
3. Install dependencies for the server and the client:

```bash
./cd client && npm install
```

```bash
./cd server && npm install
```
4. **The application should start automatically because of the `vscode config` file.**
5. If it does not, you can manually run the development server and the client cd to the main directory and:

```bash
./cd server && npm start
```

```bash
./cd client && npm start
```

6. Open your browser and go to [http://localhost:4200/](http://localhost:4200/) to view the app.
7. Register a new account and login

## ๐Ÿ“ Project content

- Home page
- Login Register
- Catalog
- Crops details
- Favorites
- Create crops
- Edit crops

## ๐ŸŽจ Design and Architecture

Server built on `express` and `mongodb` with `mongoose`. Client built with `Angular 18`.

### โš™๏ธ **Frontend architecture**

- #### Signals
- placeholder

- #### ๐Ÿ›ซ Routers

- Routes

- #### ๐Ÿงฎ Utils

- Constants

- **placeholder** - *info*

- Helpers

- **placeholder** - *info*

- #### ๐Ÿ™‹โ€โ™€๏ธ Services

- **placeholder** - *info*

### โš™๏ธ **Backend architecture**

- #### ๐Ÿ›  Express config

- **express.ts** - contains express middleware
- **database.ts** - contains mongoose middleware
- **routes.ts** - contains express routes

- #### ๐Ÿ“ฎ Models

| Model | Attributes |
| ---------- | ------------------------------------------------------------------ |
| Crops | `id`, `name`, `description`, `pesticides`, `picture`, `createdAt`, |
| Pesticides | `id`, `name`, `description`, `picture`, `createdAt`, |
| User | `id`, `email`, `password`, `register_date`, `role` |
| Favorites | `id`, `user`, `productRefs` |

- #### ๐Ÿ›ซ Routes

| Name | Route url | Description |
| ------- | ------------ | ------------------------------------------------------------ |
| Main | `/api/**` | Main router that combines all routes under `/api` |
| Catalog | `/api/crops` | Catalog router that combines all routes under `/api/crops/*` |

- #### ๐Ÿ“ก Controllers

- **placeholder** - *info*

- #### ๐Ÿ™‹โ€โ™€๏ธ Services

- **placeholder** - *info*

- #### โŒจ๏ธ Middlewares

- **placeholder** - *info*

- #### ๐Ÿงฎ Utils

- **placeholder** - *info*

## ๐Ÿš€ FUTURE Development:

1. Placeholder

## ๐Ÿ“Fixes and updates:

- [ ] placeholder